Generally, if you feel the need to call wait(), there's probably a better way to do what you're trying to do that won't tick off your entire program update cycle. It's different in a command prompt situation where everything is conveyed as lines of text, but once you move past that it's generally wise to use timer variables or something like GM's alarms (which are the same concept, just automated to a fair degree for you). The thing with waits are that they do stall everything, and a lot of programming languages provide for that, but I don't hear much of a wait() being called in anything beyond a console application, because outside of multithreading you're stopping everything and that's generally not a wise decision. You can still accomplish similar things manually by using timers and a boolean or two, only allowing objects to be active and respond to things so long as a global allows them to do so. GM originally had a wait() function that stalled the entire program for a given period of time, but when converting to Studio and its multiplatform intention it was discovered this made a lot of OSs incredibly angry, especially with mobile. use a for loop that uses your screen width/height and tile size width/height and have it parse through every possible tile placement and then just use a probability trigger by using random or whatever means you want to decide, to see if it will place the resource rock on that position.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |