After the snake game, I wanted to try something a bit more complex, real-time, and playable natively on the browser. This is an Asteroids game I programmed using Java and transpiled to JavaScript using PlayN. The game you see on the screen is live and interactive. It features seamless wrapping, procedurally generated objects/effects, and realistic collision physics.

To accelerate the triangle (ship) forward, press the up arrow key. To turn the ship, press the left or right buttons. To fire a bullet, press spacebar. Try to blow up as many asteroids as you can without getting hit.

There are four different kinds of powerups you can pickup. They appear as wandering squares in the game. Discover what they do by playing the game!

On mobile, you can fire by quickly tapping anywhere in the world and move by dragging your finger around. It might take some getting used to, so a real keyboard is recommended.

You can find the source code at Github: Asteroids