/** * Act - do whatever the Notice wants to do. This method is called whenever the 'Act' or 'Run' * button gets pressed in the environment. */ public void act() { Scenario e = (Scenario) getWorld(); if (vel < 0) move(vel); vel--; if (getX() + getImage().getWidth() / 2 < 0) { if (fin == true) { if (e.getActualSound().isPlaying()) e.getActualSound().stop(); Greenfoot.setWorld(new Menu()); } else getWorld().removeObject(this); } }