.rotate()

Bitsbox's rotate command makes it easier to rotate objects on the screen. You can rotate by a precise number of degrees (clockwise is positive), or in either the RIGHT or the LEFT direction. You can also specify how long a rotation should take to complete. This is expressed in milliseconds (thousandths of a second).

In Bitsbox, 0 degrees points straight upward. From there, increasing degrees points you increasingly clockwise. So 90 degrees points toward 3 o'clock, 180 degrees to 6 o'clock, and so on.

This first example rotates the arrow stamp and the word 'arrow' to 90 degrees instantly when you tap the stamp.

This program rotates both objects to 45 degrees over 500 milliseconds.

Using a direction rotates the object to point in that direction instantly.

Rotates LEFT (counter-clockwise) by 45 degrees.

Rotates LEFT by 45 degrees over 500 milliseconds.

Rotates the object instantly to a random direction. In this example, the stamp and text probably won't end up pointing in the same direction. They each get their own random direction.

All of these same commands can also be called on circles. Which seems odd, since there's no visible change to the circle when it rotates. But it's necessary for moving circles in the same way that stamps and text objects can move. Here's a simple example that shows why you might want to rotate a circle.