Game Development Community

Moving an Object Behind Another Object

by Eric Bahr · in Torque Game Builder · 02/02/2008 (2:27 pm) · 2 replies

TGB's layer system allows objects to move over and below objects. But is there a simple way to have an object move around other objects?

This seems common in 2D video games. Here're three screenshots from CT that illustrate my point:

http://i14.photobucket.com/albums/a329/Empyrealmortal/1.png
http://i14.photobucket.com/albums/a329/Empyrealmortal/2.png
http://i14.photobucket.com/albums/a329/Empyrealmortal/3.png

May the wind be always at your back,
-Eric

#1
02/04/2008 (7:40 pm)
There is nothing I know of out of the box that will achieve what you want. However if your looking for a programming solutions you can always use the onUpdate call back of the player object or behavior to check its height relative to the other players and adjust the layer appropriately.
#2
02/04/2008 (7:47 pm)
Check out the "layer sorting" feature (with no objects selected in TGB, go to the Edit pane, and expand out the Layer Management rollout) and sort-points on objects. I think it will do what you're looking for.