Character Walk Change

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

Moderators: Lapo, Bax

Post Reply
mrnothersan
Posts: 226
Joined: 24 Jan 2010, 18:38

Character Walk Change

Post by mrnothersan »

When the character walks, how can I get it to change direction that it is facing?

Also, how can I add music to my virtual game?

~mrnothersan
mrnothersan
Posts: 226
Joined: 24 Jan 2010, 18:38

Post by mrnothersan »

Anyone?
EmpireGames
Posts: 28
Joined: 09 Feb 2009, 18:42

Post by EmpireGames »

those topics are prob. more client related then SmartFox (Server) related. If your using a game engine for the client then it would prob. be better to ask those questions on the Game Engine's forums.
mrnothersan
Posts: 226
Joined: 24 Jan 2010, 18:38

Post by mrnothersan »

EmpireGames wrote:those topics are prob. more client related then SmartFox (Server) related. If your using a game engine for the client then it would prob. be better to ask those questions on the Game Engine's forums.
Im using SmartFoxServer and flash...
EmpireGames
Posts: 28
Joined: 09 Feb 2009, 18:42

Post by EmpireGames »

mrnothersan wrote:
EmpireGames wrote:those topics are prob. more client related then SmartFox (Server) related. If your using a game engine for the client then it would prob. be better to ask those questions on the Game Engine's forums.
Im using SmartFoxServer and flash...
Then I would ask on the forums for Flash if they have any which I am sure they do.
mrnothersan
Posts: 226
Joined: 24 Jan 2010, 18:38

Post by mrnothersan »

I would have thought them to be SmartFox related because it is about moving a character in Flash but using the SmartFoxServer files...
TreeTree
Posts: 12
Joined: 28 May 2010, 00:22

Post by TreeTree »

If you want the character to face left when he moves left, you just set the rotation of the character to face that angle. I don't think this has anything to do with SmartFox. :?
mrnothersan
Posts: 226
Joined: 24 Jan 2010, 18:38

Post by mrnothersan »

TreeTree wrote:If you want the character to face left when he moves left, you just set the rotation of the character to face that angle. I don't think this has anything to do with SmartFox. :?
how?
tgate
Posts: 3
Joined: 05 Jul 2010, 18:30

Post by tgate »

their are several flash examples included with smartfox and in the documentation.

as far as the basic fundamentals of flash coding, google tutorials on flash.
Mike
Posts: 11
Joined: 01 Jun 2010, 21:08
Contact:

Re: Character Walk Change

Post by Mike »

mrnothersan wrote: Also, how can I add music to my virtual game?

~mrnothersan
You can add music to the game by putting it outside of where the character walks (for example in the avatar chat example) this would do it for every room. If you add music to the room you can have it so each room has different music. I'm not sure if the music would stop if you left the room or you would have to put a script when the client leaves the room. I'm not sure 100%, but I'm almost positive that would work.
Flappi282
Posts: 158
Joined: 20 May 2009, 17:51
Contact:

Post by Flappi282 »

You can use this code:

Code: Select all

var angle=Math.atan2((-y2),(x1-x2))
if (angle<0) {
angle +=3
}
angle=angle*(180/Math.PI)
//Now you can use some other code to get what frame to turn to
--
Flappi282
mrnothersan
Posts: 226
Joined: 24 Jan 2010, 18:38

Post by mrnothersan »

Thanks Flappi282
Post Reply