Week 5 Set a
Due Date Monday 9/30 at 9:00pm (Week 5)
Purpose To begin designing the project.
Finger Exercises
As noted above, please submit this assignment in BSL with List Abbreviations as opposed to BSL.
Graded Exercises
Pacman
In 1980, arcade video gaming was forever changed when Namco released the classic game Pac-Man. The player controls the titular character, a yellow circle with an ever-munching mouth, as it whizzes and whirls around a maze, hungry to eat all of the delicious dots within. Players need beware, however, the four terrible phantasms that haunt the game’s hallowed halls: Blinky, Pinky, Inky, and Clyde, each as hungry as Pac-Man, but with appetites far more sinister.
Pacman himself
the board
the dots
the power pellets
To make your lives easier, we have provided you with the file board.rkt (right click > save as), which provides the constants board-tiny and board-big. board-tiny is helpful for test development and debugging, but you should be sure your game works using either board.
board-tiny and board-big are each instances of a GameConfiguration. Note that you should leave the structure definitions commented out; they are provided by the given file.
Exercise 2 Design a data definition for a game of Pacman, which supports and encapsulates all of the four components mentioned above. Note that Pacman himself has a direction he is currently traveling in, and his mouth should be able to open and close.
Exercise 3 Define examples for your data definitions as well as their templates.
Exercise 4 Design a function that given a GameConfiguration will create your initial world state. In this initial state, Pacman’s mouth should be open.
Exercise 5 Design the function for your to-draw handler. Be sure to use graphical constants as needed.
Exercise 6 Design a function for your on-key handler. The direction the player entered on the keyboard should become the direction Pacman is going. All other keystrokes should be ignored.
Exercise 7 Compose all of these functions into your main function, which should just take a GameConfiguration. For now, it’s not a very exciting game, as Pacman doesn’t move at all. This will change soon!