PacRun

PacRun

class

December 2016

An augmented reality game that allows you to play Pac-Man in real life with Google Maps API. Inspired by a Google Map April Fool's Day Easter Egg and a location based game Ingress.

Task

  • Write a phone app using Swift

What I did

  • I wanted to play PacMan in real life
  • Looked into Google Maps API
  • Coded everything in Swift and upload it onto my phone
  • Alpha-tested to make sure it works
  • Made a demo video of my project

Challenges

  • I wanted to make the food (yellow dots) to be auto generated on the map. Right now it has to be manually added to the map, because Google Maps API does not it.
  • Same problem: I would like to have the users only running on the roads so that it feels more PacMan.

What I learned

  • Google Maps API
  • Swift
  • A lot of fun in making and testing the game
  • The "invisible enemies" (because you cannot see them in the real world) can really encourage people to imagine their existence and can get thrilling!

Demo Video

How to Play

First, set up the game map. I had been trying to figure out a way to automatically generate dots and ghosts on the streets, but it was not part of the google maps API.

  • Pick a spot outdoor.
  • Start the APP. Allow access to locations.
  • Press the "S" button at the bottom.
  • Tap to add the food (yellow dots) to the map.
  • When finished, press "S".
  • Tap to add the ghosts to the map.
  • When finished, press "S".
  • Confirm the map by pressing "S" again, or "back" to edit.

Second, play.

  • Ghosts' location will update every three seconds. It will move North/East/South/West by a fixed distance, and the direction is randomized but have a higher chance at moving towards the player.
  • If you run close enough to a ghost (say, within 15 meters), it will eat you, and game over.
  • If you run close enough to a yellow dot, you can eat the dot.
  • Like the traditional Pac-Man, you win the game by eating all the yellow dots.

The ghosts are following me all the way to my apartment.

Playing Experience?

I personally find this game extremely interesting and really encouraging me to run. You don't see the ghosts in the real life, however you know they are around you, moving towards you little by little. You would like to take a quick break, but when you look down at your phone, you would see the approaching ghosts, and you feel terrified that they might arrive at any moment.

However I wish I could have enough time to implement the "fruits", so that I can run after the ghosts and annihilate them.

Check out more

Bouncing Swiftly

A simple phone game made in Swift.