I want to create an explosion by changing an image in the missile, but the "Gegner" checks whether the missile has hit him or not. I have done this because the Gegner's hp is deducted for this. But now I have to somehow tell the rocket to change its magic.
Below the code from the Gegner
if (isTouching(Rocket.class)){
hp=hp-50;
/** here I would like to tell the rocket to change its image
deathcount = (deathcount+1)%20;
if (deathcount == 0){
removeTouching(Rocket.class);
}
}

