Can someone say how to add lifes to enemy?
Please comment here!


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | 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 ); } } } } |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | public void act() { if (atLeftEdge()== true ){ getWorld().removeObject( this ); return ; } else { fly(); collisionWithBullet(); collisionWithShip(); return ; } } |
1 | if (getWorld() != null ) collisionWithShip(); |