Pac Man Architecture Page Iteration 4
History of Revisions
05/1/03 Damien Edwards Initial Document Creation
05/5/03 Damien Edwards Addition of Class descriptions
Overall Functionality
During the fourth iteration of the pac man game we have refractor previous code
eliminating unnecessary classes and methods. Also in this iteration we have
worked on an initialization menu that allows the user to start game or quit.
The initialization screen also contains a pacman animation in order to catch
the eye of the game user and make the user more propelled to play the game.
Also while the user is in play we have given the user the option to pause game
and exit. In addition to exiting the game on pause the user has the option to
continue to a previous game. The commands by the user are passed in the function
commandAction(Command c, Displayable d) in the MenuScreen.java class and the
game functionality is based on the user’s command. Also the animation
for the initialization menu screen is found in the SplashScreen.java class.
MenuScreen.java
Description: This class will implement the menu screen that will appear
when the game is initialized in the emulator. The user will be able to quit
or continue game. The user will be able to access a new level once all the pellets
are eaten on previous level.
Attributes: The object midlet initializes the menu screen.
Methods: MenuScreen(pacman midlet) will display intro to user and display
options for game.
commandAction(Command c, Displayable d) will take what command the user gives
and perform the given command.
SplashScreen.java
Description: This class draws the pac man intro on menu screen. (Where
pac man chases the ghosts on opening menu screen of game)
Attributes: The object splashtrigger triggers the animation to begin
on menu screen.
Methods: SplashScreen(pacman midlet) prompts the user to select next
in order to play the game.
paint(Graphics g) method draws the intro on the menuscreen.
animateScene(Graphics g) method is used to animate pac man by making his mouth
move.
advanceFrame() is used to advance pac man across the screen by redrawing pac
man at different frames on the screen.
commandAction(Command c, Displayable d) is used to exit user from game if the
user selects that option.
SplashTrigger.java
Description: This class is responsible for calling advacedFrame() on
a SplashScreen Object.
Attributes: The object splashscreen is used to advance frames on the
menu screen.
Methods: SplashTrigger(SplashScreen g, int frameDelay) is used to set
delays between frames and to trigger frame updates.
stopTrigger() is used to stop the trigger from functioning
run() is used to start the trigger.
WinScreen.java
Description: This class allows user to move on to next level after
level 1 is complete.
Attributes: The object midlet initializes the menu screen.
Methods: . WinScreen(pacman midlet, int score) is used to bring up
the menu screen after a certain score is reached by user.
paint(Graphics g) is used to print to the menu screen that user has won.
commandAction(Command c, Displayable d) is used to accept a command from user
to exit game.
We have refractor our code in iteration 3 to only contain the following
functions FrameTrigger.java