Assigned Position of Clone

Topic

Assigned Position of Clone

Topic Progress:

We know how to create a clone from the previous lesson, now we want to position the clone somewhere on the screen.

For the example here, we are creating pipes that are similar in a flappy bird game.

In the case, you already create 2 costume pipes, create ‘TopOrBottom’ variables to know whether it is the top or the bottom pipe.

We have to set the ‘TopOrBottom’ variable to both ‘top’ and ‘bottom’ values and start cloning them after a few seconds(when we want them to appear again).

We want to add an if else statement to check the variable values if it’s bottom then shows up the bottom pipe else show up the top pipe. Now we want it to move all the way from the right to the left and disappear, to do that, we need to use a repeat until statement like this:

After it moves to the very left, the clone will be deleted.

In the previous class, we knew how to make a variable to pick a random y position that you wanted, we needed to create a similar variable for this game as well. After that we have to replace ‘RandomYPosition’ into our y position in the game, here is the example:

Now the pipe should come out up and down with a different position! It’s your turn to try it out!

Here is an example , give it a try!

@

Not recently active