Can someone say how to add lifes to enemy?
Please comment here!
public void collisionWithShip(){
if(getX()==0)
{
getWorld().removeObject(this);
return;
}
else{
Actor Explorer;
Explorer=getOneObjectAtOffset(0, 0, Explorer.class);
if(Explorer !=null)
{
getWorld().removeObject(Explorer);
getWorld().removeObject(this);
}
}
}
}
public void act()
{
if(atLeftEdge()==true){
getWorld().removeObject(this);
return;
}
else {
fly();
collisionWithBullet();
collisionWithShip();
return;
}
}
if (getWorld() != null) collisionWithShip();