{ }codelper

Learn with tiles › 22

Random numbers

Pick a number that is different every time.

1

A game is fun when you cannot tell what will happen.

The Random: random number from (min) to (max) (last one excluded) tile picks one number in that range by chance. The last number never comes out. With 1 to 7, you get one of 1, 2, 3, 4, 5, 6.

Put it in the x slot of the move tile, and Lara goes to a different place each time you tap her.

("Check" always picks numbers in the same order when it marks your work. So the result is always the same.)

To do When Lara is tapped, move her to a random place with x from -200 to 200 (y is -60).

Loading tiles…

2

If you keep the picked number in a variable, you can use it many times. Let's make a dice.

When you tap Lara, pick a number from 1 to 7 (1 up to 6), put it in the variable dice, and say that number.

To do Each time Lara is tapped, set dice to a random number from 1 to 7 and then say it.

Loading tiles…

Next: A catching game →