A 2D pixel-art samurai fighting game built with React and Vite.
Follow these steps to get the game running locally on your machine.
Ensure you have the following installed:
- Node.js (Recommended: Node 20+, though the game works on Node 25)
npm(comes with Node.js)
Clone the repository and install the required npm packages:
# Navigate to the project directory
cd gdg-spectrum-game
# Install dependencies using npm
npm installRun the Vite development server:
npm run devThis will start the local server. You should see output similar to this:
VITE v8.0.0 ready in X ms
➜ Local: http://localhost:5173/
Open your web browser and navigate to the Local URL provided in the terminal (usually http://localhost:5173/).
- Warning: Audio auto-plays dynamically on the intro screen.
- Maximize the window for the best responsive pixel-art scaling!
- Click to attack when the attack prompt appears.
- If you wait around 3 seconds while idle, the enemy will auto-attack.
- During enemy attacks, the hero plays a short hit reaction and then returns to a steady idle pose.
If you want to build the static site for production deployment:
npm run buildThis will compile the game into the dist/ directory.
You can preview the built production site locally by running:
npm run preview- Framework: React 18
- Build Tool: Vite 8
- Styling: Tailwind CSS & Vanilla CSS
- Animations/Sprites: Custom React Hooks for 2D Sprite Animation Frame pacing