public void process(long ticks, Level level) { super.process(ticks, level); if (shield.getVisibility()) { shield.rotateY((float) ticks * 0.3f); // shield.setScale(1+(float)Math.sin(shield.getZAxis().x)/6f); } }
public void hitByExplosion( CollisionParticipant source, LocalObject obj, DecalManager decal, CollisionEvent ce) { if (shield.getVisibility()) { // If the shield is visible, we are invincible... return; } Event event = new Event(Event.EXPLOSION_HIT, -99, obj.getObjectID(), obj.getClientID()); source.getEventQueue().add(event); }
public void setToLocalObject(LocalObject lo) { super.setToLocalObject(lo); if (lo.isInvincible() && !shield.getVisibility()) { shield.setVisibility(true); } else { if (!lo.isInvincible()) { shield.setVisibility(false); } } }