The Premise
Design a fun arcade game in the browser, using only HTML canvas and vanilla JavaScript.
My Design
I started by building a basic, 2D gravity simulator. I apply physics to the player every tick based on the surrounding planets. From there, I wrote a O(n) algorithm to efficiently predict and simulate the player position n ticks in the future, and added a rendering loop.
To turn the concept into a game, I added a player, controls, and game-play features such as time control. I polished it off with a customizable control scheme, flushed out menus and high-scores, and finally a ray-tracing rendering engine to act as a first person camera.
How to Play
- Use arrow keys and [enter] to operate the menus
- Use [space] to fire the thruster, and the arrow keys to turn
- Get to the highlighted planet to win
- Press [F] to freeze/unfreeze time
- Press [C] to change the camera mode
Things to Try
- Play each level in order
- Fly the ship in both camera modes
- Generate some random stages
- Try to beat the highscores
- Modify the linear physics depth in order to see some cool patterns
- Turn up your sounds! PS. I hope you played MAELSTROM back in the 90s :)