The Daily Click ::. Forums ::. Klik Coding Help ::. FAST LOOPS
 

Post Reply  Post Oekaki 
 

Posted By Message

Floating~

Nothing to see here turn back

Registered
  4/11/2008
Points
  245

VIP Member360 Owner
4th May, 2009 at 6:18:18 PM -

So; I am a veteran clicker but i don't know so much about fastloops. One thing that's been bugging me is that i feel kinda retarded not knowing how to make a looped movement. I know the regular custom movement taht is laggy and buggy but capable of slopes but nov I've realised that there is more to it than the slopes. My problem is that there apparantly is not a single good tutorial on fastloops out there. I bet it exicts, but I can't find it. PLease help!

 
In the future
Nobody will drop the bass
No-one will do the Harlem Shake
No-one will know bitches love cake
There will be no internet friends
There will be no antidote
The human race will be extinct

Say hello to the robots!

Knife Party

Silveraura

God's God

Registered
  8/8/2002
Points
  6744

Game of the Week WinnerKlikCast StarAlien In Training!VIP Member360 OwnerWii OwnerSonic SpeedThe Cake is a LieComputerChristmas Tree!
I am an April Fool
4th May, 2009 at 7:43:20 PM -

To break it down really easy, a fast loop is nothing but a way to call for a bunch of events to repeat within 1 main loop.

So for example:
Start
Always: Add 1 to Counter
End

In this example, you'll notice every frame, the counter goes up by 1.

A fast loop however:
Start
Always: Start loop "Add" 5 times.
On loop "Add": Add 1 to Counter
End

In this example every frame, the counter now jumps 5 instead of 1. This is because it's repeating the looped event 5 times.

Now what's interesting is, you can stop fast loops if the conditions for that loop suddenly don't exist.

For example:
Object overlaps backdrop: Start loop "Move up" 32 times.

On loop "Move Up",
+Object overlaps backdrop: Move Object up 1.

On loop "Move Up",
+Object NOT overlaps backdrop: Stop loop "Move up".

This actually means that every loop, it's checking to see if it is, or isn't overlapping the backdrop. If it suddenly stops overlapping the backdrop mid-loop, the loop will cease and the object will stop moving up. This is used to avoid the "sinking" in platforms, because it means that you can have the player sink deep into the ground, and make a fast loop that always kicks the player back up and flush onto the platform.

I'll try to make an example for you if this was too hard to understand.

 
http://www.facebook.com/truediamondgame

Devernath



Registered
  12/4/2004
Points
  54

VIP Member
4th May, 2009 at 7:49:20 PM -

So, what are some common uses for fastloops that couldn't be done with regular loops?

I think also the fact that theres no help file in the fastloop extension leads to confusion

 
n/a

-UrbanMonk-

Professor Spectrum

Registered
  7/7/2008
Points
  6120

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 Fool
4th May, 2009 at 7:50:15 PM -

Also make sure that the "loop" event is at the top of the event stack, otherwise it won't work.
But I'm sure you already knew that.

 
http://www.soapcow.com <- Flash games, featuring MMF made games!
http://www.jsoftgames.com <- Old blog I don't keep up anymore

Floating~

Nothing to see here turn back

Registered
  4/11/2008
Points
  245

VIP Member360 Owner
4th May, 2009 at 8:09:39 PM -

Actually i knew all that Brandon, but thanks a lot anyways. I was... wait a min. I HAVE an example somewhere deep in the vast mountains of unsorted files I think. HOWEVER I did NOT know it had to be on the top! Why?

 
In the future
Nobody will drop the bass
No-one will do the Harlem Shake
No-one will know bitches love cake
There will be no internet friends
There will be no antidote
The human race will be extinct

Say hello to the robots!

Knife Party

-UrbanMonk-

Professor Spectrum

Registered
  7/7/2008
Points
  6120

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 Fool
4th May, 2009 at 8:25:48 PM -

because that is the first event mmf checks before checking the rest.
There is more info about how mmf handles events at these links-
http://www.create-games.com/article.asp?id=1937
http://www.create-games.com/article.asp?id=1942
http://www.create-games.com/article.asp?id=1798

make sure to rate these articles 5 stars if you find them helpful

Edited by -UrbanMonk-

 
http://www.soapcow.com <- Flash games, featuring MMF made games!
http://www.jsoftgames.com <- Old blog I don't keep up anymore

AndyUK

Mascot Maniac

Registered
  8/1/2002
Points
  14165

Game of the Week WinnerSecond GOTW AwardHas Donated, Thank You!VIP Member
4th May, 2009 at 8:37:39 PM -

If you want to move an object faster than 1 pixel per MMF loop (ie reading through the events and updating the screen once) it might end up inside or even passing through a obstacle before MMF gets around to checking for collisions.
With a fastloop you can get around that problem by still moving one pixel and checking for collisions but running the fastloop as many times as you like. All within a single MMF loop.

 
.

Floating~

Nothing to see here turn back

Registered
  4/11/2008
Points
  245

VIP Member360 Owner
4th May, 2009 at 8:44:46 PM -

Thanks for all the help guys!

OMGWTF thirteen thousand creds?!?? How the lol?

Edited by Floating~

 
In the future
Nobody will drop the bass
No-one will do the Harlem Shake
No-one will know bitches love cake
There will be no internet friends
There will be no antidote
The human race will be extinct

Say hello to the robots!

Knife Party

~Matt Esch~

Stone Goose

Registered
  12/30/2006
Points
  870

VIP Member
4th May, 2009 at 10:31:48 PM -

Fastloops are also useful when you don't know how much you need to move your object by. There are 2 main approaches to dealing with a movement (specifically collision detection)

1) move then push back: so imagine a player falling. When he hits the ground (or collision detector touches the ground), first of all you make the downwards movement stop, and then using a fastloop, you move the character up 1 pixel at a time until he is not sticking into the ground.

2) you may notice a problem with option 1: if you're player was falling really fast, he might miss the ground all together. One moment he is above a platform, and then he moves down 32 pixels and now he is below the platform. In this case we would prefer to move the character down 1 pixel at a time. So if I want to move my character down 32 pixels, a fastloop moves him down 1 pixel 32 times, and in the mean time I am able to check for collisions inbetween.

Personally I use option 2 with a slight twist: I move more than 1 pixel at a time, but just enough. This is much more efficient if I know it is safe to move 6 pixels down at a time or something like that.

Edited by ~Matt Esch~

 
http://create-games.com/project.asp?id=1875 Image


Floating~

Nothing to see here turn back

Registered
  4/11/2008
Points
  245

VIP Member360 Owner
4th May, 2009 at 10:40:18 PM -

Thanks again. Fast, direct and informative replys everyone! Best place if you need kliking help, no doubt

 
In the future
Nobody will drop the bass
No-one will do the Harlem Shake
No-one will know bitches love cake
There will be no internet friends
There will be no antidote
The human race will be extinct

Say hello to the robots!

Knife Party

-UrbanMonk-

Professor Spectrum

Registered
  7/7/2008
Points
  6120

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 Fool
4th May, 2009 at 10:42:48 PM -

Indeed it is

 
http://www.soapcow.com <- Flash games, featuring MMF made games!
http://www.jsoftgames.com <- Old blog I don't keep up anymore
   

Post Reply



 



Advertisement

Worth A Click