annotated code raw code
Move with the arrow keys. Shoot with the S key. Refresh to play again.
Demonstrates a game loop, collision detection, keyboard input, drawing to the canvas and playing sounds.