on smartfox join room set avatar to x and y position

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

Moderators: Lapo, Bax

Post Reply
09op
Posts: 86
Joined: 12 Jun 2009, 06:16

on smartfox join room set avatar to x and y position

Post by 09op »

hi is this posible if i join a room i am set to a position because i am using a hit test code to join rooms and if the players hit one triger the go to a differint room so is it possible to do this?
09op
Posts: 86
Joined: 12 Jun 2009, 06:16

Post by 09op »

any one?
ParkerJ
Posts: 30
Joined: 31 Aug 2009, 23:14

Rather ..

Post by ParkerJ »

Rather than giving you the code it would be way simpler to explain. As if I gave you the code you wouldn't learn...

So..

First off the platform is where users are attached... So...
If you make a movieclip and add a hit test like so;

Code: Select all

if(this.hitTest(...)){
x = new x;
y = new y;
_root.platform._x = _root.platform._x + (GAME WIDTH);
smartfox.setUserVariables({playerx: X, playery: Y, slide:"no"})
}
This will move the platform and the player over :) So the other players will be off the screen and you can't see them. They would still be in the same rooom but you can;t see them... Now there is a problem with the easing action if you use that... But everywhere else you set the player x and y... you need to set slide to "yes".

This will become clear now;
Now that you have done so.
You need to modify the easing in the on User Vars Update and on mouse press.

and around the easing
put if(slide == yes){

}else{
playerx._x = px;
playery._y = py;
}

there should work.

But remeber half the codes are wrong... We don;t want you ripping my codes :D

~Parker
Post Reply