A modern implementation of the classic Space Invaders game using HTML5 Canvas and JavaScript.
- Classic Space Invaders gameplay
- Responsive design for both desktop and mobile devices
- Touch controls for mobile play
- High score system using local storage
- Multiple levels with increasing difficulty
- Node.js (v14 or later recommended)
- npm (comes with Node.js)
- Clone the repository or download the source code
- Navigate to the project directory in your terminal
- Run
npm installto install the dependencies
To run the game in development mode with hot-reloading:
npm run dev
To create a production-ready build:
npm run build
The built files will be in the dist directory.
To preview the production build:
npm run preview
- Use LEFT and RIGHT arrow keys (or touch controls on mobile) to move your ship
- Press SPACEBAR (or tap the screen on mobile) to shoot
- Destroy all invaders to advance to the next level
- The game ends if an invader reaches your ship's level
- Arrow Left/Right: Move ship
- Spacebar: Shoot
- P: Pause/Unpause
- ESC: Quit game (during gameplay or pause)
- Enter: Start game, confirm name, or restart after game over
This project is open source and available under the MIT License.