You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The maps available in TOSIOS have all been created thanks to [Tiled Map Editor](https://www.mapeditor.org/) (TME). You must first download this software in order to start creating your own map. I also invite you to read some tutorial for an easier beginning.
108
+
109
+
The most important concepts to create a functional map are `layers` and `tilesets` (I invite you to open one of the existing map in TME to familiarize yourself with how maps are structured. It will make things 10x easier if you have a living example under your eyes).
110
+
111
+
**Layers**
112
+
113
+
A `layer` is where your tiles are placed to form a map. You can combine multiple `layers` on top of each other so that you can get a crate over a ground tile, or a spider web over a wall for example.
114
+
115
+
There are two reserved layers that should be present at all time (although not rendered):
116
+
117
+
*`collisions`: for the client and server to know where the player can move or not (ex: walls or pits), or shoot through (ex: pits or small rocks).
118
+
*`spawners`: for the server to determine the starting position of a player.
119
+
120
+
Other than that, you can add as many `layers` as you want and they will be rendered by `PIXI.js` in a WYSIWYG manner (order is maintained).
121
+
122
+
Although in the `dungeon.png` spritesheet I use colored tiles to represent `collisions` (light red and light blue) and spawners (deep red), you can use any tile you want as it won't be rendered anyway.
123
+
124
+
<imgsrc="images/tme-layers.png"alt="drawing"/>
125
+
126
+
**Tilesets**
127
+
128
+
The `tilesets` is where lie the splitted spritesheet and its collision, animated and spawner tiles.
129
+
130
+
When defining which tile will be used for collisions it is very important to set its `type` field to either:
131
+
132
+
*`half`: a `player` CAN'T go through, but a `bullet` CAN go through.
133
+
*`full`: a `player` CAN'T go through, and a `bullet` CAN'T go through.
134
+
135
+
This can be done by selecting a tile in the tilesets editor, and entering its `type` on the left pane.
136
+
137
+
<imgsrc="images/tme-tilesets.png"alt="The collision tile (red) is selected"/>
138
+
139
+
#### How to add my map to the game?
140
+
141
+
If you want to add your map to the game:
142
+
143
+
1. If you have a custom spritesheet image, add it in `/packages/client/src/images/maps/custom.png`
144
+
2. Open `/packages/client/src/images/maps/index.ts`, and add the following statements:
145
+
```typescript
146
+
importgiganticfrom'./gigantic.png';
147
+
importcustomfrom'./custom.png'; // <- Add this line
0 commit comments