Inspiration

3 of us are in an AI class and wanted to implement a game-playing AI and this hack seemed like a great place to try it out. This goal drastically shifted throughout the hack.

What it does

Our hack allows the player to play as a ghost within Pacman, fighting off multiple "PacMen" as they eat the dots on the board. With each dot consumed by the PacMen, the player's score decreases; the goal is to defeat all of the PacMen before they eat the whole board. The player wins if they beat the level with the maximum number of PacMen allowed within the code.

How we built it

We took an open-source Pacman version of the code (from http://zetcode.com/tutorials/javagamestutorial/pacman/), made it object-oriented (by creating Ghost and PacMen classes), and reversed the logic for the Pacman and ghost movement. Images were created based on popular PacMan logos. In addition, we began to implement a board randomization element by splitting the board into three zones: each zone has a number of maze elements that can be chosen for a large number of possible combinations.

Challenges we ran into

The source code was not Object-oriented, not commented, and used bit-wise operators that we were not familiar with. We had to alter most of the code, before we were able to change the game logic.

Accomplishments that we're proud of

WE FINISHED!

What we learned

This was our first Hackathon and the learning curve was pretty steep. We learned we need to learn how to use GitHub. The 2D graphics took much longer to figure out then we thought and subsequently we needed to adjust our game plan throughout the hack.

What's next for InversePacMan

We haven't fully implemented the board randomization (right now it just replicates the hardcoded maze found in the base code). We wish to also add powerups (increased speed, allied ghosts, extra points), and make the PacMen smarter. Currently their movement is random, we could develop a heuristic function to make their moves target remaining dots. Other ideas: customizable ghost color, customizable maximum number of Pacmen (from the command line). We would also eventually like to loop back to our original idea and develop an A.I. player.

Built With

Share this project:

Updates