Hi there,
Picture a classic snake game where you're allowed to cross your own path. The snake only makes 90 degree turns on say, a 32x32 grid. I want to know when the segments of this snake have completely surrounded another instance or instances. The snake could get pretty long and cross its own path more than once.
Is there a best practice way to approach this problem? Not even looking for code specifics, just the main idea.
Thanks.
Picture a classic snake game where you're allowed to cross your own path. The snake only makes 90 degree turns on say, a 32x32 grid. I want to know when the segments of this snake have completely surrounded another instance or instances. The snake could get pretty long and cross its own path more than once.
Is there a best practice way to approach this problem? Not even looking for code specifics, just the main idea.
Thanks.