following a path

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
User avatar
farvardin
Party member
Posts: 167
Joined: Sat Jun 28, 2008 6:46 pm

following a path

Post by farvardin »

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.
User avatar
Xfcn
Citizen
Posts: 65
Joined: Sat Jul 12, 2008 6:53 am

Re: following a path

Post by Xfcn »

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
User avatar
farvardin
Party member
Posts: 167
Joined: Sat Jun 28, 2008 6:46 pm

Re: following a path

Post by farvardin »

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?
User avatar
mike
Administrator
Posts: 364
Joined: Mon Feb 04, 2008 5:24 pm

Re: following a path

Post by mike »

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)
User avatar
farvardin
Party member
Posts: 167
Joined: Sat Jun 28, 2008 6:46 pm

Re: following a path

Post by farvardin »

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.
Post Reply

Who is online

Users browsing this forum: Amazon [Bot] and 5 guests