New to me? Loops?
CaptFinn
Member Posts: 1,828
Ok I just came across "Loops" in the list of behaviors. What is loops? And give me a example of how loops is used in a game. And what benefits does loops bring to the table?
Finish this sentence:
"Thank goodness we finally have loops, if it werent for loops I wouldnt be able to do , ___________________. Or I would still be having to do ______________________, and thats a lengthy process."
And reading the side note. It sounds like loops has a limitation to what it can do. Long list of behaviors it wont work with.
Comments
When you put logic in a loop, it will run over and over and over again until the condition(s) you give it is met.
Let's say I want to spawn ducks continuously until there are 100 ducks on the screen. You could use a loop like this:
What it's saying is that WHILE the number of ducks is less than 100, SPAWN A DUCK then ADD 1 TO TOTAL DUCKS.
Contact me for custom work - Expert GS developer with 15 years of GS experience - Skype: armelline.support
Ok Ill try that out in my top down shooter game.
I have a video on loops, they have been around for awhile now.
Guru Video Channel | Lost Oasis Games | FRYING BACON STUDIOS
I still don't know whats the difference between loops and constrains , cause i can loop a change attribute motion linear velocity , instead of constraining motion linear velocity , they are the same right ? But on performance when I tried looping vs constrain , constrain was better regarding fps , I don't understand why though , maybe im using the loop behavior in a wrong way
Loops work differently than constrain if they didn't there would be no need for a loop behavior. loops are a more efficient way of doing particular things, like @Armelline posted. Mostly it has to do with the code scan cycle. Same with Loop over table
http://forums.gamesalad.com/discussion/68317/loop-behavior-vs-constrain-behavior
Guru Video Channel | Lost Oasis Games | FRYING BACON STUDIOS
thanks I think I understand , I didnt read the thread before
can you link your video?
Probably this one:
Loops provide a way of doing something some variable amount of times, or doing something until some condition is no longer true.
@DreamLab - Now there's a name I haven't seen in a few years! Good to see you, buddy!
My GameSalad Academy Courses! ◦ Check out my quality templates! ◦ Add me on Skype: braydon_sfx