Let’s use what we learned about functions and variables to build a game scene, run the game logic, and handle user input. The sun is up and out, but so is our pesky mole! We have set up the bottom three burrows for the mole to pop out of, and it is up to the user to catch the mole by hitting the burrow’s key as many times as possible before the sun sets and time runs out. If the correct burrow is hit, then reward the user with points and the mole will move on to another burrow. If the wrong burrow is hit, then penalize the user by deducting points.
This project uses the Phaser.js library to set up our scene and create the mole character with corresponding animations. We will be building out the core game logic with a timer that gives the user a set amount of time to play, a scoreboard that rewards and penalizes the user with points, and finally a feature that pauses the game.
Extra:
- Add in another burrow at the top for the mole to relocate to and the user to hit.