Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var _objects : Array<FlxObject>();
- public function draw()
- {
- var objects = sortObjects(); //Sort every single objects by depth, should return a sorted copy of _objects
- var topObject = objects.pop(); //Pop out the top drawn object
- //Loop through tiles
- for (tile in tiles)
- {
- //Check if the object should be drawn before the tile
- while (topObject != null && isDrawnBefore(topObject, tile))
- {
- draw(topObject);
- topObject = objects.pop();
- }
- draw(tile);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement