This is a simple game built using p5.js library. The game involves controlling a player object and avoiding obstacles to score points. The objective of the game is to achieve the highest score possible before colliding with an obstacle.
To play the game, you have two options:
-
Using the p5.js Editor: You can play the game directly in the p5.js Editor by following these steps:
- Open the p5.js Editor in your browser (
https://editor.p5js.org/
). - Create a new project and copy the code from this repository into the editor.
- Click the "Run" button in the editor to start the game.
- Press the spacebar to make the player object jump and avoid obstacles.
- The score and timer will be displayed on the screen, and the game will end if the player collides with an obstacle.
- To restart the game, click the "Restart" button.
- Open the p5.js Editor in your browser (
-
Running Locally: If you prefer to run the game locally on your machine, you can follow these steps:
- Download and install the p5.js library from the official website (
https://p5js.org/download/
). - Create a new HTML file and include the p5.js library by adding the following script tag in the HTML file:
<script src="p5.js"></script>
- Create a new JavaScript file and copy the code from this repository into the file.
- Link the JavaScript file to the HTML file by adding the following script tag:
<script src="your-script-file.js"></script>
- Open the HTML file in a web browser to start the game.
- Press the spacebar to make the player object jump and avoid obstacles.
- The score and timer will be displayed on the screen, and the game will end if the player collides with an obstacle.
- To restart the game, refresh the page.
- Download and install the p5.js library from the official website (
- Spacebar: Press the spacebar to make the player object jump and avoid obstacles.
- The player controls a rectangular object and must avoid colliding with obstacles.
- Each time the player successfully avoids an obstacle, the score increases.
- The game ends if the player collides with an obstacle.
- The player can restart the game by clicking the "Restart" button.
This game was created using the p5.js library (https://p5js.org/
), a JavaScript library for creative coding.
The game code was written by [Author's Name] and is available on GitHub at [GitHub Repository URL].
This project is licensed under the [License Name] license - see the LICENSE file for details.