Discord
Login
Community
DARK THEME

Areas in Maps

Maps should have invisible Areas which you can define in the map editor by clicking, dragging and releasing the mouse. They should be available in the map itself and should be can-be-checked with a collide function.

For that feature, the map editor should have a new layer where you can define the areas. Areas should be visible in map editor but not in game.

Areas should have the following properties: x1,y1, x2,y2 - area, respecting the map size on the game view or...something. name - the name of that area, will be displayed in the rect of the map on the map editor. type - type of the area for better programming. e.g. "block", "snow", "map change" target - a string defining the target of this area, e.g. a map name or an object index.

Programmer should have freedom using type and target. name can be same on different areas. When you get the area by name, it gets ALL the areas with the same name (on the same map).

Map functions (suggestions): maps[mymap].getAreas() maps[mymap].getCollideAreas(targetx, targety) maps[mymap].getAreasByName(name) maps.getAreasByName(name) maps.getCollideAreas(mapname, x, y)

Hope this will be implemented because it's very hard to make a real game by writing all the colliding areas by hand in text. Only the graphical maps is a little to less for a "big" game like microVerse, where I am sitting at right now.

Thanks for your consideration.

and area.isActive for turning on and off the areas, should be respected in the collide function.

There is a trick for that I hope it will help until this function became reality;

First make two sprites size of tile containing x and o for symbols; note you can make even more for more types.
Then make a map on top of your nice map we will call that map collision map and put symbols on that. Draw it on top of your map and handle collision based on types;
Test it; when you are satisfied remove symbols from sprites making them transparent.

Thanks, I did that. Map collision is now based on a collision map, which is not drawn. So I can make whatever tiles I want, they are not shown either. (But you can press CTRL in debug mode and then its drawn)

I draw now 3 maps, just to mention for your projects: "ground" and "overground" are under the players and "top" is over the players for hiding them behind houses or stuff.

Maybe there will be another map drawed over all and moved a little for half transparent clouds or fog. Or a big sprite, Idk.

Post a reply

Progress

Status

Preview
Cancel
Post
Validate your e-mail address to participate in the community