This was a fun game to play! =)
I'm really liking this graphics LCD shield, the PSoC Component makes it so easy to interface with the LCD over SPI.
This is definitely a cool example. One nice feature to add is saving the highest-score achieved by the player. This could be done by counting number of ball-paddle collisions. Both the current score and the highest score could then be displayed on the LCD. Saving the highest score in flash would allow score retention even after a reset.
I believe Max is going to upload a project on Monday which shows how to save a value to flash..
Any takers to add this feature ?
We all have to understand that Antonio put in this feature request to me earlier this week. This post is just a Guilt Trip! We will be posting the example on Monday to support the flash storage. It will merge nicely with Antonio's feature request
Today’s example project uses the Sparkfun Graphical LCD Display and the custom GLCD component detailed in Example #09. This example project uses the GLCD component to generate a simple game where users press buttons to control a paddle to hit a moving ball. If the ball gets past the paddle then the user will lose the game.
Forum Post Attachments:
At the bottom of this post we are including the following items:
- Example Project Zip File
- Zip File of Images
- Project Schematic
- Component Configurations
The user can download the example project at the bottom of this post. The project uses the following list of Creator Components:
- Custom GLCD
- Annotated Library for Pioneer Kit
The components are configured by right clicking on the component in your Top Design schematic view and selecting Configure. Please enable the following selections in the Configuration windows for the listed components above.
The main.c firmware is included in the example project. Please review the commented sections for more details.
This example project uses the custom GLCD component and the button inputs on the Sparkfun GLCD shield board to generate a simple paddle and ball game. The game is simple, the user must not allow the ball past the paddle. The S1 and S3 buttons on the Sparkfun LCD shield are used to control the onscreen paddle. The user can either move the paddle up or down. If the user misses the ball the screen will go black and the user will need to hit the reset button on the Pioneer kit to play again.
There are no hardware connections outside of connecting the Graphics LCD Shield to the Pioneer Kit.
Test Your Project:
Once the kit is programmed with the example project the user will be able to begin playing the Paddle and Ball game.
I hope this example can help you out in your design.