Skip to content

bartek-swiderski92/asteroids-game

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

96 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

image

Asteroids

        
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

Playable Game

https://bartek-swiderski92.github.io/asteroids-game/

Controls

Main thruster
Right thruster
Left Thruster
Space Shot
Esc Pause
G Grid (graphic effect)
R Respawn shield (graphic effect)

Changelog

1.1 Technical improvements

  • 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

1.0 Base version of the game

  • 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

Gallery

New Game:

image

Thruster:

image

Coordinates grid, collision lines and collision circles:
image

Pause state:
image

Gameplay:
image

GameOver state:
image