Web viewObjectives. To understand how to create complex commands. To learn how to create a complete...

4
[Type text] Helicopter Game Objectives 1. To understand how to create complex commands 2. To learn how to create a complete game Step 1: Create and name five sprites A Helicopter sprite with 2 costumes – to create the effect of the rotor blades spinning.

Transcript of Web viewObjectives. To understand how to create complex commands. To learn how to create a complete...

[Type text]

Helicopter Game

Objectives

1. To understand how to create complex commands2. To learn how to create a complete game

Step 1: Create and name five sprites

A Helicopter sprite with 2 costumes – to create the effect of the rotor blades spinning.

[Type text]

Helicopter Game

A stalactite sprite and a stalagmite sprite which form the base and ceiling of the cavern.

Step 2: Controlling the Helicopter

The go to statement sets the start location of the helicopter.The helicopter rises (Y axis increases) when the Up-Arrow key is pressed. It should fall back to the ground if no key is pressed. It is not possible to get the helicopter to fly level.

Step 3: Moving the stalactite & stalagmite sprites.

The stalactite and stalagmite move along the cavern as an obstacle for you to fly round. The code is the same for them both.We want them to repeatedly move across the screen, so we put a forever loop around the movement code.The show statement makes the sprite appear, with a glide moving smoothly across the screen. The random at the end waits a random number of seconds before the obstacle appears again.

Step 4: Moving the bar obstacle

The code to move the sprite across the screen is very similar to that of moving the stalactite and stalagmite. We have added a random number for the height (y-axis) that the bar will appear.

This code will make the bar rotate as it moves across the screen

A score sprite – which shows your score

A Bar sprite which will be a moving obstacle

[Type text]

Helicopter Game

Step 5: Scoring and Ending the Game

This code on the helicopter sprite controls many important aspects for the game.

It starts by setting the score to zero every time you start to play the game.

It then has a small delay before incrementing your score, changing the costume of the helicopter to make it seem like the rotor blades are rotating.

The IF statement checks to see if the helicopter sprite has touched any other green (why green) sprites. Touching another sprite signals the end of the game.

Step 6: Paint the background black with two green horizontal bars.

Extension Tasks

Create a more elaborate helicopter design Add a laser gun to the helicopter so you can shoot the rocks out of the way Add some people to the rocks to be rescued; this could increase your score. Add a splash screen to the start of the game, giving the player two choices – one to display the

instructions of how to play the game, the second option plays the game.