# Development content
Do you still remember when you were a child, Nokia robbed your parents and played the only game above with relish:
**
snake!
**
![](././../../images_dir/1618892500/1.png)
You 're right! It's back!!!
This project is based on perf-v development board to realize the design of Snake game. The game itself has three states:
**
start, play and end
**
. The three states are controlled by game_ ctrl_ Module. V module control, in the start state, press any key from key1 to key4 to start the game. In the experiment, key1-key4 on the development board is used to control the movement of the snake, and VGA is used to design the interface of the game.
# Technical introduction
In the aspect of output display, the main signal is
**
Vsync_Sig_out、HSYNC_Sig_Out and three color channel signals
**
, driving the module needs to use perf - V original clock, output 256 × First of all, a ROM IP core is instantiated for 256 size images. Here, the ROM is initialized through the COE file. The width and depth of the ROM are set and loaded into the COE file. After the start interface and end interface are set, the IP core is generated. In other states, the status of the snake and apple is updated according to the clock cycle.
![](././../../images_dir/1618892858/2.png)
# Perf-V development board **
Perf-V development board uses Xilinx Artix-7 FPGA chip
**
. Provides a wealth of peripheral interfaces, including PMOD, Arduino, JTAG, UART interfaces, and high-speed interfaces that can be extended to HDMI, VGA, USB2.0/3.0, camera, Bluetooth, SD card, expansion board, etc, with strong flexibility.
![](././../../images_dir/1618888203/3.png)
# Game content
At the beginning of the game, the first Apple will be placed in a fixed position. Every time the snake eats an apple, its body length will increase by one grid. When its body length is 16 grids, it will not increase. After the apple is eaten, a new Apple will be randomly placed on the screen. The game ends when the snake hits a wall or its own body.
![](././../../images_dir/1618893002/1.png)
![](././../../images_dir/1618893019/2.png)
![](././../../images_dir/1703141148/4.png)