sam fether's profile

Grade 11 DMA Portfolio - Asteroids Game

Player Input
In the spaceship's code I added player input. The player can turn right and left, move forwards and shoot.
Shooting
 when the player presses the spacebar (the shoot button) the game will spawn a clone of the bullet. The game will then teleport that clone to the players location and make it face the players direction.
the bullet has its own script that adds force to itself when ti spawns in. The amount of force can easily be changed as it is its own variable.
Asteroids
The asteroids that spawn have four different sprites. When an asteroid spawns it will chose a sprite at random.
The asteroids that spawn will also be different sizes and rotations so they all look different.
When an asteroid gets hit by a bullet, it will explode. If the asteroid is big enough it will leave behind two smaller asteroids that go in random directions. when an asteroid is destroyed it adds to the player's score. The smaller the asteroid is, the more score it is worth.
Re spawning
When the player gets hit by an asteroid, they die. After a short delay, the player will respawn in the middle of the screen. For a few seconds after respawning the player will be invincible (they gain the ability to move through asteroids). This feature stops the possibility of the player spawning on top of an asteroid and immediately dying.

When the player dies three times, the players score will be reset and the player will respawn.
Asteroid spawning
Asteroids are spawned by the asteroid spawner game object. They work similarly to the bullet in that they are both clones of an original. When an asteroid is spawned, the asteroids code first determines its size and trajectory. Then it determines where the middle of the world is, then it travels in that general direction
Grade 11 DMA Portfolio - Asteroids Game
Published:

Grade 11 DMA Portfolio - Asteroids Game

Published: