Project idea: Pac Man remake

Topic.

I can do the graphics, just create a Sphere and do the mouth, and then try and create a maze with dots to eat, I just need someone to help me with the code bits and possibly the sounds.

Can anyone help?

Pac Man’s been on every format ever from the Atari 2600 to the ZX Spectrum, current gen consoles, mobiles, everything.

What specific code questions do you have?

How do I do the codes for Pac Man eating the dots and adding score? Also the Ghosts turning blue and getting eaten when Pac Man eats a Power pill, or Pac Man dying when he hits a normal coloured Ghost.

On the Pac Man eating the dots, you could have colliders on each dot and Pac Man. When OnCollisionEnter gets called on the dot, you check if it is Pac Man which collided with it (by tag, checking for attached component, etc). If Pac Man you call a method on the dot for dealing with eating it. This method might play an animation or sound, will add to the score, and destroy the dot object. As far as the score you’d have a central score manager. It could be static or a script attached to a GameObject, doesn’t really matter how you want to implement it really. But when you eat the dot you call a method on the score manager to add to the score. The score manager takes care of any animation which may occur when the score increases and updating any representation of the score in the UI. (Note that depending on how you design your game you may want to use trigger colliders in some cases instead of regular ones, and it has been a while since I played Pac Man, so I don’t remember what if any animations were used)

On the Ghosts turning blue when eating a power pill, it works very similar to eating the dot. Same OnCollisionEnter stuff, etc. What is different is you either call an event or call a method on each ghost which tells them to turn blue. If I remember correctly their behavior changes to running away instead of chasing as well. This also starts a timer for the pill effect to wear off.

Pac Man dying do that with colliders as well. On Pac Man you check in OnCollisionEnter if hit by a ghost, and if it was a ghost you check the status of whether the ghost is in blue pill mode or not. If not you call a method on Pac Man to kill Pac Man, if in blue pill mode you call a method on the ghost to destroy the ghost and replace the ghost with floating eyes if I remember correctly and add to score.

I’m talking really generally because the details of how you do one aspect of your game depend a lot on the details of how you implement other aspects of your game, and you haven’t given any details about anything. So I’d suggest just giving your project a try, searching on how things like collisions and such work and come back with more specific questions when you get stuck. You can only get specific answers to specific questions.

1 Like

I want to add to Joe’s great answer by just saying one simple piece of advice/encouragement, that I will shamelessly co-opt from Nike:

Just do it.

Don’t think about it anymore. Don’t wonder what the right place to start is, or how you should approach this issue or that, or what art style would require this tool or that. Just… start. Get a blank canvas with a little yellow circle moving on its own. Then have it change directions when you press a key. Then have it stop when it hits a wall. Then have it loop to the other side of the screen when it goes off the edge of the play area. Then add the pellets and stuff. Then ghosts. Then powerups. Then a score system, and lives. Just start with a small bite, and gradually add things and you’ll see the game take shape before your eyes.

You’re going to hit roadblocks. A lot of them. And when you run into specific issues, you’ll know what to Google to find what you need to overcome that obstacle. It’s not really practical for us to all develop a game for you by committee. You’ve got a wealth of resources available to you, and a powerful (but admittedly, somewhat intimidating) tool at your disposal with which to make games.

So get to work!

1 Like

I got working, I’m trying to draw a Pac Man sprite in GIMP, and add it as an Asset (which I’ll do at some point)

1 Like