/** * Delete the entity from the world. The entity is considered to be * in a final state once invoked; adding or removing components from an * entity scheduled for deletion will likely throw exceptions. */ public void deleteFromWorld() { world.delete(id); }
/** * Delete the entity from the world. * @param e * the entity to delete * @see #delete(int) recommended alternative. */ public void deleteEntity(Entity e) { delete(e.id); }
/** * Delete the entity from the world. * @param e * the entity to delete * @see #delete(int) recommended alternative. */ public void deleteEntity(Entity e) { delete(e.id); }
/** * Delete the entity from the world. The entity is considered to be * in a final state once invoked; adding or removing components from an * entity scheduled for deletion will likely throw exceptions. */ public void deleteFromWorld() { world.delete(id); }
public void deleteFromWorld() { mappers.getWorld().delete(entityId); } }
public void deleteFromWorld() { mappers.getWorld().delete(entityId); }
@Override protected void process(int entityId) { Particle particle = mParticle.get(entityId); if (!particle.particleEffect.isComplete()) { particle.particleEffect.draw(batch, world.getDelta()); } else { world.delete(entityId); } }
@Override protected void process(int e) { final Attached attached = am.get(e); final int parent = attached.parent; if (parent != -1) { // move attachment to absolute position, adjusted with slack. Pos pos = pm.get(e); Pos parPos = pm.get(parent); pos.xy.x = parPos.xy.x + attached.xo + attached.slackX; pos.xy.y = parPos.xy.y + attached.yo + attached.slackY; updateSlack(attached); } else { // parent gone? we gone! world.delete(e); } }
@Override protected void process(int e) { final Attached attached = am.get(e); final int parent = attached.parent; if (parent != -1) { // move attachment to absolute position, adjusted with slack. Pos pos = pm.get(e); Pos parPos = pm.get(parent); pos.xy.x = parPos.xy.x + attached.xo + attached.slackX; pos.xy.y = parPos.xy.y + attached.yo + attached.slackY; updateSlack(attached); } else { // parent gone? we gone! world.delete(e); } }
@Override protected void process(int entityId) { // Explosion explosion = mExplosion.get(entityId); RigidBody rigidBody = mRigidBody.get(entityId); State state = mState.get(entityId); if (state.getStateTime() > 0.75f) { rigidBody.body.getWorld().destroyBody(rigidBody.body); world.delete(entityId); } }
@Override protected void process(int entityId) { Breakable breakable = mBreakable.get(entityId); State state = mState.get(entityId); RigidBody rigidBody = mRigidBody.get(entityId); Body body = rigidBody.body; switch (breakable.state) { case EXPLODING: state.setCurrentState("exploding"); if (state.getStateTime() > 0.6f) { body.getWorld().destroyBody(body); world.delete(entityId); // chance to create PowerUp item if (Math.random() < 0.2) { ActorBuilder actorBuilder = ActorBuilder.init(body.getWorld(), world); actorBuilder.createPowerUp(body.getPosition().x, body.getPosition().y); } } break; case NORMAL: default: state.setCurrentState("normal"); break; } }
@Override protected void process(int entityId) { PowerUp powerUp = mPowerUp.get(entityId); RigidBody rigidBody = mRigidBody.get(entityId); Renderer renderer = mRenderer.get(entityId); State state = mState.get(entityId); // flash before disappearing if (state.getStateTime() > powerUp.life - 2.0f) { renderer.setColor(new Color(1.0f, 1.0f, 1.0f, 1.0f - MathUtils.sin(state.getStateTime() * 20))); } if (state.getStateTime() > powerUp.life) { // destroy rigidBody.body.getWorld().destroyBody(rigidBody.body); world.delete(entityId); } }
World b2dWorld = body.getWorld(); b2dWorld.destroyBody(body); world.delete(entityId);
world.delete(entityId);
world.delete(entityId); break; case MOVING_UP:
transform.z = 999; world.delete(entityId);