This Snake is Down Right Fierce

by Charles Hung

 

Abstract

The purpose of this project is to implement a version of the classic game Snake on the FPGA. There are three major design components to the project: a system to display graphics, a system that handles game logic, and a system to handle commands from the user. The display component will be handled by using a VGA interface in conjunction with sprites and dual ported block ROM. The game itself will be encapsulated in a major/minor FSM. A player will be able to give commands to the snake through a PS/2 controller hooked up to the mouse port.

The design will be handled in three phases, one for each of the major subsystems. The first phase will be to output a screenshot of the game, which will consist of the level background, the snake, and the apple. The level background is static, so I will use a dual ported block ROM to store the 3-bit RGB values of each pixel on the screen. The snake and apple will be drawn using sprites. The challenge at this stage will be making sure the block ROM receives the appropriate control signals and can be read from. The second phase will be to get the PS/2 controller working. I will need to write an interface in Verilog to handle the signals from the controller and turn them into signals that the game FSM can process. At this point, I will implement some very basic game logic just to check if the snake responds correctly to the player's commands. When the controller works fine, I can start implementing the game logic. The minor FSM will have to do collision detection, as well as update the position of the snake. The major FSM simply keeps track of whether the game is ongoing or has reached a game over state.

 

Links To Files

Report Appendix (PDF)

 

Photos