Pac-Man Diary #05

Pills, pills…I need some pills! Well, at least for my game anyway. As I discovered earlier, the best method is to have the pills in the with the maze bitmap. I edit it in paint ( I will order PSP, I’m just too busy at the moment). Ok, load it in. Looks ok. Now to use that dirty word ‘collision’ again. I have to check when he’s eaten a pill. I have a couple of ideas on how to implement this, but I decide on setting up another array to mimic the layout of all the pills. I then use the same array coords I use for collision checking (with some offsets) to check if there’s a pill at that point. After some jiggling around with offsets this seems to work just fine. I realize I need a blank out for the pills so this gets added to the sprite bitmap too.

I need to check it properly so I add in a score above the maze. Hmmm….how much for a pill? 10 points is a nice round number. I must check out the original Namco Pac-Man in M.A.M.E to see what you get. Oh yeah, baby. Now I can move around the maze eating pills and getting loads of points. Cool! My red ghost is still wondering around aimlessly and keeps getting himself locked in the central holding area. Oh well, serves him right for being so dumb.

Anyway, I’m on a roll today. Time to stick in some animation. This proves to be rather easy in DarkBasic. Just load in the frames and update the sprite frame displayed as you move. Takes about 10 minutes to code it. 

Right, might as well add the other 3 ghosts. Before I do that, I make the ghost movement subroutine generic so that I can use it for all the ghosts – why write the same thing 4 times? This takes a while but is worth it in the long run. Now adding the other ghosts is a breeze. Each one takes only 5 minutes to code in. Now I have 4 animated ghosts wondering around, Pacman is animated and eating pills, and the score is toting up as you play. Am I good or what? And it’s only 10pm! 

Right, now I’m in the unfortunate position of choosing between adding Pacman/ghost collision detection and animation or playing WWII Online with my virtual friends. WWII Online wins…