Official Fangame Help Topic

I have… but it’s a little long to say how to make one in one post. Especially since there are an infinite number of ways you could go about doing it. I’ll try to set you up with the basics, though. (Assuming your game will use item symbols on the map)

The most convenient way to build the map of your area is just to make a bitmap of the map. Like this one from Zero Mission:
CENSORED (somehow this ZM screenshot turned into porn)
(Yes, the boxes should be that small)

You’ll have to choose a size in pixels for each map box in the room (so one map box might represent maybe 320x240 pixels in each room)

That way, you can add little unique pictures of bosses and ships and whatnot without making separate graphics for them, and you don’t have to input all the coordinates for each box and all that. Draw it out and insert it in your game.

Then, for each room’s creation code (Room → Settings → Creation code), you’ll want to say where that room is located on the map. (So like, “global.room_x = 13; global.room_y = 18;” or something, for the coordinates of the upper-left box of the room on the map)

You’ll also want to make sure the game knows what area you’re in and initializes all the item locations on the map and such, but only when you first enter a room from that area. So, create a “init_area_*” script for each area you have so far (replace * with the number of the area), and call the one corresponding to the room’s area in every room’s creation code. Each script should look something like this:

if (global.area != *) // Replace * with the number of the area {    // Set the map being used to the right image    // Initialize whatever else for your map system    // Like item symbols    // Then end with this:    global.area = *; // Replace * with the number of the area }
This way it’ll only call once for a given area, so it doesn’t spend all the time setting up the area each time a room loads.

Past there, you’ll want global arrays storing:

  • The boxes the user has been in on the map
  • Where each item is and if it’s been collected
  • Any other symbols that may change during the game

And then, you’ll want one object for the mini-map (if you have only one HUD object, which you should, put drawing and calculation for the map in there–otherwise, just use one new object). This will find the map box Samus is in based on the room’s coordinates in the area and her coordinates in the room; set the map box as visited (true) in the global array for that; draw a black square in the upper-right corner of the screen; and then draw from the box up one and left one from Samus’s box to the box down one and right one (nested “for” loops), only the ones you’ve visited, over the black square in the upper-right corner of the screen, putting in each correct symbol for items and whatnot over them.

For drawing the full map, do the same as the mini-map, only draw from the upper-left box to the lower-right box. If there’s too much slowdown going on, draw it on a surface when the map loads and then only draw that surface for each frame.

Yeah, it’s a lot to do and keep track of. Keep in mind that when I knew exactly what I was doing when I made one (well, I didn’t, but I figured out each next step for making it as I made it so it didn’t really matter), it took me a few hours. So… Don’t expect it to be a quick thing. I could just give you a ton of code, but then you’d have to do a lot of adapting to make it work in your game depending on how your game’s main systems work (so I’d probably have to explain how it works anyway), and plus you wouldn’t learn anything from that, would you? :stuck_out_tongue:

Call when you run into a snag or get lost in my monster wall of text. It doesn’t explain or mention quite everything, so…

Oh, and by the way, game-wise, Game Maker can do anything that C++ can, just slower. Never think anything’s impossible. :stuck_out_tongue:

Edit:
http://z3.invisionfree.com/MP2D/index.php?showtopic=1626
Here’s Ed’s example if you want to compare how he does it to how I’d do it. Do whatever’s simpler, or blend them together, or whatever. It looks like he uses surfaces for the map. His way’s probably easier, but it doesn’t include items or other changing symbols on the map, and you may have to change parts of it to match your game’s main systems.