Good night to everyone.
I am currentlyy working on a game, where if the spaceship gets hit 3 times, it disappears. The thing, is that I don't know why it doesn't work.
Here is the code:
I also want an explosion to occur when the obstacle gets hit (I already have the bit where the obstacle/asteroid disappears).
I have created a gif image using GIMP 2, which I would also like to come up.
any ideas?
Thanks in advance :)
private boolean Kaputt = false;
public void takeDamage()
{
Actor Obstacle;
Obstacle = getOneObjectAtOffset(0, 0, Obstacle.class);
Actor Rocket;
Rocket = getOneObjectAtOffset(0, 0, rocket.class);
if(Obstacle!=null)
{
removeTouching(Obstacle.class);
damage = damage+1;
if(damage > 3){
Kaputt = true;
}
World world;
if(Kaputt = true){
world = getWorld();
world.removeObject(this);
}
}
}
