"# Sonic-runner"
This project is a Sonic-themed infinite runner game built using JavaScript and the Kaplay game development library. The game features classic Sonic mechanics, including jumping over enemies and collecting coins to achieve the highest score.
- Basic knowledge of JavaScript
- Node.js installed on your machine
- A code editor (e.g., Visual Studio Code)
- Clone the repository:
git clone <repository-url> cd sonic-runner-game
- Install dependencies
npm install
- Run the development server
npm run dev
4.Open the game in your browser
http://localhost:5173/Sonic-runner/
kaplayContext.js
: Sets up the Kaplay context.public/
: Contains the game assets (images, sounds, etc.).
- Infinite Runner Mechanics: The game speeds up as you progress.
- Sonic Mechanics: Jump on enemies to defeat them and collect coins.
- Parallax Scrolling: Background moves to create a sense of depth.
- Multiple Input Support: Play using keyboard, mouse, or touch inputs.
- Jump: Press the spacebar or click the mouse to make Sonic jump.
- Collect Coins: Gather as many coins as possible to increase your score.
- Avoid Enemies: Jump over or bump into enemies to defeat them.
- Debug Mode: Press
D
to toggle debug mode and see hitboxes and FPS. - Touch to Mouse: Ensures touch inputs are translated to mouse clicks for mobile compatibility.
- Kaplay Library Documentation
- YouTube Tutorial
- Substack Post on Parallax Scrolling
This project is licensed under the MIT License. See the LICENSE file for details.
Happy coding!