fkenyon2014.files.wordpress.com  · Web viewUsing Paths in Kodu. Step 1. Open a new world. Step 2....

8
Using Paths in Kodu Step 1 Open a new world Step 2 Create a path by clicking the path tool. Then left click on the screen, drag you mouse to another point and then left click again. Left Click the first Drag the mouse to here and left click again.

Transcript of fkenyon2014.files.wordpress.com  · Web viewUsing Paths in Kodu. Step 1. Open a new world. Step 2....

Using Paths in Kodu

Step 1

Open a new world

Step 2

Create a path by clicking the path tool.

Then left click on the screen, drag you mouse to another point and then left click again.

Continue doing this until you have a complete path; make sure you double click on the starting point to complete the path, like the picture below:

Step 3

Left Click the first time.

Drag the mouse to here and left click again.

Double clicking here tells Kodu your path is finished.

You must pick a colour for your path so that when you program the WHEN/DO for the path the character/object knows which path to follow.

-move your mouse over the path and the colours will show at the top.

-Use the left and right arrows to pick a colour.

Step 4

Add a character that will follow the path. It’s up to you which you choose.

Step 5

Now you need to program the character to follow the path.

Right click the character and select program.

Step 6

This is what your WHEN/DO programming blocks should look like:

REMEMBER: The colour block should match the colour you chose for your path, so if you didn’t make an orange path don’t use the orange block.

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 the path.

Heart for health.

Kodu character that will collect the coin.

Step 3

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:

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.

Step 7

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

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.

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