(Loop issue) Is there any way to implement loop function?

As title, I want to use loop function (for, while, do while), but I can't find it in gamesalad.
Any help?
Thanks a lot : )
Any help?
Thanks a lot : )
Best Answer
-
greenglue Posts: 52
Hi!
I am pretty sure you can make a Timer to run every 0 seconds, but NOT till completion. Then in there you can have rules depending if you want it to be a while statement, for, etc... So basically: use timers!
Hope I helped!
Michael
Answers
while(score>250)
{
....
}
in GS you would create a rule that says if score variable greater than 250 then do the stuff inside the rule.
For a for loop use a timer or create a variable that counts up and using multiple rules you can use the same method to build a for loop. There really are no programming limitations in GS.
youngster9
For example: for(var a = 0; a < 10; a++)
Would be this in gamesalad.
Create a interger attribute called a
In the actor
Change attribute a to 0
Timer every 0.1
Inside the timer have a rule if attribute a < 10
then in the timer have a change attribute behavior and change a to a+1
Hope that helps
Cool you know Java too. People really give GS devs a bad rep because they think we are all too stupid to learn how to code but that is not true
Thanks a lot : )
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User