when a bullet intersects an enemy the enemy is removed but i need the bullet to get removed also need help!!


1 | getWorld().removeObject( this ); |
1 | getWorld().removeObject( this ); |
1 | getWorld().removeObject( this ); |
1 2 3 4 5 6 7 8 9 10 11 | public void destroyEnemies() { //"Enemy" can be any class that you want the bullet to destroy. Actor enemy = getOneIntersectingObject(Enemy. class ); if (enemy != null ) { World myWorld = getWorld(); getWorld().removeObject(enemy); getWorld().removeObject( this ); } } |
1 | getWorld().removeObject( this ); |
1 2 | destroyEnemies(); if (atWorldEdge()) ... |
1 | if (getWorld() != null && atWorldEdge()) |
1 2 | destroyEnemies(); if (atWorldEdge()) ... |
1 | if (getWorld() != null && atWorldEdge()) |
1 2 3 4 5 6 7 8 9 10 | public void act() { setRotation(direction); move( 19 ); if (getWorld() != null ) kill(); if ( this .atWorldEdge()) { getWorld().removeObject( this ); } } |
1 2 | destroyEnemies(); if (atWorldEdge()) ... |
1 | if (getWorld() != null && atWorldEdge()) |