CSE 131 Module 12: Game
- Update your repos to get the lab10 package in the
- Follow the comments to help implement the game.
- Or come up with your own design and implement that.
To receive credit your game must:
- Move the snake around according to user input
- Eat rats and keep score
- Decide wins and losses
How do I process keyboard input?
For this assignment, please plan to use the keys as follows, so that
your solution will work with the hardware arcade:
| Key || Meaning|
| W or w || Up |
| S or s || Down |
| A or a || Left |
| D or d || Right |
The methods of use to you from Sedgewick's API:
- boolean StdDraw.hasNextKeyType()
- You can call this method to see if the player has typed any key. It does not
wait for input, which is very useful in this context.
- char StdDraw.nextKeyTyped()
- This method returns the next key typed. You should only call this method
if the above method has returned true.
Submitting your work (read carefully)
- You must commit all of your work to your repository. It's best to do this
from the top-most level of your repository, which bears your name and student ID.
- You must demo the commited work to a TA. Make sure the TA knows that
your demo is for credit at this point.
- Follow the directions below to have your demo for this work recorded.
Last modified 11:55:48 CDT 13 May 2014
When you done with this lab, you must be cleared by the TA to receive credit.
- Commit all your work to your repository
- Fill in the form below with the relevant information
- Have a TA check your work
- The TA should check your work and then fill in his or her name
- Click OK while the TA watches
- If you request propagation, it does not happen immediately,
but should be posted in the next day or so