{"author_name":"TMKCodes","cat":"LD #30","comments":[{"author_name":"","time":"August 23, 2014 8:50 am","epoch":1408801800,"text":"xposition = (mapX * mapWidth) + tileX<br \/>\n yposition = (mapY * mapHeight) + tileY","spam":"N"},{"author_name":"","time":"August 23, 2014 8:59 am","epoch":1408802340,"text":"You want the screen position of each tile? You&#8217;ll also need to know which map you&#8217;re currently showing (mapx, mapy)","spam":"N"},{"author_name":"","time":"August 23, 2014 9:21 am","epoch":1408803660,"text":"Winterblood! Awsome thanks!","spam":"N"}],"epoch":1408801140,"likes":0,"metadata":{"p_key":"27918","p_author":"TMKCodes","p_authorkey":"35377","p_urlkey":"63365","p_title":"I have a math problem","p_cat":"LD #30","p_event":"LD30","p_time":"1408801140","p_likes":"0","p_comments":"4","p_status":"UPD5","us_key":"35377","us_name":"TMKCodes","us_username":"tmkcodes","event_start":"1408665600","event_key":"24","event_name":"LD30"},"text":"<p>I want to build tiled world wich has maps and those maps have tiles. I have hard time calculating the tile window positions from the world height, width and map x,y and map height, width and tile x,y and tile height, width.<\/p>\n <p><a href=\"http:\/\/www.ludumdare.com\/compo\/wp-content\/uploads\/2014\/08\/math-problem.png\"><img class=\"alignnone  wp-image-377406\" src=\"http:\/\/www.ludumdare.com\/compo\/wp-content\/uploads\/2014\/08\/math-problem-300x225.png\" alt=\"math-problem\" width=\"444\" height=\"287\" \/><\/a><\/p>\n <p>I have tried quite few things to calculate tile x to window coordinates.<\/p>\n <p>I know that I can calculate one map by doing<\/p>\n <p>xposition = tileX * tileWidth &#8211; tileWidth;<br \/>\n yposition = tileX * tileWidth &#8211; tileWidth;<\/p>\n <p>I can not get it right when calculating with world. Any help?<\/p>","time":"August 23rd, 2014 8:39 am","title":"I have a math problem"}