Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


map printing, map to screen

This topic is 6011 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

i have a couple of tricky questions for you guys. lets say i have a 50x50 map, i print this normally, (in html, so i use a table) the map works fine. now lets make a diamond shaped map from this. we rotate the map 45 degrees zo that i stand on one of its corners. now lets say, 0-0 sits on top and 50-50 is on the bottom. i use a browser so i won''t need to handle scrolling, i just need the coordinates on which to print the layers containing the image , this coordinate will be in the top left corner on each layer. i also have to handle even and uneven rows. i allready contacted my math teacher and a couple of other people, but my script just doesn''t work. does anyone know any good algorithems to deal with this? i can''t post my sollution which is not working anyway coz im at work right now.

Share this post

Link to post
Share on other sites
dudes? please i am really fed up with this problem, maybe im just pain stupid but i just don't see it.

anyway here my code for now.

its php but that wouldn't matter right?

// width of each image
// height of each image
// the difference that couses isometry to apear in height
// the difference that couses isometry to apear in width

function getlocation($coords){
global $width, $height,$isometricheight,$isometricwidth,$rows,$cols;


$subarray=explode("-", $coords);
// make sure we explode the coords into to seperate peices x and y

// get the y coordinates by calculations.
settype($subarray[0], "integer");
settype($subarray[1], "integer");
echo" $subarray[0]
if ($subarray[0] % 2 == 1) {
// this interger is uneven
} else {

// get the x coordinates by calculations.
if ($subarray[1] % 2 == 1) {
// this interger is uneven
} else {

echo"<div id=\"";
echo $coords;
echo"\" nonostyle=\"position:absolute; left=";
echo $x;
echo"px; top=";
echo $y;


// dbase connecten
// and get 2500 cells, with these thingy's (50-2) etc
function dbconnect() {
mysql_pconnect("localhost", "*****", "*****" );
mysql_select_db("******") or die ("Unable to select database");


$result=mysql_query("select * from webgame");
while(list($id, $bgr, $inh, $p1, $p2, $p3, $p4, $game, $owner)=mysql_fetch_array($result)){


Edited by - killercow on February 2, 2002 4:28:15 PM

Share this post

Link to post
Share on other sites
You should''nt really rotate 45 degrees (90 degrees maybe), it completely distorts perspective (tile shape), as well as other things (such as which tiles are walkable and which aren''t).

I don''t understand what your problem is though - does the image come out wrong or what?

sorry -

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!