Page 1 of 1
Character Walk Change
Posted: 11 Jul 2010, 13:12
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
Posted: 12 Jul 2010, 06:44
by mrnothersan
Anyone?
Posted: 12 Jul 2010, 06:55
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.
Posted: 12 Jul 2010, 07:16
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...
Posted: 12 Jul 2010, 08:05
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.
Posted: 12 Jul 2010, 08:23
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...
Posted: 12 Jul 2010, 16:23
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.

Posted: 12 Jul 2010, 17:15
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?
Posted: 12 Jul 2010, 20:33
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.
Re: Character Walk Change
Posted: 12 Jul 2010, 22:45
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.
Posted: 15 Jul 2010, 16:46
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
Posted: 15 Jul 2010, 17:11
by mrnothersan
Thanks Flappi282