Difference between revisions of "Simple Platform"
(→New Tiled Map) |
(→Create Map) |
||
Line 16: | Line 16: | ||
[[File:New tileset.gif]] | [[File:New tileset.gif]] | ||
+ | |||
+ | In creating this tutorial i first tried a tileset based upon a collection of images, this seemed fine in Tiled but failed to draw using Square.Tiled. So make sure you choose embed and based on tileset image: | ||
+ | |||
+ | ===Draw Your Level=== | ||
+ | Now you have a tile set build a simple set of platforms. You should rename the layer to something like Tiles: | ||
+ | |||
+ | [[File:Plat simple map.gif]] | ||
+ | |||
+ | ===Add Player Object=== | ||
+ | Now you have a section of platforms, we can now set the position of the player. This will also be the object moved by the code and player input. So insert an object layer, and then use the rectangle tool to create the object: | ||
+ | |||
+ | [[File:Plat player object.gif]] |
Revision as of 15:06, 25 November 2017
This will show you how to create a platform game using a tiled map, and tile based collision detection.
Create Map
New Tiled Map
You will need a new tiled map, the tile size in the screen shot is 128 pixels, in the end i actually changed this to 32 x 32 and resized the tiles accordingly:
It is important to change the format of the map to Base64 gzip compressed:
File:Plat tile layer format.gif
Add Tile Set
Now your map is created we need to add a tile set:
In creating this tutorial i first tried a tileset based upon a collection of images, this seemed fine in Tiled but failed to draw using Square.Tiled. So make sure you choose embed and based on tileset image:
Draw Your Level
Now you have a tile set build a simple set of platforms. You should rename the layer to something like Tiles:
Add Player Object
Now you have a section of platforms, we can now set the position of the player. This will also be the object moved by the code and player input. So insert an object layer, and then use the rectangle tool to create the object: