Goal:
Now that Iron Man’s code is done, we will switch to the obstacles sprite.
We need to program the sprite to spawn randomly and move to the left to make Iron Man look like he is moving forward through the level.
Steps:
- Click on the Obstacles sprite on the right side of your screen.
- From Events, place a when I receive reset_game block in an empty space.
- From Variables, place a set highscore to block under the event, but change highscore to score.
- From Looks, add a hide block and a show block under the set score to block.
- Next, click on Control and add a wait until block in between the hide and show blocks.
- From Sensing, place a key space pressed block inside of the wait until block.
- From Control, place a forever loop after the show block.