Jump to content

  • Log In with Google      Sign In   
  • Create Account

Awesome job so far everyone! Please give us your feedback on how our article efforts are going. We still need more finished articles for our May contest theme: Remake the Classics

#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