title: Beat em' up game space management?
body: <p>I am in the process of making my 2D engine for a Beat'em Up game (Castle Crashers is what I call Beat'em Up or Brawler kind of game ). </p>
  
  <p>I will support 2D sprites and 2D particle emitters. This is all done in the engine now. But I have come to an issue that I would like to ask for advice:</p>
  
  <p>It's about "space" management, what I thought was to do something as this image shows:</p>
  
  <p><a href="http://img337.imageshack.us/img337/9162/spacingprototype1.png" rel="nofollow noreferrer">alt text http://img337.imageshack.us/img337/9162/spacingprototype1.png</a></p>
  
  <p>My idea is to make a grid ( Spatial Hash or Grid ), of the ground where my Particle Emitters / 2D sprites will live. In my picture, I have enumerated this slots from 1 to N, (don't have to be 35, it's just for showing purposes ). My idea is to draw the "GameElements" (Sprites/Emitters) in order from 0 to N , ( going from bucket 0 to bucket N ) , so then I will get them to display correctly overlapped on screen (back to forward).</p>
  
  <p>I know this could be done by just comparing the lower Y axis of each Element and performing a "quicksort" too, but having the Grid could allow me to perform Collision Detection in a better way , and if I do something like A* to implement some kind of AI, it could help me too.</p>