 <p><strong>Problem 1</strong>:</p> <p>As Blau stated, your rocks will be sorted from front to back, and because they have the same depth, they will (some times) be sorted randomly. This is probably due to float precision (or lack thereof).</p> <p>Instead of changing the depth of your rocks, you can use <code>SpriteSortMode.Deferred</code>, which will draw the sprites in order, and delay the render until you call End (or until the spriteBatch can't handle any more sprites and needs to flush).</p> <p><strong>Problem 2</strong>:</p> <p>As Blau stated, this is also probably due to float precision. However, the problem <em>can</em> be avoided. Imagine having a moving tile, and your player walks near that tile. The tile then moves on top of your player (because we forgot to code the tile <em>not</em> to). You're player now cannot move, because any direction the player tries to move is an "invalid" move, because he'll be touching that tile.</p> <p>The problem is that we're <em>preventing the character from moving</em>. If the character could always move, we wouldn't have this problem. However, if the character could always move, he could just more right through things. To prevent this, we need an opposite action acting against the character when he moves against a solid object.</p> <p><em>Solution</em>:</p> <p>Allow the player to move into an object, and then scan for all of the objects he's touching. If he's touching any, figure out what direction you should move him <em>away</em> from each object, and combine all of those directions to form a single vector. Scale that vector by some reasonable amount (to prevent the character from being pushed away dramatically). Move the player according to that vector</p> <p><em>Problems with this method</em>:</p> <p>If you have a force from gravity, or the like, you may find your character "sinking" into the ground. This is a result of the gravity pushing against the force that pushed the player back from the tiles. The problem can be solved by <em>displacing</em> the character away from any tiles before applying a force on the player to <em>move</em> him away.</p> <p>This turns out to be a very complex problem, and it is already solved for you.</p> <p><em><strong>Box 2D / Farseer Physics Engine</em></strong>:</p> <p>You've probably heard of these before and thought "Oh, I'll just roll my own, because that sounds super fun!" And while programming your own physics engine can be super fun, it also takes an extremely long time. If you want to get your game up and running quickly with physics (even if they're simple Sonic-like physics), Erin Catto has laid all the ground work for you. :)</p> <p>Check these out:</p> <p>Box2D XNA: <a href="http://box2dxna.codeplex.com/" rel="nofollow">http://box2dxna.codeplex.com/</a></p> <p>Farseer Physics: <a href="http://farseerphysics.codeplex.com/" rel="nofollow">http://farseerphysics.codeplex.com/</a></p>