Dynamic minimap, please help me fix it

From the Asset Store
Two types of minimap: "full map" and "player is the center" (square map and radial map)
  • Hi guys,

    So I have been trying to make a minimap using the tutorial from here: https://www.scirra.com/tutorials/834/basic-mini-map

    Unlike the tutorial, I want a part of the whole map not everything. I managed to get the minimap working, and got on the minimap what I had on screen. However it's kind of pointless to have a minimap if you see the same things you've alreday have on screen.

    So instead, I wanted to see twice the area I had on screen in the minimap so it's more interesting and that's why I ran into trouble.

    Everything works fine when the minimap size has the same ratio as the container it gets into:

    • resolution: 1080 x 720
    • container: 180 x 120
    • ratio = 1080 / 180 or 720 / 120 = 6
    • minimapsize = 5136 / 6 = 856 px

    t = 6

    scrollx = 540px

    scrolly = 360px

    Formula used: IslandMinimap.CoordX-scrollx/t+WindowWidth/2/t

    However when I try to see twice the amount on the minimap by reducing its size to 428 px (856/2), then it still works but the minimap does no longer fit the container though I thought by slowing down the scrolling it would work.

    Obviously I'm not really good at math, so any help would be greatly appreciated. I have attached a file containing both the working version and the non working version I'd like to get fixed.

    Thanks for your help!

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • This is torturing me, I'm losing sleep over this! <img src="{SMILIES_PATH}/icon_e_biggrin.gif" alt=":D" title="Very Happy">

    You can test the working version here by the way: http://konnee.free.fr/Minimap/

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)