Please update your browser
Your browser version is not supported by this site. CS First may not work properly.
This add-on will make the terrain more interesting.
Look how it rises and falls – it’s like the hero is walking over hills on its epic quest.
You won’t see all the steps, so you’ll have to figure some of it out for yourself.
Think about these three things as you figure out how to do this task:
First, how can you “set” or “change” the height?
Second, when should it change?
And third, what else needs to change with the height to keep the game the same?
Make a variable called “ground height.”
If you’ve done the power-up add-on, think about the way the hero’s “jump height”
changes, and think about how you could set the “ground height” the same way.
You’ll make a new ground sprite code stack.
Start with “when flag clicked."
Then, use a “forever” loop to “wait” a random number of seconds, then “set”
the ground height.
This add-on is intended to be a little more challenging, so it’s up to you to keep track
of all the code.
When you set the ground height, you probably want it to be random, so consider setting
it to a random value between negative 120 and negative 80.
Use the new ground height variable in this “go to” block under the “when I receive
It replaces the y value in the block.
Finally, if it changes, what happens with the other sprites?
What do you need to change about them to keep the game interesting?
The bug’s y position needs to go up and down.
If you’ve done the power-up, it should change too.
Into the “forever” loop that makes the clones, drag a “set y” block, then place
the ground height variable into that block.
Now, it’s your turn.
Set the height to change.
Change the height at different times while the game plays.
Add code or fixes to other sprites.