dummey / CS50-Cohort-Project-Redux

2 stars 0 forks source link

Player collide with fast moving UFOs causes Ship to spin on respawn #23

Closed jbtule closed 9 years ago

jbtule commented 9 years ago

This appears to occur every time now with the new fast moving baby ufo's. It's not just subtle movement, the player continues to fight it's own spin with left and right arrow for a bit even!

I'm assigning to ricky, because this is a perplexing mystery!

dummey commented 9 years ago

The problem occurs because of race conditions between the collision callback and the update loop. The reset was being called before the update which was doing collision based calculations. Thus momentum was being transferred between the ufo and player after reset.

jbtule commented 9 years ago

:+1: