Was I wrong? The woes of collision detection
I don't know why it's so hard, but collision detection is being such a problem right now. I had it working well except that you could walk into 1 block high areas... than I tried to fix that. That's all I've done since about 9:15 this morning. It's now 3PM and I am tired of messing around. I'm guessing that it's because I'm trying to allow for entities of any size... how do I get this to work? I guess I'll limit myself to 1x1 block entities and 1x2 block characters... should help...(log in to comment)
Comments
@saluk This particular quirk I'm at right now can't really be adapted around, whenever I jump up and hit a block, I go to the left if it's next to an air block, or to the right otherwise... really annoying. I'll deal with it some other time, ragdolls await! (the physics of course)
hidas on 2011/09/13 19:23:
This has always been a problem in my Pyweek games. Really the only way I ever got it working was by fiddling around with the values until it felt good. Just keep thinking of simple solutions, and you'll eventually get it.Another strategy is to calculate where the rectangles will be one frame in advance, and if they will be overlapping, adjust their velocity to move them right next to each other, but not colliding.