GameV3

This is an example of a video game created using Processing.

For my example, Version 4, I want to create a video game that simulates a spaceship. When I press the keyboard arrow keys, the spaceship will fire a rocket in that direction and start it moving in the opposite direction. Because there is no friction in space, the spaceship will keep moving at a constant speed unless another rocket is fired, except that gravity keeps increasing the velocity downwards.

Near the bottom of the canvas, there is a rugged surface of the moon. There is one flat area colored green for the landing pad. The goal of the game is to move the spacecraft so that it is exactly above the landing pad, moving very slowly.

How will the player win or lose? I want the user to steer the spaceship to a landing pad to win, anywhere else crashes and explode. Also, if the spaceship is moving too fast when it hits the landing pad, then it will crash and explode.

The explosion will be lots of small particles flying in all directions. However, since that is really cool, I'll also use it for a firework display over the spaceship when it lands safely.

Will there be a score? I will have a fuel supply and reduce it every time a rocket is fired. If the fuel runs out, the spaceship will probably crash. Your score is the amount of fuel left after a successful landing.

Your browser does not support the canvas tag.

Source code: GameV4

Built with Processing and Processing.js