From Test-Scratch-Wiki
Turn () Degrees | |
Category | Motion |
Type | Stack |
The Turn () Degrees blocks are Motion blocks and Stack blocks. The blocks turn their sprite the specified amount of degrees clockwise or counter-clockwise (depending on which block is used); this changes the direction the sprite is facing.
The blocks use the 360 degrees in a circle.
Example Uses
These blocks are the easiest way to rotate a sprite, unless many costumes are used to give the illusion of rotation or the workaround is used.
Some common uses for the Turn () Degrees blocks:
- Simple rotation
— e.g. planets and wheels
forever turn cw (15) degrees
- Animation
— e.g. a waving hand
repeat (5) turn cw (15) degrees end repeat (5) turn ccw (15) degrees end
- Vehicles that can turn
forever if <key [left arrow v] pressed?> then turn ccw (3) degrees end if <key [right arrow v] pressed?> then turn cw (3) degrees end
Workaround
- Main article: List of Block Workarounds
The blocks can be replicated with the following code:
point in direction ((direction) + (amount))
point in direction ((direction) - (amount))