Astron is a classic arcade-style space shooter built with vanilla JavaScript and HTML5 Canvas.
Control a spaceship in a void filled with dangers. Thrust through space, rotate to aim, and survive as long as you can.
- Physics-based Movement: Momentum-based thrust and friction mechanics.
- Screen Wrapping: Fly off one side of the screen and appear on the other.
- Retro Graphics: Simple vector-style rendering using the HTML5 Canvas API.
- Clone or download the repository.
- Open
Scripts/index.htmlin any modern web browser. - Controls:
- W: Thrust forward
- A / D: Rotate Left / Right
- Space: Fire
- HTML5 Canvas: For high-performance 2D rendering.
- JavaScript (ES6+): Game logic and state management.
Scripts/game.js: Contains the main game loop, player class, and physics logic.Scripts/index.html: The entry point for the game.
The engine and logic of the game.
- Canvas Setup: Initializes the full-screen 2D context.
class Player: Encapsulates ship state (position, velocity, rotation), rendering (drawing the vector ship), and physics (thrust, friction, screen wrapping).- Game Loop: Manages the animation frame request cycle to update and draw the game state continuously.
- Input Handling: Listens for 'keydown' and 'keyup' events to manage smooth control states.
![]() |
![]() |
![]() |
This project is licensed under the MIT License - see the LICENSE file for details. Copyright (c) 2026 ARGUS



