You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, it builds a bounding box around the segment and checks if the head is in this box. This leads to false positives and for some reason false negatives.
We need a better algorithm. A single segment can be thought of as 3 circles with 8 pixels diameter. And it's easy to detect collision of 2 circles, we already do that for detecting collision with the apple. And we already know coordinates of 2 circles, these are the joints. And the third circle is right in the middle between them.
The text was updated successfully, but these errors were encountered:
Currently, it builds a bounding box around the segment and checks if the head is in this box. This leads to false positives and for some reason false negatives.
snek/snake.go
Lines 187 to 203 in 1d661b0
We need a better algorithm. A single segment can be thought of as 3 circles with 8 pixels diameter. And it's easy to detect collision of 2 circles, we already do that for detecting collision with the apple. And we already know coordinates of 2 circles, these are the joints. And the third circle is right in the middle between them.
The text was updated successfully, but these errors were encountered: