Scratch for Java

Sprite::turnRight()

Turn the sprite to the right.

Examples

import org.openpatch.scratch.Sprite;
import org.openpatch.scratch.Stage;
 
public class SpriteTurnRight {
  public SpriteTurnRight() {
    Stage myStage = new Stage(600, 240);
    Sprite zeta = new Sprite("green", "assets/zeta_green_badge.png");
    myStage.add(zeta);
    while (myStage.getTimer().forMillis(3000)) {
      zeta.turnLeft(2);
      myStage.wait(50);
    }
    myStage.exit();
  }
 
  public static void main(String[] args) {
    new SpriteTurnRight();
  }
}
 

View on GitHub

Syntax

Java

.turnRight(degrees)

Scratch

turn right () degrees

Parameters

Name Data Type Description
degree float How much the sprite should turn right.

Return

void

turnRight()