The Daily Click ::. Forums ::. Klik Coding Help ::. nested loops
 

Post Reply  Post Oekaki 
 

Posted By Message

Cazra

Crazy?

Registered
  24/07/2002
Points
  4472

Game of the Week WinnerVIP Member
2nd July, 2005 at 19:40:58 -

Does anyone know if MMF will allow a fastloop within a fastloop?

I'm trying to create a front/back system for an isometric engine. Here's kind of how I've got it planned out:

1) arrange tiles and objects with objects closest to bottom of the map towards the front.( it then puts all the objects into an array in this order. The frontmost objects are in the greatest slot position of the array.)

2) Compare the player's elevation to the elevation of each tile starting with the backmost tile in the array. If the player's elevation is higher than the tile's, insert the player into the array slot right in front of the tile.(everything ahead of the tile in the array is moved up a slot using a nested loop)

 
n/a

Fifth

Quadruped

Registered
  07/05/2003
Points
  5818

VIP MemberGOTW JULY 2010 WINNER!Kliktober Special Award TagGOTW HALLOWEEN 2011 WINNERPicture Me This Round 51 Winner!
2nd July, 2005 at 19:45:42 -

Fastloops can definitely be nested, yes. But if you have too many loops too often, it will slow down drastically...

...Are you planning on using a separate object for each tile? That might get messy...

 
Go Moon!

Klikmaster

Master of all things Klik

Registered
  08/07/2002
Points
  2599

Has Donated, Thank You!You've Been Circy'd!VIP MemberPS3 Owner
2nd July, 2005 at 20:04:31 -

Yes, you can use nested loops, hand for grids

 
n/a

Cazra

Crazy?

Registered
  24/07/2002
Points
  4472

Game of the Week WinnerVIP Member
3rd July, 2005 at 09:40:46 -

yay! Now I can probably get this thing to work.

I'm using separate objects for each tile. The tiles are generated at the start of the level following instructions for the map layout in a text file.

I'll see if the nested loop doesn't slow it down too much. If it does, I guess I'll just have to go with a not so good iso front/back engine I came up with earlier.

Edit: This system made it go too slow with all the fastloops and array stuff.

Image Edited by the Author.

 
n/a
   

Post Reply



 



Advertisement

Worth A Click