Clockwise rotation change in degrees per frame of every sprite in the group.
A positive value will rotate clockwise, a negative value will rotate counterclockwise. Must be used with the draw() function containing a drawSprites().
The default rotationSpeed is 0. All sprite properties can be both accessed and updated.
var group = createGroup();
group.add(createSprite(100, 200));
group.add(createSprite(300, 200));
function draw() {
background("white");
drawSprites();
if (mouseDown("leftButton")){
group.setRotationSpeedEach(5);
}
else {
group.setRotationSpeedEach(-5);
}
}
group.setRotationSpeedEach(speed)
| Name | Type | Required? | Description |
|---|---|---|---|
| speed | Number | The clockwise rotation speed. |
No return value. Changes output in the display after drawSprites() is called.
drawSprites() is called.Found a bug in the documentation? Let us know at documentation@code.org