How do I insure that moving sprites are on top of non-moving sprites. Currently, some moving sprites go over non-moving and some go under.
Solution is fairly simple!
And it give more flexibility.
Sort your sprites according to "depth". By depth I mean "distance" to viewer. Eg. You want your "static" sprites to be in background, and "dynamic" in foreground. So add property "depth" or "z", to sprites, and then sort them before drawing them.
It also give you possibility to have multiple depths.
Here look at some game made with that technique:
At 0:10 you can see different parts of landscape being rendered into different "depths". (And you can see how moving different "depths" at different speeds can give illusion of observer movement!)