Jump to content


Clicking on a map


1 reply to this topic

#1 ExtraProgrammer

    New Member

  • Members
  • Pip
  • 9 posts

Posted 24 May 2006 - 04:40 AM

Hi all,

I am thinking of doing something like a RISK-clone (just for fun), and is having a bit of problem handling how a map can be built. Ideally, the map shall be easy to build (preferably just drawing it in Paint or Photoshop), but how do I associate data or an unique id to each terrority?

I understand that the usual way is to use polygons, but that complicates the map-making process (and I sucks at the maths required, though I sure there's already-done solution somewhere). The other way is to chop each terrority into individual sprites, which is just as daunting.

Are there any other ideas? I was thinking of having a 'colour map' in memory, and use that map to look up each mouse click. For instance, China would be green, Mongalia another shade of green. With 16 millions colour, I can have an unique colour for each terrrority. Had anyone tried this before?

#2 juhnu

    Valued Member

  • Members
  • PipPipPip
  • 292 posts

Posted 24 May 2006 - 05:37 AM

Yeah you could use assign each pixel a certain value. Works well and you could encode additional information for pixels, too. For a simple project like this, I would definitely go with a one single bitmap.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users