@Override
    public void update() {
        int speed = 6;

        if (world.getCollidingEntities(this).size() == 0 && !inAnimation) {
            move(0, speed);
        }

        if (world.getRacket().collidesWith(this)) {
            inAnimation = true;

            Game game = world.getGame();
            game.getBonusManager().add(type);

            if (type == BonusType.ExtraLife) {
                game.addLifes(1);
            }
        }

        if (inAnimation) {
            double angle = Math.atan2(40 - getY(), Game.WIDTH - 40 - getX());

            if (++skippedTicks > 12) {
                padding += 1;
                opacity -= 0.01f;
            }

            speed = 48;

            move((int) (speed * Math.cos(angle)), (int) (speed * Math.sin(angle)));

            if (Geom.getDistBetweenPoints(getX(), getY(), Game.WIDTH - 40, 40) <= 20 || opacity < 0f) {
                remove();
            }
        }

        if (getY() >= Game.HEIGHT + Game.BAR_HEIGHT) {
            remove();
        }
    }