ketanhwr / reflexio

A web game based on reflection
MIT License
81 stars 72 forks source link

Fix infinite ray tracing #31

Closed matthias-vogt closed 6 years ago

matthias-vogt commented 6 years ago

Keeps track of second last ray angle to check if there is a big enough difference to continue tracing the ray. Fixes #27

ketanhwr commented 6 years ago

@matthias-vogt, even though it fixes the bug in level 2, it creates a new bug in the same level :p

Try completing the level with your changes, you won't be able to. I think the difference should be even smaller than 0.1. That might fix it.

matthias-vogt commented 6 years ago

Aaah sorry about that. It wasn't the epsilon, in my pull, I checked if the secondLastAngle was about equal the currentAngle but that was the wrong approach. This should work.

ketanhwr commented 6 years ago

Haha, I liked your commit message xD

Thanks for the contribution!