|
Post by Corey Hectus on Jul 11, 2006 1:05:31 GMT -5
Ever wanted to implement a timer to make those puzzles harder? Well, now you can, and it isn't too hard either. First, you add your varibles: int counter = 0; int player_inroom = 0; int player_air = 100;
Then if the player is in the room with the timer, you set player_inroom to 1: int player_inroom = 1;
And when the player isn't in the room: int player_inroom = 0;
And in your repeatedly_execute function you add the counter, which executes commands only every 100th game cycle: if (player_inroom == 1){ if (counter < 99){ counter++; else{ player_air--; SetSliderValue(GUINAMEHERE, GUIOBJ#HERE, player_air); counter = 0; COMMANDS HERE } }
Of course, you use a slider to do this. You could just use a regular set timer command and use is timer expired to run something like this. For the parts in CAPITAL LETTERS, that means put your own command here or guiname. Well, its small, but you might find it useful for something!
|
|