Jump to content

  • Log In with Google      Sign In   
  • Create Account


#ActualOlof Hedman

Posted 22 October 2012 - 01:04 PM

Yeah, your datastructure is definitely a problem.

A common, and very fast way, let the nodes be cells in an array, like pixels in a bitmap, and just mark cells as "unpassable" for walls and such.
Then finding neighbours is as easy as adding or substracting to the index of the current node.

Edit: didn't see the last post :) Glad to see you've improved it.

#1Olof Hedman

Posted 22 October 2012 - 01:03 PM

Yeah, your datastructure is definitely a problem.

A common, and very fast way, let the nodes be cells in an array, like pixels in a bitmap, and just mark cells as "unpassable" for walls and such.
Then finding neighbours is as easy as adding or substracting to the index of the current node.

PARTNERS