Noid Posted July 3, 2015 Share Posted July 3, 2015 If I have a sprite standing on top of two tiles like this: The collision code will always return the one on the left as the collided tile even if most of the hitbox is standing on top of the one on the right. I want to make my character react differently based on what tile it bounces off, but players get confused when the character is bouncing mostly off a tile type A and the reaction corresponds to a tyle type B that it was barely touching. Link to comment Share on other sites More sharing options...
Skeptron Posted July 3, 2015 Share Posted July 3, 2015 I think that it's how games work though : if you touch tileA, even just a bit, then you benefit from whatever tileA's bonuses are. Is it not a problem with your body instead? On your picture the body of your character is very different from the real, visual look of the character, and this is going to create confusion, for the tiles or for hitboxes. (but I guess that if it is that flat, it's because it is currently boucing?) Link to comment Share on other sites More sharing options...
Noid Posted July 13, 2015 Author Share Posted July 13, 2015 I think that it's how games work though : if you touch tileA, even just a bit, then you benefit from whatever tileA's bonuses are.Is it not a problem with your body instead? On your picture the body of your character is very different from the real, visual look of the characterIgnore the sprite image, I'm talking about the body. If you touch tileA with the body even just a bit it considers that you're standing on tileA, but ONLY if you're coming from the right since the contact point is only the bottom-left of the sprites body. That means that if you're coming from the left you can have 99% of the sprite's body on top of tileA and it won't count since the bottom left of it is not touching the tile. This is very confusing for players since they don't understand why they sometimes get a bonus when they're barely touching a tile and sometimes they don't get it even with most of the sprite standing on it. I've manage to fix it adding a collision callback. If the body is onFloor and not onWall I get the tile immediately below the body bottom center and if I get a tile that has collidesUP set to true I use that for the bonus. Link to comment Share on other sites More sharing options...
Recommended Posts