MODDING: The Tilemap Editor
Room resources can be opened, created and edited directly from within Deathtroid. Just start a game and I'll step you through the different modes and settings.
Note that everything is available from the "Editor" menu, so just check that menu out if this post is tl;dr. You can save the changes you've done to a room by selecting the game window and typing ⌘S. There is experimental undo and redo support with ⌘Z and ⌘⇧Z.
Editing properties of the room itself
When you press ⌘T, you will enter the Tilemap editor. In addition, the game will automatically press ⌘I, revealing Tilemap Properties for the selected room and layer.
Each row in the table represents a layer. You create separate layers to control their settings separately, or because they use different tilesets. When you play the game, these layers will be composed, as so:
You can switch to a specific layer by clicking on its row, or just pressing the corresponding number key. You can toggle visibility of a layer (for debugging purposes) with ⌘1..9. The first layer that has "fg" checked (and all layers below it) will be the "foreground" layer, and be shown *in front* of Samus. Rep X and Y decides whether that layer repeats horizontally or vertically (if it is smaller than the other layers). Depth says how fast that layer should scroll relative to Samus: you can set a value other than 1 to get parallax scrolling. Finally, tileset lets you choose different tilesets. In the above example, there are two layers for the foreground and background of a Norfair room, while the third layer contains the door, which is part of the tileset 'doorsAndProps', which any room can use.
You can create and remove layers with the + and - buttons, and rearrange them depth-wise with the up and down buttons.
Finally, you can change the size of a layer. One screen-full is 16 tiles wide and 12 tiles high.
Editing tilemaps
With the layer that you wish to edit selected, you can "draw" tiles by clicking and dragging inside the game window. By default, you have the eraser selected. By holding down your right mouse button, you will reveal the tileset for the current layer, with the tile under the cursor selected by default. In the below screenshot, I right-clicked on the bottom-right tile of the teleporter, revealing the tileset for the save room with the teleporter platform selected. If I now release the right mouse button, my left mouse button will now draw teleporter platforms.
Note however that I selected the left half of a teleporter roof, not a floor. When I draw this tile, I can correct how the tile is drawn by flipping it both horizontally and vertically (making it a right half of a teleporter floor) by pressing U and then I with the mouse cursor over that tile. You can also rotate the tile 90° by pressing O.
Editing collision maps
In addition to the three layers rooms traditionally have, there is a special layer called the collision layer or collision map. You can display it by pressing ⌘D (Debug).
You then select it for editing by pressing '0' (numeric zero). You can then edit it just like any tilemap (although you should not use attributes (U, I, O), but should rather use the correct tile). Square tiles collide as expected. Currently only the 45° slopes work as expected, and the 22° slopes might work sometimes.
Editing entities
You can edit which entities should spawn in a room by switching to the Entity Editor with ⌘E. That will be the topic of a future article.
Opening and creating rooms, and connecting them
You can create a new room from File > New Room (⌘N). You can store it anywhere in your resources folder.
In the future, there will be a "level" resource, which is a collection of rooms, and the connections between them, together creating a single level, like a deathmatch stage or a clone of a specific Metroid game. For now, rooms are just loose, manually connected resources, and you need to manually create Door entities to connect different rooms. That will be covered in the Entitiy editing article.
You can also Open rooms (⌘O), which will teleport you to that room.












