For....Each Problem

BlitzPlus Forums/BlitzPlus Programming/For....Each Problem

maverick69(Posted 2003) [#1]
Hi. I have a little problem and I tought how it could be solved the best way.

I have a For-Each Loop and draw all objects of a type. The source looks like this:

For explosion.explosion = Each explosion
DrawImage explosion\sprite,explosion\x,explosion\y
Next

Is it possible to go trough all objects backwards. So that I draw the first object always on the top??


Snarty(Posted 2003) [#2]
Explode.explosion=First explosion
Repeat
	DrawImage explode\sprite,explode\x,explode\y
	Explode=Before Explode
Until Explode=Null

There ya go.


JazzieB(Posted 2003) [#3]
Shouldn't that be...

Explode.explosion=Last explosion


;o)


Snarty(Posted 2003) [#4]
No, but yeah, it should :P