cykod / Quintus

HTML5 Game Engine
http://html5quintus.com
GNU General Public License v2.0
1.41k stars 401 forks source link

obj.c vs obj.p during collision detection #105

Closed sven1977 closed 10 years ago

sven1977 commented 10 years ago

Hi everyone, I was wondering about an issue I stumbled across during coding my game in quintus. It seemed like a falling sprite in a 2d game with gravity was able to fall into another object from the top and even get rendered in that overlapping position before - in the next frame - the overdue collision would occur.

Here are my thoughts on why this could happen and how to fix it:

Let me know what you think, thanks, Sven

cykod commented 10 years ago

I think I'm confused , isn't this what's happening in collide (i.e. generateCollisionPoints is called before each regrid and after each collision) - or are you seeing something else? Please re-open I'm misunderstanding

https://github.com/cykod/Quintus/blob/master/lib/quintus_scenes.js#L663

sven1977 commented 10 years ago

Oh my, you are absolutely right. I must have deleted that line accidentially from my local version.

Sorry and thanks!