import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)
/**
* Write a description of class Kratten here.
*
* @author (your name)
* @version (a version number or a date)
*/
public class Kratten extends Actor
{
/**
* Act - do whatever the Kratten wants to do. This method is called whenever
* the 'Act' or 'Run' button gets pressed in the environment.
*/
public void act()
{
if (Greenfoot.mouseClicked(this))
{
if (platform != null && platform.getSchip() != null)
if ( platform.getSchip() != null)
{
System.out.println("geraakt");
platform.getSchip().setKratten(this); // schip laadt krat in
getWorld().removeObject(this); // 'krat verdwijnt
}
private void setPlatform(Platform p)
{
platform = p;
}
public Platform getPlatform()
{
return platform;
}
}
}
}
