/**
* Act - do whatever the Ball wants to do. This method is called whenever
* the 'Act' or 'Run' button gets pressed in the environment.
*/
public void act()
{
move(10);
dissapear();
}
public void dissapear()
{
if(isAtEdge())
{
World MyWorld = getWorld();
MyWorld.removeObject(this);
}
else if(isTouching(Pxl2.class))
{
World MyWorld = getWorld();
MyWorld.removeObject(this);
}
else if(isTouching(Ball2.class))
{
World MyWorld = getWorld();
MyWorld.removeObject(this);
}
}
}