Goal:
Now, let’s write code that will animate Iron Man.
When the player presses space, Iron man will change his costume.
Steps:
- Still on the Iron Man sprite, From Events, place a When green flag clicked block in an empty space.
- From Control, add a forever loop, then put an IF ELSE statement inside it.
- From Sensing, add a Key space pressed block inside the condition of the IF ELSE statement.
- From Looks, add one “Change costume to” block under the IF and another one under the ELSE.
- Change the first costume block to costume1 and the second costume block to costume2.