Problem With Loop Iteration
Hey!
I am having an issue with a loop I created. In the game the player can decide how many actors to spawn. This amount is held in a counter. When the "GO" button is pressed, I would like to run a loop that takes that counter, spawns, than counter -1's until it reaches zero. At this point. I want the loop to stop. I am wondering if the issue is that I have the loop linked to the button press function. I thought that loop should run anyways. Any thoughts?
Thanks!
C
I am having an issue with a loop I created. In the game the player can decide how many actors to spawn. This amount is held in a counter. When the "GO" button is pressed, I would like to run a loop that takes that counter, spawns, than counter -1's until it reaches zero. At this point. I want the loop to stop. I am wondering if the issue is that I have the loop linked to the button press function. I thought that loop should run anyways. Any thoughts?
Thanks!
C
Best Answers
-
tatiang Posts: 11,949
Take the loop out of the button press and instead have it activated by a change attribute (boolean usually) when the button is pressed. -
tatiang Posts: 11,949
Also see this thread: http://forums.gamesalad.com/discussion/41887/i-can-make-a-loop-in-the-gs
Answers