Hello FPGA and Arcade games fans! A couple of weeks ago we posted about how to play the Snake game on your FPGA in fore easy steps, our community member mkarlsson was not totally satisfied with the amount of FPGA resources the Verilog code uses and decided to rewrite the game to make it use less resources and now it even fits an LX9 based board like Papilio Pro or Duo with a VGA wing:
The GadgetFactory blog page has this story about the snake game written in Verilog so I decided to take a look at it. Sadly to say it’s pretty much a textbook example of how not to write HDL code. However, this idea seemed pretty cool so I decided to do an almost complete rewrite of the code (basically the only thing left from the original code is the VGA controller) while still keeping all the functionality of the original code. The new version uses about a 1/4 of the FPGA resources compared to the original code when compiled for Spartan6 and it now fits an LX9.
Please visit the original forum thread here to share your thoughts about this project.
Hello FPGA lovers. I am sure you are going to love today´s post: How to implement Snake Game on your FPGA. Maybe some of you are too young to remember this everlasting game that has been popular generation after generation on a wide variety of formats. And as it couldn´t be less, Snake Game deserves to be played on a FPGA.
The tutorial I am presenting today was developed by a group of students from the University of Manitoba. The project has 4 simple steps and all the hardware that you will need is your FPGA, a VGA monitor, a PS/2 keyboard, a USB cable and a power cable. Easy stuff here. Sorry for those hand-work lovers. More on that in future posts.
Well, getting back to the snake. According to the authors the more difficult parts to develop where the VGA output and the PS/2 keyboard input, as there is not too much information available on internet for its coding using Verilog. Read this, if you want to learn useful basics that will help you in future projects.
The FPGA that they used was an Altera DE2 Cyclone IV. Thus you may need to adapt the Verilog program to your FPGA. You can download the whole code here.
Another aspect I would like to highlight for you, it is their approach for coding the snake itself and what it eats, apples (funny uh). No they are not from IBM. Anyway, you may like to make your snake carnivore or a sweet lover so read these steps up and play with the code. Make your snake a dragon that eats carrots or whatever you want. This is the magic of coding.
We would love to see your modifications!
But as always, have fun!
Remeber the DE2 FPGA board we talked about in the last post that ECE 5760 students used to implement their HAND BREAKING BRICKS game, this time the same FPGA board is used for the implementation of the game SNAKE.
It’s not a normal version of the game.But what is special with this version is that it’s not written in VHDL wich is the predominant programming language for FPGAs. Instead, it’s built via a schematic-only approach!!
The game uses a 16×16 LED matrix as the display and an SNES controller for input, Each pixel in the display has its own individual logic circuit and this is what makes the game logic so special. Basically every cell has its own processor which reacts both to what is passed into it, as well as to a random seed.
“That seed system is called the ‘bucket brigade’ and passes a chance to spawn a piece of food from one cell to the next. All of this together makes for one simple game that is eloquently executed.”
For the implementation of the game VHDL would probably have been faster, but the schematic-only approach makes it way more interesting.
Feel free to discuss this project in the comments thread.