buntine / SwervinMervin

A truly radical homage to 16-bit racing games.
GNU General Public License v2.0
230 stars 37 forks source link

Many girls and obstacles are ignored #2

Open Wuzzy2 opened 8 years ago

Wuzzy2 commented 8 years ago

It seems that my car sometimes just drives right through the girls and road blocks instead of killing/crashing into. It's not really easy to reproduce, but it seems that in Level 3, where the girls are in one line never get killed. I experience this in other levels, too.

I am not really sure if this bug exists, maybe I just miss them very closely and it's just me. On the other hand, that wouldn't explain why I seem to get through through some road blocks (I think).

f10ab7b8bc03a47ce72ad3fb346361bb026d501f

buntine commented 8 years ago

Yep, I've also noticed this some of the time

I'm pretty sure it's because the player is travelling so fast that my rudimentary collision detection fails. The levels are broken into a bunch of segments. And so basically, on one frame you are at segment N, the obstacle is at segment N + 2 and by the time the next frame runs through, you are at segment N + 4 and have driven straight through the obstacle without triggering a collision.

A way to fix would be to also check for obstacles that were on any segments you've skipped over since the last frame and then run the collision logic on them. I'll take a look into it soon!

Thanks again for the feedback! :)