The classic asteroids 2-D space game remade in javascript with color, explosions, and full simulation collision physics.
WASD keys are used for movement. Left click fires a missile which will follow the mouse position. Right click fires a missile which goes straight.
Each body (your ship, the missiles, asteroids) carries momentum and is accurately simulated with collision physics.
ui: initial velocity
vi: final velocity
mi: mass
v1 = [(m1 - m2) / (m1 + m2)]u1 + [(2 m2) / (m1 + m2)]u2
v2 = [(2 m1) / (m2 + m1)]u1+[(m2 - m1) / (m2 + m1)]u2
m1u1 + m2u2 = m1 v1 + m2 + v2
To play the game, clone the repository into a your local folder and open the html file in a browser.