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 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 sprites codestack.
Start with one 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 goto block
under the one IRC forward event
It replaces the Y value in the block.
Finally, if it changes,
what happens to 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.
Test often.
Good luck.
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.