Re: User text in wait(); in bgt.
#OP please don't use google translate, as it makes no sense whatsoever. Consider using bing instead if you have trouble.I too am unable to gleam the root of your question, but know this, if you force the script to wait, you're pausing the entire thing, that means that during that time, your game or whatever you're making in BGT is doing nothing, it cannot execute code at all. This is essential in infinite loops, because without it, your CPU will trend upwards to 100%, because BGT will then be stealing all the CPU cycles, and other apps that need those resources will have to fight to get them.If you need to have something happened after a certain amount of time has passed, but you don't want your script to pause, this is where timers come in.timer my_timer; // declaring the timer variablevoid main() // defining the main function{// do stuffwhile (true) // infinite loop{ if (my_timer.elapsed >= 5000) // don't do anything until the timer reaches 5 seconds or 5000 milliseconds { show_game_window("My Game"); // shows the game window with the string as the name in the title Bar my_timer.restart(); // vital for things that need to be timed more than once, this resets the timer to 0ms and starts it running. }wait(5); // allow other programs to use CPU cycles}} // end main functionIf I wrote that out correctly, which who knows... but yeah, I don't know why you'd want to wait 5 seconds to show the game window, but you could use this for anything. The example is pointless other than to show syntax.
URL: http://forum.audiogames.net/viewtopic.php?pid=347603#p347603
___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector