Step 1: Create some tiles
- Launch SternTiles, make a new file and pick a tile size for your project.
- Create some tiles! You can always come back and edit them or add more.
- Save your file and add (copy) it to your project folder.
Step 2: Design the tile map
- Open up Tiled and create a new document. Pick how many tiles should show up in your map (getting over 100 x 100 would be pushing it...) and the size of the tiles you chose in SternTiles.
- Go to the Map menu and select "New Tileset..." Click on the "Browse" button and navigate to the copy of the tilesheet file you made in SternTiles that lives in your project's "Resources" folder.
- Start drawing away!
- To create a starting point for your character:
- Go to the Layer menu and choose "New Object Layer." Name this layer "Objects," or something like that - don't forget what it is.
- Draw a small box on the screen in this layer - the lower left corner will be the starting location for your player.
- Right-click (control-click) on the box and select "object properties" for the name, type in "playerStart" or something like that.
- (Note: you can also use this to place other objects in the world, such as keys, coins, monster spawn points, etc. Just make sure that each of these objects has a unique name.)
- To manage collisions, you can create another layer for obstacles.
- Go to the Layer menu and create a new Tile Layer.
- Use another tile (like a solid red tile) to draw on the obstacle layer over all the objects that are "solid" on the background.
- In the tileset, right-click (control-click) on the tile you used and select "Tile Properties." Add a new key/value pair that says "solid"|"True."
- (Ideas: You can also repeat this process if you want to have areas that slow the player down or have other features (like traps!) associated with certain squares on the grid)
- Save your file - you can always come back and make changes!
Next up.... Getting your Tiles into your XCode program!
No comments:
Post a Comment