I don't know if you want to to the full size on the sprite. The "grounding" part was to try and coincide with the z-indexing of an isometric map, since it's more representative of their place on it.
MarekkPie wrote:I don't know if you want to to the full size on the sprite. The "grounding" part was to try and coincide with the z-indexing of an isometric map, since it's more representative of their place on it.
Then how much of the sprite should detect against collision?
I would, in this case, encourage a separation of collision and rendering. Doing the math on squares and circles colliding is easy. The math for parallelograms and ellipses is significantly more complex.
Collision detection is in ISO (complements to HardonCollider). Line 81 and 120 in this file decides what portion of the sprite is checked for collision. Right now it is using the entire sprite, but I'm interested MarekkPie's solution if you'd like to implement it.
Was having trouble navigating through your source code, so I made a little mockup. It's not using ISO, but it shows my idea. Use the arrow keys to move and ESC to quit.
MarekkPie wrote:Was having trouble navigating through your source code, so I made a little mockup. It's not using ISO, but it shows my idea. Use the arrow keys to move and ESC to quit.
I put it in, however in sprites whose width is greater than their height, the collision area is way too large. Here is the commit.