Step 8 - Debug Forever Loop

The forever loop in this script is supposed to make sure our chicken keeps collecting the coins .

> Open Level 8.

image alt text

> Edit the script on the chicken.

What movements is the chicken going to make based on what you see?

> Play the game to see if the chicken moves as you think it will.

What happened? Can you debug the chicken?

> Close the game preview and edit the script on the chicken again.

You’ll need to find out where you need to change the movements in the script. Remember that the chicken needs to avoid moving into the water, and it also needs to move around any obstacles such as rocks, trees, or tree stumps.

image alt text

> Make any changes you need to, such as adding or removing broadcast blocks, or changing the amount of times the repeat block will repeat.

> Play the game to see if you've solved the level.

The chicken should keep collecting these coins forever. Did that happen? Nice one!

If not, have a look back over your Script and see if you can spot any bugs.

results matching ""

    No results matching ""