Hi,
I dont know why but method isAtEdge is not working and there is error every time.
Can someone please help?
public class Reload extends Actor
{
/**
* Act - do whatever the Reload wants to do. This method is called whenever
* the 'Act' or 'Run' button gets pressed in the environment.
*/
public static int pocet = 0;
public Reload()
{
GreenfootImage image = getImage();
image.scale(image.getWidth() +25, image.getHeight() + 25);
setImage(image);
}
public void act()
{
if (Coin.type == 1)
{
lod();
}
if (Coin.type == 2)
{
lod2();
}
if (Coin.type == 3)
{
lod3();
}
if (isAtEdge())
{
getWorld().removeObject(this);
}
move(-2);
}
public void delete()
{
if(isAtEdge())
{
getWorld().removeObject(this);
}
}
public void lod()
{
if (isTouching(Lod.class))
{
getWorld().removeObject(this);
}
}
public void lod2()
{
if (isTouching(Lod2.class))
{
getWorld().removeObject(this);
}
}
public void lod3()
{
if (isTouching(Lod3.class))
{
getWorld().removeObject(this);
}
}
}
