Hi all,
I really need some help here. I want to create a game from the AvatarChat example. Something like a map where you can explore around, there are some plants here n there. I try to use hitTest to detect if there is any object(plant) blokcing the path. My character do detect there is an object and will stop, but will get stuck there unable to move away when i click other position. Please Help!!!
How do i edit the easingEquation.as so that my character start, move and end at constant speed instead of easin in and out?
Need Help!! Please Help ME!!!
What you have to do is this.
1. Each hittest you do that is negative (not hitting), save the _x and _y positions in some variables, for that movieclip (avatar).
2. Then, when the hittest is positive (you are hitting a plant), use the variables to jump back to the last position you were in that wasn't hitting.
This should definitely work to keep you from getting stuck. The way you have it now the avatar can't move because the hittest imobilizes it, and the next frame you're still hitting. The method I have above doesn't imobilize your avatar, just sends it back to last previous "safe' position.
Not really a Smartfox question, but hope it helps.
1. Each hittest you do that is negative (not hitting), save the _x and _y positions in some variables, for that movieclip (avatar).
2. Then, when the hittest is positive (you are hitting a plant), use the variables to jump back to the last position you were in that wasn't hitting.
This should definitely work to keep you from getting stuck. The way you have it now the avatar can't move because the hittest imobilizes it, and the next frame you're still hitting. The method I have above doesn't imobilize your avatar, just sends it back to last previous "safe' position.
Not really a Smartfox question, but hope it helps.
Carl Lydon
Illustrator, animator, programmer
----------------------------------------
www.gametrust.com
www.chamberofchat.com
Illustrator, animator, programmer
----------------------------------------
www.gametrust.com
www.chamberofchat.com
Return to “SmartFoxServer 1.x Discussions and Help”
Who is online
Users browsing this forum: No registered users and 58 guests