Problem Set 11
Due date: 12/1: design, 12/06 @ 10pm
The goal of this problem set is to put it all together.
HtDC: exercises in parts v and vi
Note: You may use the ProfessorJ Intermediate+access language level for your project. If you feel comfortable in full Java, you may use it instead and your preferred Java IDE; for those of you who do wish to use full Java, please see Prof. Proulx's software packages for working in a professorJ-like context. In either case, you must be able to justify your design according to this course's standards.
Schedule: You must meet with a TA on Monday, December 1, and get approval for a paper copy of your class diagram. That is you must have completed your data design at that point. You may also discuss details of the data design with your TA at that point. See the blog for the precise schedule of TA hours on that day.You will not be able to code walk your final project without a data design signed by a TA.
Description: Design a variant of the Snake game. The Snake world consists of a piece of food and a multi-segment snake. In the beginning, the snake has only a head segment and it rests in the middle. The player can move the snake with the four arrow keys, and the snake corresponds with appropriate movements. Once the snake moves in some direction, it keeps moving. If it runs into any of the four walls of the canvas, the game is over.
The snake can, and is supposed to, eat the food. Eating a piece of food grows the snake by one segment. Then a new piece of food appears at some random spot on the canvas. As the snake grows, a new danger appears: the snake can now run into itself. If the snake does run into itself, the game is also over.
Here is an image from the game:
The green dot is the food, the sequence of red dots is the snake, and as you can see the snake's head segment has a marker that distinguishes it from all tail segments.
The goal of the game is for the snake to eat as many pieces of food. A player's score is the number of segments of a snake at the end of a game.
|last updated on Tue Jun 9 22:21:18 EDT 2009||generated with PLT Scheme|