Thread: Making A Gps
View Single Post
  #2  
Old 09-17-2011, 06:55 AM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
For the nth time, please style your code before posting it in the scripting forums.

If the map is to be 100x100 pixels, and the actual map is 12x12 levels, you can calculate that the map is 768x768 tiles (64 tiles in a row/column per level). is the number of pixels each tile represents on your map horizontally (the same vertically if it's a square).

Then, to figure out where to draw markers,

PHP Code:
function getMarkerPosition(temp.tileXtemp.tileY) {
  return {
    (
100 768) * temp.tileX,
    (
100 768) * temp.tileY
  
};

All you're doing is multiplying the number of pixels each tile represents, , by the number of tiles.
__________________

Last edited by cbk1994; 09-17-2011 at 07:02 AM.. Reason: updating to reflect changes to OP
Reply With Quote