Custom version of the classic 1979 Asteroids game
The project is heavly focused on object oriented programming and maintaining its state in a game loop triggered on requestAnimationFrame
method. Each element is fully rendered in SVG and manipulated by transformations, most elements are drawn as path
svg elements, grouped by the g
tags. Detailed list of the features is listed below in the change log
https://bartek-swiderski92.github.io/asteroids-game/
↑
Main thruster
→
Right thruster
←
Left Thruster
Space
Shot
Esc
Pause
G
Grid (graphic effect)
R
Respawn shield (graphic effect)
- Replaced active elements arrays with JS maps for better performance and stuck node fix
- Changed stacking context of UI and in game elements
- NaN in the fps counter fix
- Asteroid respawn logic
- Safe respawn circle available under the
R
button - options controls description in pause menu
- Game customisation available through the option object (ship and asteroid size, thruster powers, weapon reload speed, weapon power, initial count of asteroidsasteroids, colours, shapes and much more)
- True weightlessness
- Graphic guide available when on the
G
key - coordinates grid, collision lines, collision circles - Sound effects & sound track
- Explosions on destroyed asteroids
- FPS counter
- Dynamic Health Bar
- Levelling up - each game level adds one extra asteroid, increases max health points and recovers portion of it
- On screen score and current level
- Pause state
- Game over state
New Game:
Thruster: