]Hi, I'm trying to make a centipede game, and right now I've got it so that it will shoot a laser from a player and now I need it to shoot mushrooms down. So the first time it hits a mushroom I need it to change images from the original image ( "Arcade - Centipede - General Sprites_0008.png") to "Arcade - Centipede - General Sprites_0009.png"
this was my code in laser
and this was my code in mushroom actor :
why doesnt it change, and can someone provide a solution?
move();
if(this.getWorld()!=null) {
Mushroom m = (Mushroom)getOneIntersectingObject(Mushroom.class);
if(m != null) {
m.onHit();
}
}
int height = getImage().getHeight();
int width = getImage().getWidth();
public GreenfootImage hit0 = new GreenfootImage("Arcade - Centipede - General Sprites_0008.png");
public GreenfootImage hit1 = new GreenfootImage("Arcade - Centipede - General Sprites_0009.png");
public void onHit() {
if(getImage().equals(hit0)) {
setImage("Arcade - Centipede - General Sprites_0009.png");
}
