Scratch for Java

Sprite::turnLeft()

Turn the sprite to the left.

Examples

import org.openpatch.scratch.Sprite;
import org.openpatch.scratch.Stage;
 
public class SpriteTurnLeft {
  public SpriteTurnLeft() {
    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 SpriteTurnLeft();
  }
}
 

View on GitHub

Syntax

Java

.turnLeft(degrees)

Scratch

turn left () degrees

Parameters

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

Return

void

turnLeft()