The group decided to design a VHDL program that resembles the game Flappy Bird which should be based on Lab 6.
To simplify the difficulty of programming, the team decided to make the game as a car race instead of Flappy Bird. There will be an on-screen car where the user can use the potentiometer, which is connected to the Nexys4 board with the A/D converter, to move the car to left or right. Meanwhile on the top of the screen, there will be constantly generating the gap of the railings approaching downwards. This gap is indicated by a yellow bar. Whenever the car miss passing the yellow bar, the game will be over. The code used in this project will be mainly modified from the Lab 6.
There be generating a car in the bottom of the screen which can be controlled by the poentiometer. The team attempted to generate the gap but it did not appear on the screen.
Now the yellow bar that represents the gap of the railing can be generated on the top of the screen, but it was not able to move.
Now when the user pressed the start button, the yellow bar will "teleport" downwards. The next goal was to make the yellow bar move downwards in a constant speed.
The yellow bar was able to move downwards at a constant speed. When the car missed the yellow bar, the game would reset by itself. The user had to press the start button in order to start a new game. The code is shown in the picture below.
The yellow bar can be generated at different position without manually changing the code. However, when the ball did not pass the center of the yellow bar, it would still be regarded as game over.
This is the first iteration of the code. This heavily focused on removing the irrelevant code from Lab 6's pong, and renaming some variables to suit the needs of the new program.
On this second iteration, much of the fat of the program is cut out and replaced with more appropriate code. The bar is now able to be shown but is having issues without vertical movement. A formula is added in to change the position of the gap every time it reaches the bottom.
In the third iteration vertical movement is restored and a progressive difficulty system is put in place. Errors still exist as the 'score' variable is not increasing correctly which is believed to be a hardware issue.
For the final code we settled on removing the progressive difficulty and making the game run on a single speed throughout.