Skip to content

Instantly share code, notes, and snippets.

@szabba
Forked from anonymous/sd
Last active September 7, 2015 14:22
Show Gist options
  • Save szabba/b95dd469c52b1de6dcb7 to your computer and use it in GitHub Desktop.
Save szabba/b95dd469c52b1de6dcb7 to your computer and use it in GitHub Desktop.
void load_initial_level() {
load(0);
}
void load_next_level() {
load(variables.level);
}
typedef void (*process_loading_func)();
vector<process_loading_func> loading_process_phases;
void init_loading_process_phases() {
loading_process_phases.push_back(make_darkness);
loading_process_phases.push_back(make_darkness);
loading_process_phases.push_back(load_initial_level);
loading_process_phases.push_back(make_lightness);
loading_process_phases.push_back(load_next_level);
loading_process_phases.push_back(make_darkness);
}
void loading_process() {
loading_process_phases[variables.loading_phase]();
}
if (variables.loading_phase == 0 || variables.loading_phase == 1) { make_darkness(); }
else if (variables.loading_phase == 2) { load(0); }
else if (variables.loading_phase == 3) { make_lightness(); }
else if (variables.loading_phase == 4) { load(variables.level); }
else if (variables.loading_phase == 5) { make_darkness(); }
else make_lightness();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment