Need Help!! Please Help ME!!!

Need help with SmartFoxServer? You didn't find an answer in our documentation? Please, post your questions here!

Moderators: Lapo, Bax

Posts: 16
Joined: 13 Dec 2006, 03:00

Need Help!! Please Help ME!!!

Postby rene » 15 Jan 2007, 14:21

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 so that my character start, move and end at constant speed instead of easin in and out?
User avatar
Posts: 18
Joined: 13 Dec 2006, 20:52
Location: Chile

Postby Dr_Malito » 15 Jan 2007, 14:42

that's not so easy, but I think you need to make the avatar "bounce" 2 or 3 pixels when the hittest is detected.
User avatar
Posts: 36
Joined: 22 Dec 2006, 20:40
Location: New York

Postby Carl » 15 Jan 2007, 23:41

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.
Carl Lydon
Illustrator, animator, programmer
Posts: 16
Joined: 13 Dec 2006, 03:00

Postby rene » 17 Jan 2007, 06:46

Thank for replying :D

Return to “SmartFoxServer 1.x Discussions and Help”

Who is online

Users browsing this forum: No registered users and 29 guests