Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

2D All the way! / Help with Risk-style map?

Author
Message
Karna
14
Years of Service
User Offline
Joined: 22nd Jan 2010
Location: American Left Coast
Posted: 27th Apr 2010 02:12
I am interested in making a strategy game focused on pre-colonial India. But I am at a loss on how to make a clickable interactive map with tiles of different sizes. I want to make each parcle of land able to be re-textured as it is captured. All I know how to do is make rectangular or square tiles that are all the same size.

I would be thankful for any help.
Ashingda 27
16
Years of Service
User Offline
Joined: 15th Feb 2008
Location:
Posted: 27th Apr 2010 14:35
It gets a bit tricky, you'll have to use larger images instead of tiles and find a way to check pixel collision when clicking it. To re-texture your land images you can use Set Sprite Diffuse or use Memblock to modify each pixels.
Coldfire
15
Years of Service
User Offline
Joined: 22nd Oct 2008
Location: Indiana
Posted: 27th Apr 2010 19:47
I would recommend encoding all areas on the same bitmap using different color values to represent the different areas that way you only gotta pick at the one image. That could also possibly help with highlighting different areas aswell. Good luck!
Coldfire
15
Years of Service
User Offline
Joined: 22nd Oct 2008
Location: Indiana
Posted: 27th Apr 2010 20:38 Edited at: 27th Apr 2010 20:40
I went ahead and tossed together an example of the method i was referring too. I didn't comment it but it should be fairly easy to understand.

In this example, I made a 'clickmap' that utilizes only the red channel for storing locations. I've setup 4 areas: a red area, a green area, a blue area and also a background area for everything else.

Heres the code and below is an attached rar with images that you can test it with.


hope it helps!

coldfire

edit: BTW, i saved the clickmap as a png with no compression. I havent tested it but i'd assume that colors may become inaccurate with various compressions.

Attachments

Login to view attachments
Karna
14
Years of Service
User Offline
Joined: 22nd Jan 2010
Location: American Left Coast
Posted: 28th Apr 2010 12:28
Spectacular! Can't wait to try this out! Thank you all for the prompt response.

Login to post a reply

Server time is: 2024-04-25 21:49:07
Your offset time is: 2024-04-25 21:49:07