public void update(double diff) {
        switch (state) {
            case MAIN_SCREEN:
                break;
            case PLAYING:
                if (level.isCompleted()) {
                    state = State.LOADING;
                    return;
                }
                for (int i = 0; i < entities.size(); i++)
                    entities.get(i).update(diff);
                break;
            case LOADING:
                if (level.isCompleted())
                    level.loadNext();
                else
                    state = State.PLAYING;
                break;
            case COMPLETED:
                break;
        }
    }