So right now I have done a lot of reading up on assigning states to the spawned lines.
When a boat is created by the boatspawner class, it will be assigned an ID (first boat is ID 0, second is 1 etc.)
This works great. I then adjusted the placeGround() method I wrote so that the path that is created when dragging your mouse from a specific boat creates a path with the same ID. So if there's 5 boats in play with IDs from 0-4, and you drag a line from the third boat, it will create a path with ID 2.
The last thing I have to do is make the actors with a given ID only move towards & remove the same ID path. However this is where I struggle.
I can't seem to find a way to make the boat with a given ID face towards the path with a same ID.
Somehow doing something like this won't work :
Keep in mind that this is just some stupid code that only is here to show how I am currently going at detecting the ID. I know that the getOneObjectAtOffset doesn't work for detecting close nodes etc, it really only is here to let u know how I'm trying to write it atm.
However, this won't work. I am probably going at it the wrong way, but basically what i want it to do is find the closest path actor, check if it's the same ID as the boat and then move towards it, else do nothing.
Actor closestpath = getOneObjectAtOffset(0,0,PathRed.class) if(closestpath.getID()==boatID) { move etc... remove path and face next one... }