satjeb / WFA

A short prototype of a game made in C with SDL. It plays as a sort of cross between Asteroids and Space Invaders, but Star Trek themed.
0 stars 0 forks source link

Fix isPointInShape() #1

Open satjeb opened 6 years ago

satjeb commented 6 years ago

isPointInShape() is currently not putting the shape together right, resulting in each line segment referring to the same side of the game area rather than the interior/exterior side of the object. This causes strange behavior in collision detection which thankfully is mitigated due to a quick code edit which generally invalidates the entire function by having it always return False. Nonetheless, this means that all collision is detected purely by line segment collision, which while sufficient for current gameplay, will not be for future gameplay.

Acceptance Criteria:

satjeb commented 6 years ago

Still researching this, worked out a couple other possible issues with floating point exceptions which might get looked at separately. I have designed a probable solution which calls for an origin point (this would be absolute position of the object) being passed in to the function in order to consistently identify the side of the line we're testing for. This would guarantee that we get the proper collision area. Looking for better solutions though that do not double the number of point-line calculations it does.