Pacman
For the 5th game in "The 20 Games Challenge," I chose Pac-Man. I created the maze and developed the movement for Pac-Man within it, then abandoned the project for about eleven months or so. Every now and then, I find the time and motivation to work on game development again, and here’s the result.
As with previous games, in the final stretch, the need to finish development and move on to something else left the code a bit messy. But, well, it works and looks decent.
Made in Godot, like all the others, there are some areas that could be improved or fixed, but no. It’s good enough.
I used the original sound effects, so I’m probably infringing some license—could that be?
Controls:
"A", "S", "D", "W" - Arrow keys - Gamepad/Joystick
Goal:
- Create the Pac-Man maze. Place a score and high score counter above the level, and a life counter below. The maze operates on a grid. There is a tunnel that allows Pac-Man and the ghosts to wrap across the screen, appearing on the other side.
- Fill the maze with dots and four large dots (Power Pellets). Each cell in the grid will contain a dot or power pellet.
- Create Pac-Man himself. He should be able to move in four directions through the maze. When Pac-Man collides with a dot, he will eat it, increasing the score.
- Add four ghosts. They will chase Pac-Man through the level.
The ghosts start in a “pen” and are released after enough dots are eaten.Each ghost will cycle between “chase mode” and “scatter mode.” During chase mode, the ghosts will move toward specific cells to give the illusion of teamwork and intelligence. - Red ghost “Blinky” will target Pac-Man directly.
- Pink ghost “Pinky” will try to get 4 tiles in front of Pac-Man.
- Blue ghost “Inky” will target a special position. Draw a line from Blinky’s position to the cell two tiles in front of Pac-Man, then double the length of the line. That is Inky’s target position.
- Orange ghost “Clyde” will target Pac-Man directly, but will scatter whenever he gets within an 8 tile radius of Pac-Man.
- Each ghost has an assigned corner that it will scatter to during scatter mode.
- Add the “power pellet” mode. When Pac-man eats the pellet, the ghosts will turn blue (scared), and will scatter. Pac-Man can eat the ghosts. After a timer elapses, the ghosts will flash white, then return to normal. Eaten ghosts will award points, turn into eyes, and then return to the pen before coming back as regular ghosts.
- Add the win states and lose states. Pac-Man will die when eaten by a ghost, consuming a life. When all dots are consumed, the level will reset.
Stretch Goal:
Feel free to customize the maze, add more/different AI behaviors, or add more levels.- Add fruit pickups. Fruit appears after enough dots are eaten, and awards bonus points.
Pac-Man wiki, Pac-man fan wiki
fonts by Nimble Beasts Collective
Leave a comment
Log in with itch.io to leave a comment.