public class Light extends Actor implements Glower {
private static GreenfootImage Glow = new GreenfootImage("light.png");
int d;
/**
* the static block woud be called before any instance has been inited of this class
*/
static{
Glow.setTransparency(0);
}
public GreenfootImage getGlowImage(){return Glow;}
/**
* if U don't give it a iamge at the beginning
* it will get a Greenfoot defalt iamge
* so put the image setting here, not in the act
*/
public Light()
{
setImage(Glow);
}
public void act() {
++d;
if(d > 50) getWorld().removeObject(this);
}
}
Try a change in the Light class like above, and the problem will be fitted
2012/10/20
Mech
2012/10/20
Mech
2012/10/18
Snow(demo)
2012/10/18
Ninjaz
2012/10/18
Snow(demo)
2012/10/18
Simple Fluid Engine
2012/10/17
crab-game-3_1
2012/10/17
Speed3D
2012/10/15
Mech