Goal:
Now we must program what happens if the Madalorian touches the keycard, baby yoda, or IG-11!
This will be similar to the touching color black code except we will now use touching (Sprite).
Steps:
- From Control, place 3 new IF statements for our color rules.
- From Sensing, drag over 2 touching blocks into the new IF statements.
- Select IG-11 for the first one, Keycard for the second one, and baby yoda for the third.
- Copy the code from touching color (black) into IG-11’s if statement.
- From Events, drag over 2 broadcasts into the last 2 IF statements.
- Create 2 new messages for the broadcast blocks: doorOpen for the first one, and yodaSaved for the second one.
Test out your game and see if your if statements are working for IG-11!