Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

how to convert the position ?

Newbie Spellweaver
Joined
Jan 23, 2012
Messages
65
Reaction score
2
how to convert the position in coordinate X , Y ??

Exemple Position 1310775 = X? Y?
 
Experienced Elementalist
Joined
Feb 16, 2012
Messages
234
Reaction score
96
Code:
	function decode_pos($pos) {
		$position = array();
		$position['X']  = ($pos >> 16);
		$position['Y']  = $pos ^ ($position['X'] << 16);
		return $position;
	}
Code:
	function encode_pos($X, $Y) {
		return ($X << 16) | $Y;
	}

for other functions u can check this php class
 
Last edited:
Upvote 0
Back
Top