// WARNING: This file is auto-generated and any changes to it will be overwritten import lang.stride.*; import java.util.*; import greenfoot.*; /** * */ public class Klickerknopf extends Actor { private int anzahlKlicks = 0; /** * Act - tut, was auch immer Klickerknopf tun will. Diese Methode wird aufgerufen, sobald der 'Act' oder 'Run' Button in der Umgebung angeklickt werden. */ public void act() { if (Greenfoot.mouseClicked(this)) { this.anzahlKlicks = this.anzahlKlicks + 1; this.getWorld().showText("Klicks: " + this.anzahlKlicks, 50, 80); } if (this.anzahlKlicks == 30) { Greenfoot.setWorld( new Level2(this)); } } }