Advertisement Jump to content
  • Advertisement
  • entries
  • comments
  • views

Multiplayer Pac-man Challenge - Part 3 - Gfx + Pathfinding Setup




I'm a bit late on Part 3 which is a follow up to Part 2 which showcased the Robot player. I will post links to all the parts at the bottom of this entry.

Sadly I've been very restricted for time, but I've managed to create the three remaining in game graphics required for this challenge. There will be some alterations for Lives, ect... and indication that the monsters (enemies) have been frozen, but it's not a major creation by any means. Also I'll change the plastic color on the Robot as seen on top to other colors to indicate different players.

Above you will see the Orb which you must collect (very little effects here, but in the 2D version I used a soft brush to simulate better light emission), this is a direct replacement of Pac-Dots. Next you will see the graphic used to create the Maze itself (Line), and finally the Ice Block which will be in all four corners of the maze, and will temporally freeze the monsters skin, that causes them to shatter upon contact.

I've converted the Monster, Robot, and all the above into 2D Sprites with some modifications because post processing and environmental effects are not going to be available within the 2D platform. For those that are wondering, the game is being made using SFML with C++, I don't have the time to create this in a full 3D environment, but I'll keep that in mind for future challenges as I'm starting a bit late again. :D

The second part of this entry is about pathfinding. There are many ways you can find the "shortest path" either by using a "greedy" method, or "full search" method, and all have pros and cons. Pathfinding for this game only needs to be 4 directional as diagonal movement isn't possible, and it's also much more simpler considering each tile or passable 'node' holds the same movement value. In order to successfully complete this Pac-Man challenge requires that the Ghosts or in this case 'Monsters' can chase the player, otherwise there is no challenge. I coded a simple algorithm based on Breadth First Search that doesn't search walls, and exits once the path is made. You'll see a GIF below showing it in action as per my test grid. The first GIF shows a red square which represents the Start Point, and a green square that represents the Target Point. The cyan squares show which blocks have been checked, and the yellow squares are the path based on this algorithm. In the second GIF I add in maze walls, and show how the red square moves along the path to get to the green square, and also updates the path if the green square changes position.



So what is next? With the main graphics done, and the pathfinding system working, the only thing left to do is clean up the 2D Graphics, create all the menus, GUI, mazes, point system, and AI player, then add in sound effects and music. I'll have to double check the requirement list, but I don't think I'm missing anything. I'll add in Local M-Play as an addition to an AI team-mate, but if I'm running short on time I'll meet the requirement with just local.

Stay tuned for Part 4 where I will show a sample of the game in action!

If you've missed any of the earlier parts, check below for the links:



Recommended Comments

There are no comments to display.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!