I have looked and looked at the sewer code and desert code (No comments in that code still. When will we see commented code in the samples?) and cannot figure out what is happening.
How do you use a file from TilEd simply. For example lets say you did a line of tiles in TilEd that will be a platform game how do I then use that TileEd file to draw that platform to screen.
Cheers
Mike
Comments
Mike
http://www.sharksoupstudios.com
Cheers
Mike
Likes: WauloK, Harrison
http://www.sharksoupstudios.com
Tile map file format is a little bit complicated. Because it can contain multiple tilesets and multiple layers. But if there is only 1 tileset and 1 layer, loading function can be simplified. Here is an explanation of TMX file format: https://github.com/bjorn/tiled/wiki/TMX-Map-Format The exported lua file has the same structure.
I've separated the tile map loading functionality into classes. The attached zip file contains two classes: TileMapSingle and TileMapMultiple. TileMapSingle can be used when there is only 1 tileset and 1 layer. Otherwise you should use TileMapMultiple.
Hope this helps.
Likes: Yan, MoKaLux
Cheers
evs
Likes: atilim
Cheers
Gary
Grab the ball and chuck it about, see the various collisions and scores printed out, set the debug flag in the code to see debug drawing and object info.
Thanks go to @atilim for the initial tile stuff and Gideros collision example
and to @ar2rsawseen for the main physics stuff and appcodingeasy.
All files including a gproj and the Tiled tmx are included.
cheers
evs
Likes: Garyk1968
cheers
evs
Likes: MoKaLux
very handy classes.
I'm a little confused by the these two lines.
It's OK since the margin is much smaller than tilewidth in most tileset.
https://sites.google.com/site/xraystudiogame
And in this function
why we do not mask bit 32, 31 and 30 of gid when find out the tileset according to this document:
When you use the tile flipping feature added in Tiled Qt 0.7.0, the highest two bits of the gid store the flipped state. Bit 32 is used for storing whether the tile is horizontally flipped and bit 31 is used for the vertically flipped tiles. And since Tiled Qt 0.8.0, bit 30 means whether the tile is flipped (anti) diagonally, enabling tile rotation. These bits have to be read and cleared before you can find out which tileset a tile belongs to.
https://sites.google.com/site/xraystudiogame
https://sites.google.com/site/xraystudiogame
When I try to implement the TileMapMultiple I get the following error
tileMapMultiple.lua:32: 'for' limit must be a number
which is this line of code:
for y=1,layer.height do
Any ideas? My tilemap has two layers, and one tileset.
Thanks for your help
James
Website: http://www.castlegateinteractive.com
https://play.google.com/store/apps/developer?id=Castlegate+Interactive
Cheers
James
Thanks
Website: http://www.castlegateinteractive.com
https://play.google.com/store/apps/developer?id=Castlegate+Interactive
i dont think we need bit plugin to run tilemap are you using any third party tool or i am missing something?
Likes: hgvyas123
Are there any performance benefits from using Gideros' TileMap instead of a custom tile map solution?
And what is a "gid"?
1) I would suggest using Gideros TileMap implementation because it will be much more optimized internally, then simply putting Bitmaps in your own solution
2) I have not used Tiled myself, but as I see from example, in Tiled, if you have multiple tile set images, then they would be indexed together, as if first tiles set contains 16 images, first one would be 1st, last one would be 16th, and the next tile set first tile would start with 17th index.
So gid is a global tile identifier across all provide tile sets, and this function is what finds the correct tile set for specified identifier.
Basically it is something specific to Tiled export.