A simple 2D vertical runner game built with JavaScript and the p5.js library. Test your reflexes by collecting falling treasures while dodging dangerous swords!
The goal is to collect as much treasure as possible to increase your score without getting hit.
- Controls: Move your mouse cursor left and right to control the runner's position.
- Objective: Catch the valuable items falling from the top of the screen.
- Game Over: The game ends immediately if you touch a Sword.
Different items grant different amounts of points:
| Item | Points |
|---|---|
| 💵 Cash | +50 |
| 💍 Jewelry | +100 |
| 💎 Diamonds | +150 |
- p5.js - A JavaScript library for creative coding.
- p5.play - A library for sprite animation and game interactions.
- HTML/CSS
To play the game locally on your machine:
- Clone the repository:
git clone https://github.com/Rebanta-Gupta/Treasure-Game.git
- Open the game:
- Navigate to the project folder.
- Open the
index.htmlfile in your preferred web browser. - Note: For the best experience (and to avoid local file security restrictions), it is recommended to use a local development server (like VS Code's "Live Server" extension).
sketch.js: Contains the main game logic, loop, and sprite management.index.html: The entry point for the game.assets/: (Images likeRoad.png,Runner-1.png,cash.png, etc.)
Enjoy the run and get that high score!