Tiled, Diddy, Grabbing Player Start Position?

Monkey Forums/Monkey Programming/Tiled, Diddy, Grabbing Player Start Position?

Amon(Posted 2013) [#1]
Ok, when I make my TileMap in Tiled what do I do to add a Player Start position and how do I grab that position in MonkeyCode?

I've implemented my GetX() | GetY() functions but I'm at a loss on how I set it up to grab the player positions or even how I would sort that in Tiled.

It's 3am here in freezing cold London so soz if my post is a bit badly worded.


therevills(Posted 2013) [#2]
Have a look at the platformer example code.

Something like this:
Local reader:MyTiledTileMapReader = New MyTiledTileMapReader
Local tm:TileMap = reader.LoadMap("levels/level1.tmx")
tilemap = MyTileMap(tm)
Local playerStart:TileMapObject = tilemap.FindObjectByName("playerStart")
player = New Player(game.images.Find("gripe.stand_right"), playerStart.x, playerStart.y)



Amon(Posted 2013) [#3]
Hi! Where are playerStart.x/y defined in Tiled? When in Object Mode in Tiled how do I define those start positions?


Samah(Posted 2013) [#4]
Tiled maps don't have the concept of "player start locations". You need to tell the renderer where to start rendering.

You can however use a Tiled object on an object layer and call it something like "player", then read/update the coordinates from that to use for rendering.


Amon(Posted 2013) [#5]
Thanks guys! Got it working nice!