The Daily Click ::. Forums ::. Klik Coding Help ::. Tutorial ruquest Highest Y value is on the front
 

Post Reply  Post Oekaki 
 

Posted By Message

Jarzka



Registered
  26/12/2003
Points
  270

VIP Member
25th November, 2009 at 01:40:52 -

So this is very difficult for me to explain but I'll try.

There are many "UnitObject" objects in the level. I want that if the object Y value is higher than other UnitObject it will be in the front it and if the Y value is lower than other UnitObject it will be behind it. This way the objects can move behind and in front of other same objects.

Check this:
http://img42.imageshack.us/img42/4559/mmf2.png

 
n/a

cake



Registered
  13/12/2002
Points
  1173
25th November, 2009 at 02:44:16 -

Ah yes.

You'll need the Layer Object.

Always:
LayerObject->Sort UnitObject by Y Value ascending

Or maybe its descending. Easy to try both and see which one is correct.

Edited by cake

 
n/a

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
25th November, 2009 at 03:14:40 -

i always just use a fastloop and bring things to the front as necessary.

 
n/a

Jarzka



Registered
  26/12/2003
Points
  270

VIP Member
25th November, 2009 at 06:22:39 -

Ah yes, I haven't tried the Layer object but fast loop sounds good idea. How can I be so stupid

EDIT: And yes it works. Thank you so much

Edited by Jarzka

 
n/a

Jason Orme

Using Klik Products Since 1998

Registered
  24/05/2002
Points
  960

VIP Member360 OwnerWii OwnerAttention GetterThe Cake is a LieCardboard BoxHero of TimeI'm a Storm TrooperI'm on a BoatIt's-a me, Mario!
Sonic SpeedMushroomStrawberryI like Aliens!PS3 OwnerTurtle Power!I am an April Fool
25th November, 2009 at 07:01:44 -

oh.......... my............ god..........

I could honestly kiss the person who created this thread... I never knew about the layer object.. its amazing!

 
www.jsofts.com

alastair john jack

BANNED

Registered
  01/10/2004
Points
  294

GOTW WINNER CUP 1!GOTW WINNER CUP 2!GOTW WINNER CUP 3!VIP MemberMushroomI am an April Fool
25th November, 2009 at 13:05:31 -

haha, yeah the layer object is fairly handy in lots of ways.

 
lol

Jason Orme

Using Klik Products Since 1998

Registered
  24/05/2002
Points
  960

VIP Member360 OwnerWii OwnerAttention GetterThe Cake is a LieCardboard BoxHero of TimeI'm a Storm TrooperI'm on a BoatIt's-a me, Mario!
Sonic SpeedMushroomStrawberryI like Aliens!PS3 OwnerTurtle Power!I am an April Fool
26th November, 2009 at 03:34:16 -

The only problem i've found is...

Imagine its a beat em up in the style of say "Streets Of Rage", everything works the way it should.
Now imagine the breakable barrels/traffic cones etc in the middle of the screen.

for example, I create an active object which is a barrel, its movement is static. The layer object appears to completely ignore it. Is there a way around this?

Also, whats the benefit of the fast loop object?

Edit: It would appear for it to work all active object must have the same height and width.

Edited by Jason Orme

 
www.jsofts.com

cake



Registered
  13/12/2002
Points
  1173
26th November, 2009 at 04:46:47 -

Where are you putting the hot spots in your objects?

They should be where ever the object's 'base' is. Ie, the point where the object is in contact with the ground.

That's the only thing I can think of that would be making it work incorrectly.

 
n/a

Jason Orme

Using Klik Products Since 1998

Registered
  24/05/2002
Points
  960

VIP Member360 OwnerWii OwnerAttention GetterThe Cake is a LieCardboard BoxHero of TimeI'm a Storm TrooperI'm on a BoatIt's-a me, Mario!
Sonic SpeedMushroomStrawberryI like Aliens!PS3 OwnerTurtle Power!I am an April Fool
26th November, 2009 at 14:08:38 -

I havn't used hot spots at all and everything else works fine.

I bassically increased the size of the barrel (so theres loads more transparency around it) and re-positioned it more in the middle, and it appears to have worked.

 
www.jsofts.com
   

Post Reply



 



Advertisement

Worth A Click