private void stepEntities(Graphics2D graphics) {
        Iterator<Entity> it = entities.iterator();
        while (it.hasNext()) {
            Entity entity = it.next();
            if (paused || quitRequested) {
                entity.draw(graphics);
                continue;
            }
            entity.step();
            if (entity.isDead()) {
                if (entity instanceof PlayerShip)
                    killPlayer((PlayerShip) entity);
                else if (entity instanceof EnemyShip)
                    killEnemy((EnemyShip) entity);
                else if (entity instanceof Bullet)
                    killBullet((Bullet) entity);
                else if (entity instanceof Pickup) {
                    waitForPickup = false;
                    upgrade = ((Pickup) entity).getUpgrade();
                }
                it.remove();
            }
            else
                entity.draw(graphics);
        }
    }