Not logged inGosu Forums
Forum back to libgosu.org Help Search Register Login
Up Topic Gosu / Gosu Exchange / Tile maps...
- By ? Date 2009-12-26 02:37
A) Write a parser to read in .tmx tile maps, or
B) Make my own tile map editor in Gosu, that saves to a nice yaml format

Which do you guys suggest? Do you have any advice or tips for either?
- By erisdiscord Date 2009-12-29 08:07
That depends entirely on what you need. The XML format of Tiled maps is both a blessing and a curse. What do you want in a map exactly?
- By r.kachowski Date 2010-01-02 11:52
I wrote an extension to load .tmx maps in Chingu, perhaps this could be of use to you.

http://github.com/rkachowski/tile_test

By design it only loads the first layer from the tile map (i wanted other layers saved as static .png files rather than tile maps) but I could change that if it's important.
- By bestguigui Date 2010-01-03 18:12 Edited 2010-01-03 18:51
Hello !

Make your own map editor could be really simple. It only depends A LOT on what you really intent to allow. To show you an example, I just made one today, using Gosu only .
So, it's just not perfect : you can't (yet) go for more than one tile at the time, there is only (but it seems to be enough) two layers. As well, I didn't handle scrolling yet and tilesets at the moment are limited, but a tileset can still have like 768 different tiles, which can be for one map more than enough.

Enough talking, just... see :



How does this work ? Simply, in fact. About anything is done using only mouse. By right clicking, you show the tileset on top of everything. When the tileset is shown, left clicking on it selects a tile from it (which is covered by a sprite to show it). Right clicking again hides the tileset.

After your wanted tile is selected, you can simply draw it by left clicking on your map area. Using scroll wheel top and bottom, you switch from layer 1 to layer 2 and vice versa. This way, a tile drawn on layer 2 will appear on top of any tile drawn at the same position, but in layer 1.

Finally, two keyboard constants are used : Delete to delete just everything on both layers, and F12 to save current map.

This map saved, it can really easily be opened in a Gosu engine, as well as in the editor to work on it more and more again.

Still need some work, but when I complete it, I'll share it, I promise :)

See what can be done using it :

http://www.youtube.com/watch?v=2D5UNk6Wh8I
- By erisdiscord Date 2010-01-03 19:38
Looks (and sounds) good to me. I think you should put it on github so other people can help. :)
- By disciplex Date 2010-01-13 15:00
I have an example of a tile map library on github http://github.com/richardeden/spritejam

I have a few examples of basic map loading, collision on maps and scrolling maps.
Up Topic Gosu / Gosu Exchange / Tile maps...

Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill