In the game I created, you play as the security guard for the High Brow Museum. Unfortunately, you only have one screen to see all four floors of the museum.
The game play:
Each floor has a number of objects. There are visitors that walk around the museum. One visitor on each floor is a thief that will steal an object then stand there with a slightly different icon. The player must hit the alarm button before the delay timer.
What did I learn:
The hardest part to code was having the visitors walk around in a somewhat sensible manner. I eventually decided to use an A* pathfinding library. Each visitor picks an object to visit. It calculates the best path avoiding walls, objects, and other visitors current position. Each tile on the route is stored in an array and it tries to get to each tile in turn. If it runs into something, it jumps to the center of the closest tile and then waits for a random amount of time. At that point it recalculates and starts again.
I had to reprogram the library to not let it cut corners if there was a wall there. I also had to program the visitors with a fudge factor to decide how close was close enough to the way-point. Nothing too difficult, but it did suck 6 hours of programming time since I went in knowing nothing.
What went right:
– different kinds of visitors
– thief wouldn’t steal the first object
– Thief would have to run away instead of a delay time
– prettier interface
– intro video
Play it here: http://garionthecat.com/guard_screen/