I'm trying to create a remake of the old game Amidar, only the bonus sequence at the moment.
I've made the board, and I'd like to know if there is an easy way with Löve to follow a path or a set of lines created with the love.graphics.line function. There is an object with should follow the line, and each time it meets a crossroad it must follow it.
following a path
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Re: following a path
I was going to suggest you look into translating A* path-finding algorithm but you might find that to be a bit too much for what you're after.
"Any sufficiently advanced technology is indistinguishable from magic." - Arthur C. Clarke
Re: following a path
I don't think I'm skilled enough for using this. The paths are already made, I will start the object in one direction, and when it reaches a crossing line, it should change direction. I think the future collision detection module may do the job?
Re: following a path
I was going to suggest A* myself, but it seems like an over-complicated method of doing it since the paths are very simple. My best suggestion is to create some sort of metaphysical representation of the whole world (like a 2D array with boolean values) where you then designate what is a path and what isn't, letting the creatures traverse the path that way. I wonder if the collision detection would be able to handle following an object this way...
Now posting IN STEREO (where available)
Re: following a path
I've found this article which seems to be understandable even by a noob like me:
http://www.policyalmanac.org/games/aStarTutorial.htm
but I think I'll try a simpler method for this kind of simple project.
http://www.policyalmanac.org/games/aStarTutorial.htm
but I think I'll try a simpler method for this kind of simple project.
Who is online
Users browsing this forum: Amazon [Bot] and 5 guests