Maybe this is not what you mean, but since you did not indicate why it is important, I believe that one answer will be that you do this by controlling the volume and flow of programs.
For example, you will not write such a game:
initialize player code for level 1 ... reinitialize player code for level 2 ... etc
Instead, you would seek:
void play_level(level_number, level_data) { Player player; //gets "re-initialized" at the beginning of each level using constructor //code for level } void game() { level_number = 1; while (some_condition) { play_level(level_number, level_data); ++level_number; } }
(A very crude scheme to convey an idea, rather than being remotely compiled.)
UncleBens Jan 30 '10 at 0:25 2010-01-30 00:25
source share