Step 4: Creating apples to represent the numerator

As our apple moves across each step, we'll create a clone of the apple so we can see exactly how many steps the apple has taken to represent the size of the numerator (as shown below).

To create new apples, we'll use the "create new instance" block (from Draw). Grab it and drag it above the "in 100 milliseconds" block.

Drag the "class class" block into the trash, and replace it with "class of myself" (from Sensing). Drag "myself" into the trash as well, and replace that with "first instance by tag apple"

The set the x and y position of the newly created apple to match the x and y position of the first apple (the newly created apple is "instance instance" from Variables)

Play the game now to see all the apples get created to represent the numerator.

In the next step we will make sure that the apples don't go outside the game if there are more than can fit on one line.

results matching ""

    No results matching ""