View Single Post
  #4  
Old 12-29-2012, 05:01 PM
mewtoo18 mewtoo18 is offline
Registered User
Join Date: Sep 2003
Location: Southbend IN
Posts: 41
mewtoo18 is on a distinguished road
I am asumming you are trying to figure out where the tile is on the tileset.. like how many tiles to the left and down to find the tile you see in the level.. It would take be a bit to explain but if you understand php maybe you can cut out what you need from this:

http://pastebin.com/f74418c73

But to try and explain it simply.

PHP Code:
  $base64 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
  
$temp $test[$k][$i]; // your tile number
  
$tile dechex(strpos($base64,$temp[0])*64+strpos($base64,$temp[1])); // the hex value for tile
  
$tilex hexdec(substr($tile0, -1)) % 32;
  
$tiley floor(hexdec(substr($tile0, -1))/32)*16 hexdec(substr($tile, -1)); 
But I think I may have had my x and y backwards.. either way it should give you the positions.. this is kinda old.. wish I could find the post that explained it on the the forums..
Reply With Quote