// WARNING: This file is auto-generated and any changes to it will be overwritten import lang.stride.*; import java.util.*; import greenfoot.*; /** * */ public class Pferdchen extends NPC { /** * Act - do whatever the Pferdchen wants to do. This method is called whenever the 'Act' or 'Run' button gets pressed in the environment. */ public void act() { if (this.isTouching(Prinzessin.class)) { Greenfoot.playSound("wiehern.wav"); this.setLocation(Greenfoot.getRandomNumber(this.getWorld().getWidth()), Greenfoot.getRandomNumber(this.getWorld().getHeight())); } if (Greenfoot.getRandomNumber(100) > 98) { this.setLocation(Greenfoot.getRandomNumber(this.getWorld().getWidth()), Greenfoot.getRandomNumber(this.getWorld().getHeight())); } } }