hey mates,
am looking for a way to display a map grid, X,Y axis.
each block on the map is going to represent a town on the map, player can travel between those town, the further the distance the more time needed to reach your destination.
anyone have already built a similar script? any ideas on how to do it ?
map grid
map grid
another game development website
www.gamedevforums.org
www.gamedevforums.org
- Jackolantern
- Posts: 10891
- Joined: Wed Jul 01, 2009 11:00 pm
Re: map grid
Are you wanting to make an "image map", where you can define different links within an image, some of which can have odd shapes, or do you just want to have a simple grid, where every part of the map will link to somewhere, each shape is square, and all mostly the same size? If you want the former (not all parts of the map are a link, many links in the image, links can be various shapes), then you want to make an image map, which can be done by hand but can be done much more easily using a program specific to it due to all of the x and y coordinates, polygon definitions, etc. There are some good free program out there that can do it if you Google it.
If you want the latter, where you basically just lay a grid over your map and each cell is a link, you could either do just that, and lay a table over it, make the borders invisible, and make each cell a link. It could also be done with some Javascript, where you intercept each click on the map in a JS event, get the location of the click and then do some easy (if repetitive) calculations and the location attribute to manually forward them to the new page. And there is also the old way of doing it that I don't suggest, which would be to actually cut up your map into squares matching the size of a table and insert each piece into each cell.
If you want the latter, where you basically just lay a grid over your map and each cell is a link, you could either do just that, and lay a table over it, make the borders invisible, and make each cell a link. It could also be done with some Javascript, where you intercept each click on the map in a JS event, get the location of the click and then do some easy (if repetitive) calculations and the location attribute to manually forward them to the new page. And there is also the old way of doing it that I don't suggest, which would be to actually cut up your map into squares matching the size of a table and insert each piece into each cell.
The indelible lord of tl;dr