Description: There is a ghost in the forest haunting the local townspeople! Equipped with nothing but your flashlight (that knows to turn on when it gets dark), you must head out and capture the ghost so the children may once again sleep peacefully at night. The forest has been blocked off by a big fence so grab the key outside of the town hall to start your journey. Stocking up on batteries before nightfall might be a good idea. Remember, unlike humans, the ghost can travel through trees. He also only shows himself at night, but that doesn't mean he sleeps during the day! He's always on the move to avoid detection. Good luck!
Ghost disappears during the day.
Ghost appears at night.
Controls:
W: move forward
A: strafe left
S: move back
D: strafe right
Mouse: click and hold to look
Pick-Up Items: Items are picked up by walking into them
Key: opens the gate to the forest
Battery: increases flashlight intensity/angle/distance (5 on map)
The key outside of town hall.
A battery.
How To Play:
Player starts in the neighborhood right before sunrise
Use controls to walk to the town hall and pick up the key to open the gate
Optional: Pick up batteries to increase flashlight power
Move to the forest to find the ghost
Walk into the ghost during night to capture him
Game exits and prints win message to console
Features Implemented:
Collision detection: Player cannot walk through big objects or leave map. Detects when items are picked up and when the ghost is found. Ghost cannot walk through fence or leave map.
Light Attenuation: The flashlight brightness is determined by the amount of batteries picked up. It changes it's intensity, angle of light, and distance. The more batteries a player has, the brighter the light is and the farther the light will reach.
Multiple Light Sources: The flashlight turns on at sunrise/sunset, briefly adding to the sun's strength.
Hierarchical Modeling: All objects are hierarchically modeled. Most notably in the repetition and rotation in the neighborhood houses.
Animation: Ghost moves. Key and batteries rotate in place to indicate they are pick-up items.
AI: Ghost moves in one direction until it hits the edge of the map, a tree, or the fence. New direction is dictated by the c++ random number function seeded with the time. There is a 50% chance that the ghost goes through a tree to make him even trickier to catch.
Starting flashlight pwoer.
Flashlight with all battery pick-ups.
Entra Info:
Forest is random: Forest is randomly generated each game and will be different with every run.
Collision detection code: Due to project time constraints and fear of breaking code, the ghost and human collision detection run different functions. The human collision detection was added first and is based on the size of the human. The ghost is much bigger so new code was written to implement it's collisions with the forest to be sure that the game logic would not break before project handin. Code may get cleaned up for personal use.
Resources:
Simple geometry creator and matrix stack from Zoe Wood