About Face!

At our last meeting we had the question of whether we could set up our Sprites to face the direction of their movement automatically instead of having separate costumes for mirror images. It turns out that we can use the Rotation Style setting of each sprite to do that!

In this example, the characters will all start moving to the right and are programmed to make a 180 turn when touching the edge. How they look on their return trip to the left depends  on the Rotation Style setting.

Scratch Rotation Style
Scratch Rotation Style

Here they are after the 180; they are all moving to the left although one looks to be upside down and another moves “backward”:

ScratchRotationStyle2

Design Time vs Run Time Property Settings: Setting the Rotation Style in the IDE (Integrated Development Environment) as above is an example of a Design Time Property Setting. We can also change the Rotation Style during the program execution, i.e. Run Time,  by using the Set Rotation Style command in the Motion section of scripts. 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s