Posted By
|
Message
|
..:.Phox.:..
Registered 18/02/2005
Points 646
|
19th September, 2005 at 14:39:10 -
Hey all
I just got the pathfinding object, but have no clue on how to make this work «, you have any ideas?
Thanx
Profile edited as it messed the layout of the site up.
|
Assault Andy Administrator
I make other people create vaporware
Registered 29/07/2002
Points 5686
|
19th September, 2005 at 21:42:48 -
For one object at a time it's quite simple, but for multiples it gets a bit more complex. Here's basically how it works:
Set mapsize (eg 20x15)
Set Start position (eg 2,5)
Set Destination (eg 10,5)
Find path
You then run a loop (try about 500 times) and on each loop move the object and advance the position.
On loop "Move"
Active.x = Pathfindingobject.x
Active.y = Pathfindingobject.y
Pathfindingobject.Advance One
This will give you an instant movement.
Creator of Faerie Solitaire:
http://www.create-games.com/download.asp?id=7792
Also creator of ZDay20 and Dungeon Dash.
http://www.Jigxor.com
http://twitter.com/JigxorAndy
|
..:.Phox.:..
Registered 18/02/2005
Points 646
|
20th September, 2005 at 03:48:23 -
Thanx!
ANd Is it possible to make multiple enemies use pathfinding?
Thanx
Profile edited as it messed the layout of the site up.
|
Assault Andy Administrator
I make other people create vaporware
Registered 29/07/2002
Points 5686
|
20th September, 2005 at 03:51:09 -
That is where it gets quite tricky. You can't just chuck them all in the one loop, because that doesn't work. One method is to save their paths into an array and then read them when the enemy needs to move.
This is a very good example, I think he overcompicated it however. It is also quite difficult to understand, but it works .
http://www.clickteam.com/CTforum/showflat.php3?Cat=&Board=upload&Number=169920&page=&view=&sb=&o=&vc=1
Creator of Faerie Solitaire:
http://www.create-games.com/download.asp?id=7792
Also creator of ZDay20 and Dungeon Dash.
http://www.Jigxor.com
http://twitter.com/JigxorAndy
|
|
|