Torque 2D/GenreTutorials/PlatformerTileMaps
From TDN
|
[edit] Introduction
[edit] Create a new Project
[edit] Introduction to Tile MapsFirst of all, you should read this article to get an introduction to how TGB’s tile map builder works. That will tell you how to do everything in the tile builder. My purpose here is to help you figure out what to do with it. There are three steps to getting a level from a design or idea into a game. First you have to create image maps, then actually build the level, and finally load them into the game. But before we get into that, you should have a little background on the purpose of tile maps. The main reason we use them instead of just random images is to save memory.
[edit] Drawing and Designing LevelsBefore you even open the tile builder, you should have a pretty good idea of what it is you are planning on creating. For the purpose of this tutorial, you probably just want to get something loaded into the game so you can continue to all of the good stuff. But, when you come back later to make real levels, it is important to design before you build.
|
|
[edit] Making Your Own Tile SetMaking images for tiles is very similar to making textures for buildings or terrain in a 3D game. You need to make sure that each image tiles well with any image it may be next to. What this means is, when you place the images next to each other, you can’t tell where one ends and the other starts. It is also important that each individual image has no remarkable features. The reason is that when you have a bunch of them tiled next to each other, any specific features will stand out. For more information on how to accomplish this, read these tutorials: Making a Seamless Texture and Advanced Seamless Textures
|
|
[edit] Building a Level with the Tile EditorOnce you have a set of tiles created, we need to load that into the level builder. Open up the level builder and in the Create Tab, click on the "Create a new ImageMap" button. Find the Tilemap.png file you saved to your images folder. In the image builder change the image mode to cell and the cell width to 128. Your image should now be correctly tiled as seen in the figure below: |
| Brush # | Brush Name | Flip X | Flip Y | Collision Active | Collision Polgon Count | Collision Polygon Definition |
|---|---|---|---|---|---|---|
| 1 | crate | no | no | yes | default | default |
| 2 | sky | no | no | no | default | default |
| 3 | ramp45 | no | no | yes | 3 | 1 -1 1 1 -1 1 |
| 4 | ramp-45 | yes | no | yes | 3 | 1 1 -1 1 -1 -1 |
| 5 | lavaTop | no | no | no | default | default |
| 6 | ramp30 | no | no | yes | 3 | 1 0 1 1 -1 1 |
| 7 | ramp-30 | yes | no | yes | 3 | 1 1 -1 1 -1 0 |
| 8 | ramp60 | no | no | yes | 4 | -1 0 1 -1 1 1 -1 1 |
| 9 | ramp-60 | yes | no | yes | 4 | 1 0 1 1 -1 1 -1 -1 |
| 10 | platform | no | no | yes | default | default |
| 11 | emptyPlatform | no | no | no | default | default |
| 12 | lava | no | no | no | default | default |
|
The brushes are created using the images from the image library from left to right and top to bottom. ramp45 and ramp-45 use the same tile image for their brush, as do ramp30 and ramp-30, and ramp60 and ramp-60.
[edit] Using the Tile Layer in the Level BuilderExit the Tile Map Builder and you should now see your saved tile layer in the Create Tab under Tile Maps. Drag it into the scene view. Depending on how large you made your tile layer, most of what you painted down in the Tile Map Builder might be up in the far left corner of the complete tile layer. Zoom out a bit in case you are having trouble seeing the layer. |
Categories: T2D | TGB | Platformer | Tutorial









