Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

in a previous question asked here:how-to-create-a-hexagon-world-map @Tim Holt has provided code that does the job that i'm wanted to do, the only difference I would like is to have it as squares rather than hex. Is this easy to convert, or is there a better way? thank you.

share|improve this question
It might help to define the question in a more self-contained way, rather than simply making reference to another question. You don't need to exclude the link, but please write your question such that it's not absolutely necessary to read another question. – Vemacitrin Aug 15 '11 at 3:10 want a grid? – Ray Dey Aug 16 '11 at 12:20
up vote 1 down vote accepted

I didn't look too closely, but the code in that answer was heavily involved with hex calculations -- like figuring out where the mouse is pointing on the hex grid. This is trivial if the tile is a square, you wouldn't even need to examine this carefully. The same would be true for most of that code. So I suggest starting from scratch, but using the concepts / code you need from that example if you find yourself stuck.

Start with a 2 dimensional array, each element containing a value for the type of tile it is and which directly maps to actual tile images with a set width defined as a constant somewhere.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.