// main loop
loop
// freezes all processes in the lot / level, this blocks the physical execution of the process code, but allows the rendering to screen.
signal(TYPE enemy, s_freeze_tree);
signal(TYPE player, s_freeze_tree);
text_id = write(......, "Press a key to start");
// waiting loop
while(scan_code == 0) frame; end
// delete "key message"
delete_text(text_id);
// awakens all game processes to start the game / level
signal(TYPE enemies, s_wakeup_tree);
signal(TYPE playe, s_wakeup_tree);
// level loop
while(level_done == false || player_lives > 0)
...
frame;
end
end
|