map loader for the tmx file format, generated by map editor 'Tiled'
Sep 07, 2011 In this example I used a map already done (a sample of Tiled Map Editor). When you save your map, be sure to copy the tmx file AND the image file (that contains the tiles), in the 'media' folder of your project. (See example attached to this topic). Also, we have to make a few modification in the tmx file (witch is an xml file), we have to.
Tiled TMX Loader
Load Tiled's TMX files for use in PyGame.
lib2d
This is a simple personal library that I have been using for my pyweek games. I am uploading it in preparation for the first pyweek of 2012.
draggable tile map
An abandoned experiment in a combining parts for a game. Reads .tmx tiled files, has a reasonable tile map you can drag around, some buggy path finding and UI.
mh
game experiment and library
pyscroll
A simple, fast module for adding scrolling maps to your new or existing game.
Gummworld2
Gummworld2 is a pygame framework for a scrolling game, where the map is larger than the display. It emphasizes simplicity and performance.
RPG Tactical Fantasy Game
RPG Tactical Fantasy game, turn-based and in 2D. I'm currently looking for a name.
next
Want to improve this question? So it's for Game Development Stack Exchange.Closed 2 years ago.Where can I find an easy to use and up to date C parser/library for the.tmx map format (used by the )?EDIT: David's comment, 'Unless you want to build your game around the format of the parser.'
, got me thinking. So I have downloaded, which is an easy to use xml-parser with very straightforward documentation. Together with the, I think I'll give it a try myself. I'll probably compare with Cocos2d-x's at some point.
Are you talking about editor? If so, it states right away:General purpose tile map editor with XML-based map formatSo you could just use a good, general purpose XML library such as:After that it's just a matter of following the. In other words, you will simply need to ask the XML library to fetch you the nodes and attributes you need from that list, which is usually a trivial task.PS: It also seems to be capable of exporting to JSON format, in which case you could use a JSON library instead (e.g. ).EditBut yes there seems to be a parser for this format available. A quick search returned this:I have never tested it, but give it a try.Edit 2If you don't want to install SVN just to download it, you can use this application (I've tested it, and it works - no need to install anything):And since you need an example of how to use it, here it is (based on ):. Create a new instance of type Tmx::Map.
Call Map::ParseFile passing it the path to your map file. Check for errors using Map::HasError. Iterate through tilesets using Map::GetTileset and Map::GetNumTilesets. Get individual tile information inside the tileset using Tileset::GetTile. Iterate through layers using Map::GetLayer and Map::GetNumLayers. Use Layer::GetTileGid(y,x) to get the ID of a specific tile in the layer. Iterate through object groups using Map::GetObjectGroup and Map::GetNumObjectGroups.
Iterate through objects inside each group using ObjectGroup::GetObject and ObjectGroup::GetNumObjects.For individual properties on each of these objects, check the link.