I have been playing with the LUA example "05 - Sprite.lua" and realized that the sprite overlay is controled by the order you draw them on screen. Then, if you want to allow sprites to move in front and behind (i.e. "player" can move and be in front of behind a "tree") you require some extra variables to know how deep they are placed

Is there no other way to control which sprite is on top of which? Something like adding to the sprite a layer parameter value and then just drawing them without paying attention to the order.
Angor