I need to change the order of some objects

BlitzPlus Forums/BlitzPlus Programming/I need to change the order of some objects

WoeIsMe(Posted 2003) [#1]
I've created a nice flamethrower in Alf the Elf II, and instead of firing a single flame, it fires a number of small flames in quick succession, in a sort of cluster. Everything's fine, apart from that I want the flames created first to appear on top of those created last, ie. be drawn last. How do I do this? Here's my code, should you want it:
.flameregs
For allflame.flame=Each flame

allflame\x=allflame\x+allflame\xmov+(Rand(-10,10)/10)
allflame\y=allflame\y+allflame\ymov+(Rand(-3,3)/3)

allflame\time=allflame\time+1

If allflame\time>allflame\maxtime/5 Then allflame\size=1
If allflame\time>allflame\maxtime/5*2 Then allflame\size=2
If allflame\time>allflame\maxtime/5*3 Then allflame\size=3
If allflame\time>allflame\maxtime/5*4 Then allflame\size=4

allflame\animtime=allflame\animtime+Rand(0,1)
If allflame\animtime>19 Then allflame\animtime=0



DrawImage flame,allflame\x-death\camerax,allflame\y-death\cameray,(allflame\animtime/10)+(allflame\size*2)

If allflame\time>allflame\maxtime Then Delete allflame

Next
Return


I've experimented with the Last and Before commands, but I can't seem to get anything to work. Anyone know how to do this?


Who was John Galt?(Posted 2003) [#2]
When you create a new flame INSERT it before all the others in the list. See command help for INSERT.


WoeIsMe(Posted 2003) [#3]
Thanks!