This is a simple shoot the target game in a 32 x 32 square which calculates the trajectory of a ball.
A target will randomly be generated in the top two rows of the playing field and your goal is to position your cannon, aim it, and hit the target. The ball that is shot can be bounced off the left and right walls, but once it hits the ceiling, the game is over.
Your cannon will be at the bottom row of the 32 x 32 square. You will be able to move it left or right to any square on this bottom row. You will also have 7 different aiming positions.
Controls:
All shots will be in a linear fashion. For example, if you select the default aim position (which is Left 2 and Up 1), the ball will be shot linearly with a slope that goes left 2 and up 1.
Here are all the available aiming positions:
The generated target's x and y position will be outputted in the uo[2:6] wires after the game is initialized. In the first cycle after initialization, these five bits will be driven to the x value and for the next cycle, they will be driven to the y value.
After shooting the ball, wait until uo[0] ("Result Valid") is set to high. This indicates that the simulation is over and the ball has hit the top of the screen. Then, uo[1] ("Hit") will tell you whether or not the ball has hit the target.
To make sure that you hit the target, you will have to draw out the trajectory of the ball in the 32 x 32 grid.
N/A
# | Input | Output | Bidirectional |
---|---|---|---|
0 | Move Left | Result Valid | |
1 | Move Right | Hit | |
2 | Aim Left | Select Data | target_x |
3 | Aim Right | Select Data | target_x |
4 | Shoot | Select Data | target_x |
5 | Select Data | target_x | |
6 | Select Data | target_x | |
7 | 0 ? target_y = 30 : target_y = 31 |