View Full Version : Hero's pet needs to follow him
Skribble
December 2nd, 2008, 08:35 AM
==Never mind, I've got something working for now. You can see the progress of my engine here (http://www.kirupa.com/forum/showthread.php?p=2412844#post2412844)==
Iamthejuggler
December 2nd, 2008, 08:48 AM
There are a bunch of different ways to do pathfinding. I assume you have tiles that have walkable/notwalkable properties, or at least some way of checking what areas are walkable?
Have a read about A* pathfinding. It's one of the most common ways to do it.
http://www.policyalmanac.org/games/aStarTutorial.htm
Skribble
December 2nd, 2008, 06:52 PM
sorry for the vague post *facepalm*
was really tired when I made it, and thought I covered everything.
It's an art based game, so I'm just testing distances between movieclips. The pet and hero both get attached to _root with the background placed behind them, and objects placed on top of the background. The ground movieclip is where the characters CANT walk, and is an invisible clip.
I need to somehow get the pet to know how to maneuver around the ground movieclip (_root.ground) while following the hero. The thing is, I don't just want him to follow the hero's exact x,y path, I want it to look kind of natural.
There, that is a much better explanation, sorry again haha \o/
SparK_BR
December 3rd, 2008, 02:59 PM
it's a bit buggy, rain lags a lot
anims are getting stuck sometimes
it would be better to press the duck key and only get up uppon release of the button
(toggle duck remember me of that first person shooters where you can't jump)
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.