@Override
    public void update(GameContainer gameContainer, StateBasedGame stateBasedGame, int delta) throws SlickException {
        final float elapsed = delta / 1000.0f;
        player.update(elapsed);
        for (final Bullet bullet : bullets) {
            bullet.update(elapsed);
        }
        for (final BadGuy badGuy : badGuys) {
            badGuy.update(elapsed);
        }
        for (final BoomParticle particle : boomParticles) {
            particle.update(elapsed);
        }

        for (final Bullet bullet : bullets) {
            for (final BadGuy badGuy : badGuys) {
                badGuy.hit(bullet);
            }
        }

        bullets.removeAll(removeBullets);
        removeBullets.clear();
        badGuys.removeAll(removeBadGuys);
        removeBadGuys.clear();
        boomParticles.removeAll(removeBoomParticles);
        removeBoomParticles.clear();

        badGuyTimer -= elapsed;
        if (badGuyTimer < 0.0f) {
            System.out.println("Added bad guy");
            final BadGuy badGuy = new BadGuy(this);
            badGuys.add(badGuy);
            if (lastBadGuyTimer >= 0.5f) {
                badGuyTimer = lastBadGuyTimer * 0.99f;
            }
            else {
                badGuyTimer = 0.5f;
            }
            lastBadGuyTimer = badGuyTimer;
        }

    }