TodePond / ScreenPond

screens in screens in screens
https://screenpond.cool
MIT License
125 stars 6 forks source link

Hit detection is wrong for certain shape screens #36

Closed TodePond closed 2 years ago

TodePond commented 2 years ago

It thinks you're touching the corner when you aren't really

TodePond commented 2 years ago

This is caused by pity! If I turn off pity outside the screen, this bug doesn't exist.

Perhaps related to #29 or pity not scaling properly

TodePond commented 2 years ago

It's also because some positions return [0, 0] during hit detection, which gets incorrectly picked up as the top-left corner

TodePond commented 2 years ago

AH! It's because I made NaNs get changed into 0. I should change them into Infinity or something instead? If I were to make the engine again, I would put checks in for NaN. But for now, I'll just avoid it.