6
Using your path in a game situation We are going to create another character whose aim is to collect a coin that is in the path of the character following the path you created. We will program the character on the path to damage the character that is attempting to collect the coin. If damage to health occurs we will also have an object that can be collected to increase health. Step 1 Add the extra characters and Objects. Step 2 Giving the Kodu character health. Right click the character and go to change settings. Scroll down and press enter on ‘show hit points’. Coin positioned on Heart for health. Kodu character that will collect the coin.

fkenyon2014.files.wordpress.com€¦ · Web viewGiving the Kodu character health. Right click the character and go to change settings. Scroll down and press enter on ‘show hit points’

Embed Size (px)

Citation preview

Using your path in a game situation

We are going to create another character whose aim is to collect a coin that is in the path of the character following the path you created. We will program the character on the path to damage the character that is attempting to collect the coin. If damage to health occurs we will also have an object that can be collected to increase health.

Step 1

Add the extra characters and Objects.

Step 2

Giving the Kodu character health. Right click the character and go to change settings. Scroll down and press enter on ‘show hit points’.

Step 3

Coin positioned on the path.

Heart for health.

Kodu character that will collect the coin.

Program the Kodu character you just added to move with the arrow keys.

Step 4

Program the Kodu Character to eat coins.

Step 5

Program your game to have a score variable; this is for when the Kodu character eats coins.

At this point your program for the Kodu character should look like this:

Step 6

You need to program your character on the path to shoot at the Kodu character and damage it if it gets too close. Just damaging the character will mean that the health variable can be used.

Your code should look like this:

Step 7

Line 1 means: The character will always move along the orange path.

Line 2 means: When the character following the path sees the Kodu character is close by it will shoot a missile at him.

Line 3 means: When the missile shot hits the Kodu character he will receive damage of 10points to his health.

You need to program the Kodu so that when it eats the heart it adds health and heals him.

Your programming blocks should look like this for the Kodu character:

Step 8

More Variables in Kodu

Game Over

Add another line of code to your Kodu character’s program:

- You will need to add extra coins to your game to match the number of coins collected you need to win the game.

Speed

These are the lines you are adding here to make the heart give the Kodu character health.

The numbers of points you need to win a game.

You can alter the speed at which the characters move, this could be useful in certain games.

-Select the character you wish to move faster and go to change settings.

-Use the top 4 options to change speed of the character using the left and right arrows keys.

Step 9

Test your game!

Extension:

- Try adding more objects.- Change the world so that it has a theme for your game.- Think about what else you could add or change about your game and try

doing it.