Hey guys, I'm trying to write what I thought would be a fairly simple program.
I'd like to spawn a number of nodes and give them a random direction to travel in (incrementing x and y speed each draw cycle). If the node touches the line traveled by any of the other nodes, or it touches the boundary, it should stop.
This code is very slow. I feel like I'm doing it inefficient/wrong by loading the pixels of the Processing window and checking against that to see if a line is present (notice the shoddy rounded float to integer conversion). My knowledge of programming isn't deep enough to think of a better solution though.
Should I do something like load all the lines into an array and check each of the nodes against it using math on each cycle instead?