Logo

dev-resources.site

for different kinds of informations.

Go Create Pac-Man in One Day!

Published at
11/13/2024
Categories
challenge
programming
gamedev
learning
Author
chigbeef_77
Author
11 person written this
chigbeef_77
open
Go Create Pac-Man in One Day!

Got a day free this week? Why not see if you can make Pac-Man entirely within 24 hours? It sounds like a simple challenge, because it is, but it's the perfect challenge for testing your skills, new tools, new languages, working with sounds and images, or using Git.

Getting Started

The first thing you should do is decide what language and tools you're going to use. For me, I used C as my language, and raylib as my graphics library. A simple choice for a simple game, however, you may decide to use a full game engine, other languages, and so on. A good choice is a language that you are wanting to learn, and for me, I wanted to get better at using C.

Helpful Information

To create Pac-Man, there are some rules that you should follow.
I'm going to explain what I consider the fundamental algorithms of the game, but you can add more you find from here.

First you have the grid of the game, which can be the original, or any modified version you want. When you reach the end of the grid, however, the player should be able to warp to the other side. Then you have pellets, the player, and 4 ghosts.

The pellets should disappear when the play moves over them, you can choose to keep track of score.

The player just has to moves around the grid, and other than that, doesn't do much.

Each ghost is more interesting.

The Ghosts

Each ghost has a specific target for each movement. The different ghosts determines what this target is. Otherwise, there are still some rules that apply to every ghost. The can't move back on the themselves, and they take the greedy path to their target. So as long as they get closer to the target in the next movement, it doesn't matter if that path is twice as long.

The first ghost is Blinky, and Blinky's target is the player's current position.

Pinky's target is 4 tiles in front of the player, so if the player is moving left, it will be 4 tiles left of the player.

Clyde's target changes depending on how far away from the player Clyde is. If Clyde is more than 8 tiles away from the player, its target is the player's current position. Otherwise it's a scatter position, outside the bounds of the grid. Really the position doesn't matter, but if you want the exact position, it's on the website linked.

Inky's target is based on both Blinky's position and the player's position. Take a line from Blinky's position to the player's position, then double the length of that line so you have a straight line from the new position and Blinky, with the player in the middle. That position is the new position.

Ending

There's not much more to it, but the more you add the better. Mine is a very simple version, without images, sound, or a score. Put down your code in the comments! And have fun designing, implementing, and playing this game!

challenge Article's
30 articles in total
Favicon
🎯 9 Must-Have Skills for AI/ML Engineers
Favicon
Thoughs on Codingame 2024 Winter challenge
Favicon
I am currently reducing at least 22 proofs by at least 99312 steps total.
Favicon
Can anyone suggest me the best resources to crack TCS Hackquest 2025?
Favicon
Frontend Challenge: December Edition
Favicon
Auto Horizon Developer Challenge: Innovate with AI-Powered dApps πŸš€
Favicon
Auto Horizon Developer Challenge: Innovate with AI-Powered dApps πŸš€ Build super dApps & AI agent PoCs with Autonomys Auto SDK! 🌟 Compete for prizes, gain recognition, and showcase your innovation. πŸ“… Timeline: [Insert Dates] πŸ‘‰ Register now: https://foru
Favicon
Is URLdn Better Than Bitly for a ShortΒ Link?
Favicon
Is URLdn Better Than Bitly for a ShortΒ Link?
Favicon
What are the common challenges in managing fixed assets and how can they be addressed
Favicon
DR20+ Challenge
Favicon
How we used gpt-4o for image detection with 350 very similar, single image classes.
Favicon
Solving Word Cookies Puzzles: A Python Adventure
Favicon
I made an URL shortener
Favicon
JavaScriptmas 2024 - Week 4
Favicon
There will be much less room for improvement soon.
Favicon
In Quest of Clarity : The Methodical Madness Behind Research
Favicon
Securing the Future: Cloud Adoption Challenges for Government Agencies
Favicon
How to NOT Create Leetcode Challenges
Favicon
Codepen October Challenge: Halloween Edition with WebDataRocks
Favicon
Join Virtual Coffee in New Year, New Goal: Setting One Big Goal and Achieving It!
Favicon
First flutter app for marathon training
Favicon
Tackling fundamental logic: A very hard automated deduction challenge (free for all)
Favicon
Go Create Pac-Man in One Day!
Favicon
I’m hosting a game jam!
Favicon
Calculator Backend-API In Go
Favicon
The Real Life Problem. Beyond Programming.
Favicon
#TerraWeekChallenge Day 2:
Favicon
Devops Open source project Task
Favicon
Linux Administration Tasks with Use Cases

Featured ones: