Game Development Community

Question regarding 2D side scroller [Solved]

by Raijin · in Torque Developer Network · 04/25/2011 (4:09 pm) · 0 replies

Greetings again fellow developers,
I hope I can get my point across as I am fairly unfamiliar with the correct term for torque functions and features.

I am developing a 2D side scroller with 3/4 view (like Castle Crasher, Scott Pilgrim, Double Dragon). I am stuck trying to figure out the Layer Management / Sort Points.

Basically, I have all interactive things in layer 1. I have the layer management set to Y axis to give the effect of any units going behind or in-front of an object (ex. a table). This works fine.

My problem is, my player controls has a jump function, and whenever an object (a block) is in a higher position (positionY = -40, to give it the back effect) and a player unit below it is in a lower position (positionY = 40, to give it the front effect), when the player unit jumps, it passes through the block, giving the effect that it is behind the box, before returning back into it's original Y position (lands after jumping).


I want to code it so an object in the foreground (front) does not affect any object behind it. Whether the object in the front is attacking, jumping or throwing a projectile.

Thank you in advance!

PS.
I am well aware of the Adventure Kit, but I am slightly OCD about this and I just want to know how this could be accomplished without it.


EDIT/SOLUTION:
My solution so far involves multiple layer and player check onUpdate to see if player is in the designated layer for Sorting to properly work.

About the author

Recent Threads