1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-11-27 14:37:16 +00:00

nilrider:: define layers

This commit is contained in:
Zeno Rogue 2024-08-20 11:05:43 +02:00
parent 74f6937b64
commit ae4520d410
2 changed files with 8 additions and 4 deletions

View File

@ -631,10 +631,10 @@ void load_level(const string& fname) {
}; };
} }
else if(cmd == "LAYER") { else if(cmd == "LAYER") {
auto n = new level(lev); csub = new level(lev);
n->name = param; csub->name = param;
lev.sublevels.push_back(n); lev.sublevels.push_back(csub);
n->map_tiles = {}; csub->map_tiles = {};
} }
} }
if(lev.startx < 0 || lev.starty < 0 || lev.starty >= isize(lev.map_tiles) || lev.startx >= isize(lev.map_tiles[0])) if(lev.startx < 0 || lev.starty < 0 || lev.starty >= isize(lev.map_tiles) || lev.startx >= isize(lev.map_tiles[0]))

View File

@ -60,3 +60,7 @@ FUNCTION exp(-x*x-y*y)
# if you need more layers: enter 'LAYER <name>' then describe the layer, using the same format, except DESC and START are irrelevant. # if you need more layers: enter 'LAYER <name>' then describe the layer, using the same format, except DESC and START are irrelevant.
# MAP is necessary. FUNCTION and BOUNDS will be copied from the main layer if not provided. # MAP is necessary. FUNCTION and BOUNDS will be copied from the main layer if not provided.
LAYER below
MAP F
FUNCTION -1