Sunday 9 March 2014

Minimaps

This weekend was like any other. I spent it doing some programming. Along with fixing a plethora of little bugs in my map editor I decided to create a minimap for it. As you can see here in the picture below, we have a minimap (and a very nice Martian landscape):


To get a minimap to work you have to translate the mini coordinates into big coordinates. That way you can scroll to where the user clicks. The method I used is this:

real_map_coord = mini_map_coord * ( real_map_size / mini_map_size)

Works perfectly. I do this twice; once for X and once for Y.



2 comments:

  1. Do you intend to add a layering system similar to RPG Maker?

    ReplyDelete
    Replies
    1. No, I haven't considered that. But you've given me a very good idea. It'd make a lot of sense to have:

      1. A terrain layer (what I already have).
      2. A units layer (here units and buildings could be placed).

      In fact that solves a problem I was wondering about. Thanks Alycthul!

      Delete