150 likes | 354 Views
@-Man. R. David Sigsby CISP 233 Davenport University Fall 2012. The Concept. Pac-Man clone Windows console Close to original Why? Good gaming intro... ... and it's geeky. The Program. static void Main ( string [] args) { game = new Game();
E N D
@-Man R. David Sigsby CISP 233 Davenport University Fall 2012
The Concept • Pac-Man clone • Windows console • Close to original • Why? Good gaming intro...... and it's geeky.
The Program staticvoidMain(string[] args){ game = new Game(); game.Map = Properties.Resources.MapDefault; game.Display = new Output.Default.Display(); // do any other config here game.Player.Speed = 5; game.Start();}
The Board 2 Dimensional Array of Characters
The Main Loop System.Threading.Thread.Sleep(ReadyWait); startTimers(); while(status != STOP && food > 0) { System.Threading.Thread.Sleep(SleepPerFrame); setMode(); // ghosts mode handleInput() // also handles pause handleMovement(); renderFrame(); checkCollisions(); } stopTimers(); if(food > 0) display.YouLose(); else display.YouWin();
Introducing: The Ghosts Ghosts move based on a common method, but each ghost has a unique 'personality' that controls it's movements.
The (Not So) Smart Ghosts • Ghosts can not reverse direction (mostly) • Ghosts move based on a target 'cell' • Different target cell for each of 3 modes: • scatter: a fixed cell for each ghost • chase: based on @-Man's location • frightened: select random direction to turn • Ghosts turn based on which directionwill put them closer to their target cell
References Project Source Code (git) https://bitbucket.org/sigsby/atman The Pac-Man Dossier http://home.comcast.net/~jpittman2/pacman/pacmandossier.html Understanding Pac-Man Ghost Behavior http://gameinternals.com/post/2072558330/understanding-pac-man-ghost-behavior