In this add-on, you'll program the player
sprite's costume to change if it touches the chaser sprite.
To add a costume for the player sprite,
click the player sprite then on the "Costumes" tab.
Depending on the sprite you chose as the player sprite,
you may have one or many costumes to choose from.
You can delete costumes by clicking the "X" on the costume,
and you can choose new costumes by clicking,
"Choose New Costume" from library.
Once you've selected some costumes for your sprite,
program the costume to change.
From "Looks", drag out a "Next Costume" block.
Click it a few times.
Cool, the sprite changes costumes.
To program the sprite to change if the player's touching
chaser one, chaser two or chaser three, click Control
and select an "If Statement".
You could make a separate "if statement" for each chaser,
but it's easier to use "Or Operators".
This code reads,
If touching chaser one or chaser two or chaser three,
then change costumes.
With the "Or Operator" any of these conditions
could be true and the computer will run this code.
Test your code.
The sprite's costume changes when
the player touches a chaser.
The costume changes very quickly.
Any time the sprite touches a chaser,
the costume changes instantly and doesn't stop changing
until the two sprites stop touching.
To fix this, add a "Wait" block after
the "Next Costume" block.
Tinker with the value in the "Wait" block
to get it to work the way you want.
Now it's your turn.
Add more costumes to the player sprite,
and program the player sprite to change costumes
if it's touching a chaser sprite.
Add a sound to your game and program your project to play that sound.
Program one sprite to be controlled by another player.
Change up your player's costume whenever it touches another sprite.
Make the game harder by making the chasers faster.
Create a new variable that stores the game's current high score.
Sign in to save your project and track your progress.