
This project is a SV implementation of the Snake game, except the maximum snake size is capped at 20 to fit the 1x2 tile limit, and the snake is rainbow for fun. The game is displayed via a VGA interface (640x480 resolution) and the gameboard is 8x8 tiles centered centered in the middle of the screen. Each game tile is 32x32 pixels so the gameboard is 256x256 pixels.
The snake is implemented as a 20-tile shift register storing each tile of the current snake's row/col. This shift register takes up the majority of the tile space hence the cap at length=20. But, you can still keep playing the game after the maximum snake size is reached, the snake just won't grow anymore. You'll see the displayed scores turn purple when the max size is reached and they can keep incrementing till score=99 since I only put enough space for 2 BCD digits. If you're a total beast at snake game and reach 99 points, the score will just hold there as I didn't have the space for a special endgame visual.
| # | Input | Output | Bidirectional |
|---|---|---|---|
| 0 | START_GAME_BTN | R1 | LED0 |
| 1 | UP_BTN | G1 | LED1 |
| 2 | DOWN_BTN | B1 | LED2 |
| 3 | LEFT_BTN | VGA_VS | LED3 |
| 4 | RIGHT_BTN | R0 | LED4 |
| 5 | G0 | LED5 | |
| 6 | B0 | LED6 | |
| 7 | VGA_HS | VGA_BLANK |