(Solved) How to make an overview map

Discussion in 'Programming' started by Boredaholic, Aug 24, 2019.

  1. Boredaholic

    Boredaholic Member

    Joined:
    Aug 24, 2019
    Posts:
    2
    So i searched and searched on here as well as googled. Not entirely sure how to word this other than below.

    Creating a game, need something as basic as press "m" for map and then having the map pop up with a location of where the player object is on said map. Map doesn't need any extra functions other than to open, have the ability to scroll around on it to view the map and where you are located, then a close function. Obviously there's more to it, but that's essentially what i'm trying to do.

    Any help appreciated, or if there is another topic already on this that i couldn't find by all means direct me there and i'll go read all about it.

    *Edit* Doesn't need to pause the game (not intended for the purpose of gameplay) and i'm sure it has to do with just setting up a menu like the inventory menus, but i'm not entirely sure how to set it up to show the exact location of the player object on the overview
     
  2. van0014

    van0014 Member

    Joined:
    Apr 13, 2017
    Posts:
    10
    You could draw the map overlay over everything else by having it in an object's draw event, and changing the depth. Toggle visibility or drawing code with m changing a variable.

    You then need to scale map coordinates to fit within the overlay coordinates. Then the player position can be found. That's easy enough if all maps are the same size.

    Does this sound overwhelming? I can go into details, but for now just wanted to explain how I'd approach it
     
  3. Boredaholic

    Boredaholic Member

    Joined:
    Aug 24, 2019
    Posts:
    2
    Doesn't sound overwhelming by any means. I understand roughly what you're getting at. Thank you. I've also determined a workaround instead of having exact locations. May just end up making a full sized map that you can scroll around with grid numbers for what grid you're in. then the player has to work out where they are. It's not supposed to be an easy game. Gotta have some challenges where i can. Haven't decided which route to go.

    Thank you for the reply! If i choose to go the first route i may pick your brain some more.
     
  4. SupernaturalCow

    SupernaturalCow Member

    Joined:
    Sep 11, 2016
    Posts:
    142
    You can also create another view for this, but it mirrors your scene and might not be exactly what you want. It's usually good for RTS games and situations where you need a detailed/zoom-able map.
     
  5. van0014

    van0014 Member

    Joined:
    Apr 13, 2017
    Posts:
    10
    Draw_sprite_part and draw_surface_part are awesome for drawing or scaling parts of sprites and drawing areas.
    I've been making a map editor for over 5 years and that's how I draw the scrollable field of view. There's other way to do it, this works for me by preventing lag since it only gets updated as you edit.
    A sprite was necessary to allow room restarts for window resizing without loosing the map, otherwise I'd just use surfaces
     
    Last edited: Sep 12, 2019

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice