In this add on,
you will add code that lets the user turn the dancer
by pressing different keys.
Wouldn't it be cool if you could make the dancer spin
or turn while they are dancing?
To get started, you'll need a key press event.
Drag out a when key press block from the events tab
and select the right arrow from the drop down menu.
Now when the arrow key is pressed,
something will happen.
In this example, the key press makes
the sprite turn clockwise 15 degrees.
To make that happen, drag out a turn clockwise block
from the motion menu and connect it
to the when arrow press block.
Time and test this code by clicking the green flag,
then pressing the right arrow.
Sweet! Cassie's turning clockwise
when I press the right arrow key.
You can also make this dancing sprite
turn in the other direction when a different key is pressed.
Drag out the turn counter-clockwise block
and another key press event.
Change the key press event to
when the left arrow key is pressed.
Test out the code and see if it works.
Look at that! Cassie turns left and right now.
Now it's your turn.
Add at least 2 key press events and 2 turn blocks
to make Cassie turn clockwise
Make it your own and try adding other key press events
to control different effects on Cassie's dance moves.
Add another sprite to the dance party for Cassy to dance with.
Add new backdrops so that Cassy can dance around the world.
Add a graphic effect that makes Cassy look like she is twisting.
Add a story to your dance party using the "say" block.
Add extra music to your dance party and allow the user to control the song that plays.
Let the user turn the dancer by pressing different keys.
Sign in to track your progress and earn badges