Pick nearest matching value in array

Get help using Construct 2

Post » Wed Sep 30, 2015 10:05 pm

There you go, in the form of a recursive function that check in a circular manner around the provided point. It returns the first found zero scanning from top to bottom and left to right.

https://dl.dropboxusercontent.com/u/700 ... Array.capx

ramones' answer is better, since my method will possibly revisit already checked Array cells if no suitable candidate was found in the first recursion.

edit: Just updated the capx with a travesty of a Breadth-First algorithm. It's surprisingly simple, yet, better than my previous version.
B
81
S
33
G
27
Posts: 1,029
Reputation: 21,143

Post » Thu Oct 01, 2015 11:30 pm

Works like a charm! Took me awhile to understand what is going on there, but already implemented it and modified a bit to fit my game needs.
Much appreciated!
ImageImageImageImage
B
161
S
69
G
44
Posts: 2,612
Reputation: 36,881

Previous

Return to How do I....?

Who is online

Users browsing this forum: visionarybeast and 11 guests