This Snake is Down Right FierceCharles Hung6.111 Final ProjectIntroduction• Object of the game is to eat “fruit” to grow longer and avoid hitting the walls or yourself• 3 different levels• Player can control the snake using a PS/2 controllerDesign Considerations• Major/Minor FSM abstraction to control game logic• Use block RAMS to display background and sprite to display the rest of the objectsSystem OverviewPS/2Interfaceclkdata8ControllerdataControl BlockDisplayBackgroundMemoryVGAVGA SignalsSnake PosRegisters3RGBnew_pos num1010pixel_countline_count20DCM27 MHz31.5 MHz (all blocks)24RGB Signalssnake_posfruit_pos20Growing the Snake• Snake represented as many segments drawn on top of each other• Can grow the snake by changing the relative position of the spritesControl Block• Control Block contains game logic and encoder for output from the PS/2 interfaceEncoder8Controllerdata8movementMajor FSMMinor FSMnext_posloseseg_numsegRGB3fruit_posnumnew_posate_fruitControl Block• Minor FSM checks for collisions between the snake and the wall, the snake and itself, and the snake and fruit• Checks for collisions with walls by using the RGB value from memory• Checks for collisions with snake by comparing position of the head with the position of the rest of the segments• Outputs a lose signal if snake does something that causes the game to end• Writes new positions of the snake segment to the registers if game
View Full Document