Re: While Loops, Do While Loops, or For Loops in BGT
All 3. If you can know how long a loop will last, or if you're performing an action on every item in an array, use a for loop. Otherwise, use a while loop. Do-while isn't needed that often. The example you described doesn't sound like it'd have as much use for for loops, but would use at least one while loop. Most BGT games will use a while loop to keep the game running until it is closed. You'd use for loops if, for instance, you had an arbitrary number of enemies or items you needed to update at once.
_______________________________________________ Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector