The Daily Click ::. Forums ::. Klik Coding Help ::. Whats the Loop Index for?
 

Post Reply  Post Oekaki 
 

Posted By Message

Jon C-B

I create vaporware

Registered
  23/04/2008
Points
  237

I'm an alien!VIP MemberWii OwnerI donated an open source project Santa Hat
12th March, 2010 at 23:41:30 -

I think the Loop Index expression thing might be what I'm looking for in my game, but Im not sure. What does it do exactly?

 
n/a

OMC

What a goofball

Registered
  21/05/2007
Points
  3516

KlikCast Musician! Guy with a HatSomewhat CrazyARGH SignLikes TDCHas Donated, Thank You!Retired Admin
13th March, 2010 at 00:02:53 -

Loop index tells you how many times a fastloop has gone through its events. Every time a fastloop checks all conditions you give it, it adds one to this "counter." So if you run a loop (we'll call it "Kalamazoo") you can use the loop index to do a few things.

For example, you can run through a set of objects after using spread value to set the objects' alterable value A.

Start of frame: Spread value 0 in active alterable value A. (This numbers the actives)

Upon pressing space: Start loop "Kalamazoo" (number of actives) times.

On loop "Kalamazoo"
+ Active Value A = Loop index "Kalamazoo": Set active X to Loop Index "Kalamazoo" * 15

That system would take one active at a time and place it 15 pixels to the right of the previous one. You can also use loop indexes to go through a list. And other things.

Edited by OMC

 

  		
  		

Cecilectomy

noPE

Registered
  19/03/2005
Points
  305

Has Donated, Thank You!VIP MemberWeekly Picture Me This Winner!Cardboard BoxGhostbuster!Pokemon Ball!ComputerBox RedSanta HatSnowman
I am an April Fool
13th March, 2010 at 00:31:39 -

its the index of the loop.

a loop is defined to run a certain ammount of times BY you.
loopindex("loopname") simply tells you where in the loop it is at this very moment. its also 0-based index. so it loops from 0 to n-1, n being the number of loops you told it to do.

 
n/a

Jon C-B

I create vaporware

Registered
  23/04/2008
Points
  237

I'm an alien!VIP MemberWii OwnerI donated an open source project Santa Hat
13th March, 2010 at 16:19:54 -

Alright, it wasn't what I was looking for...but thanks anyway

 
n/a

Muz



Registered
  14/02/2002
Points
  6499

VIP MemberI'm on a BoatI am an April FoolHonored Admin Alumnus
14th March, 2010 at 09:37:18 -


Originally Posted by Jon C-B
I think the Loop Index expression thing might be what I'm looking for in my game, but Im not sure. What does it do exactly?



Er, instead of asking whether random things are what you need.. why don't you ask people what it is you need?

 
Disclaimer: Any sarcasm in my posts will not be mentioned as that would ruin the purpose. It is assumed that the reader is intelligent enough to tell the difference between what is sarcasm and what is not.

Image

UrbanMonk

BRING BACK MITCH

Registered
  07/07/2008
Points
  49667

Has Donated, Thank You!Little Pirate!ARGH SignKliktober Special Award TagPicture Me This Round 33 Winner!The Outlaw!VIP MemberHasslevania 2!I am an April FoolKitty
Picture Me This Round 32 Winner!Picture Me This Round 42 Winner!Picture Me This Round 44 Winner!Picture Me This Round 53 Winner!
14th March, 2010 at 13:45:13 -

I like this topic.

Made me laugh.

 
n/a
   

Post Reply



 



Advertisement

Worth A Click