Z order style queue function!

Published 2023-06-12

have you ever wanted to do z ordering, but without careful programming practices?

well i have the product for you!

introducing: the queue() and drawq() functions!

usage:

queue(--[[any function (spr, rect, pal, anything)]],{--[[array of parameters]]},--[[order index]])
use this to put things in the queue.

drawq()
no parameters here! it just bubble sorts --[[oh god]] the functions and calls them in that order,
meaning that --[[for example]], spr calls with the y pos passed as an index, will be stacked like real things, and no more characters standing on each others heads!

q={}
run this to clear the queue. this is the var which i used for queues. this is not perfect, but improvements are left as an exercise for the reader. --please post them, as i know i could do better.

anyway, the script:

here's a little example!