@Override public void preUpdate(int delta) { super.preUpdate(delta); sprayX = this.getX(); sprayY = this.getY() + 60; if (isFlying()) { fly(); return; } else if (!this.isOnGround()) { // reduce the xVel smoothly, until they are hovering. this.setVelocity(this.getVelX() * 0.98f, this.getVelY()); this.steadyTilt(); } else if (isOnGround()) { setRotation(0); if (getNumberOfBeers() > 0) { remainingFuel = 100f; } } if (animationDelta < animationControl) { animationDelta += delta; return; } else { animationDelta -= animationControl; animateWalk(animationStep); } }