Banner
MICHAEL CHUNGKUN CHEN
CS 33
DISCUSSION 1A
PROJECT 6
JUNE, 7 1999

DOCUMENTATION FOR PACMAN

	This game is PACMan, not the original, but somewhat like it.  You race 
through mazes trying to eat all the dots to advance into the next level.  PACMan 
does have some ghosts to worry about.  Four mean ghosts are after PACMan and he 
has to run away from them long enough to eat the power dots to eat the ghosts.  
If you can eat the power dots and then eat many ghosts, you can get many points.  
The number might even surpirse you because the ghosts go into hiding in the 
ghost box and you can't get them when they get home safe...  So it is hard to 
catch ghosts.

	But watch the P indicator at the top bar of the screen for that tells you 
when you can eat the ghosts.  Many items are located at the top bar, the lives 
left, the score, and other stuff like that.  The ghosts are very intelligent and 
will chase after pacman.  If a large structure encloses the ghosts, they might 
have trouble getting out to catch pacman... this can be used to your advantage.  
Another tip is when pacman runs head on fast enough through one ghost, they 
won't have enough time to eat him so he might survive... but don't try this 
often for it only works if you have the skills.  If you need a quick escape, you 
can use the openings in the walls which will transport you to the otherside 
automatically... most the times the ghosts will not pursue and will try to reach 
you across the screen.  And when you eat all the ghosts they turn into eyes and 
float back home to regenerate.  The ghosts are forced to not be ontop of each 
other so the player does not get confused.

	After every level until a certain point, pacman and the ghosts get faster 
and faster.  It is very challenging to keep pacman alive on the later levels.  
If you happen to catch a eye of an ghost and stay with it, watch how much your 
score can rise.  They are special.. even harder to catch then ghosts because 
they are hard to see.

	After you get killed by the ghosts three times, the game is over and you 
will see an explosion of asterisks on the screen.

Internally, the screen is held in memory.. $A00 is the master screen that is 
never changed, $B00 is the current level which is updated as the actual screen 
is updated.  And the only place holding the characters is the crt.  Locations of 
the ghosts and pacman is held as x y positions in memory, and the directions of 
their moves and next moves are held in two words.  each word is split into six 
four bit bytes... and each bit represents the separate directions.  And that way 
we have one move variable for all the characters.  It was a little bit tricky, 
and harder to implement, but the technique was interesting enough to design.  It 
was worth the thought.  And in order to print messages and numbers to the screen 
I wrote my own functions that displayed it using direct mapped mode.  The cusp 
cursor was annoying so I placed it at 0,0 which is off the screen so I avoided 
unmapped writing.  I decided it was much faster and simpler to write my own 
queue and directly access it.  So I have a print function that placed letters 
into the queue and activated the printer if need be.  And the printer interrupt 
took characters out of the queue and printed them.  The timer interrupt 
increased a count and based on which modulus it is, move flags would be enabled 
and set.  The keyboard interrupt recieved keys and escape sequences, then it 
processes them and either sets the pause flag, the gkey flag, or the direction 
of pacman's next move.  For this reason the when storing the ghost's next move, 
the interrupts are disabled so we loose as few directional changes as possible.

Home | About Me | Text Depository | Future Enhancements | Guest Book | Links

Copyright © 1998-2008 Michael Chungkun Chen
All Rights Reserved.