-
Notifications
You must be signed in to change notification settings - Fork 1
WorldSystem explained
Lauri Mäkinen edited this page Aug 12, 2013
·
2 revisions
WorldSystem contains Rooms. They are stored as following:
Room rooms[WORLD_WIDTH][WORLD_HEIGHT][WORLD_DEPTH];
Room contains the tiles:
Tile tiles[ROOM_WIDTH * ROOM_HEIGHT];
One room is one "screen". Like in Nethack.
Example: Player is in room (1,1,1) and moves on the edge of the room on right, player is then on room (2,1,1). And tiledata is queried from that room. If player moves up, the relevant tile data is in room (2,1,2).
For simple nethack has levels by depth. So it has something like:
Room rooms[depth];
ProjectIce currently has rooms to all directions.
(Yes, nethack works differently but its just for this explanation...)