Package | com.smartfoxserver.v2.requests.mmo |
Class | public class SetUserPositionRequest |
Inheritance | SetUserPositionRequest com.smartfoxserver.v2.requests.BaseRequest |
MMORooms represent virtual environments and can host any number of users. Based on their position, the system allows users within a certain range from each other (Area of Interest, or AoI) to interact. This request allows the current user to update his position inside the MMORoom, which in turn will trigger a SFSEvent.PROXIMITY_LIST_UPDATE event for all users that fall within his AoI.
See also
Method | Defined By | ||
---|---|---|---|
Creates a new SetUserPositionRequest instance. | SetUserPositionRequest |
SetUserPositionRequest | () | Constructor |
public function SetUserPositionRequest(pos:Vec3D, theRoom:Room = null)
Creates a new SetUserPositionRequest instance. The instance must be passed to the SmartFox.send() method for the request to be performed.
Parameterspos:Vec3D — The user position.
| |
theRoom:Room (default = null ) — The MMORoom object corresponding to the Room where the position should be set; if null , the last Room joined by the user is used.
|
See also
private function updatePlayerPosition(px:int, py:int):void { var newPos:Vec3D = new Vec3D(px, py); sfs.send(new SetUserPositionRequest(newPos)); }