Not logged inGosu Forums
Forum back to Help Search Register Login
Up Topic Gosu / Gosu Exchange / Has anyone written OGMO/TilED map renderer for Gosu?
- - By darkhog Date 2014-01-06 22:49
If so, please share, because then I won't have to write my own level editor.
Parent - - By jahmaican Date 2014-01-07 17:58 Edited 2014-01-07 18:04
For Tiled, yes. It's fairly easy if you use some kind of xml parsing library, see class Mapa here.

Please note this project is pretty old, i.e. not ideal in terms of my ruby skills :)
Parent - - By darkhog Date 2014-01-07 20:45
Are you Polish by any chance? Me too! Anyway, I never understood how to use XML libraries, from my experience none provided some interface like ini files, with path/to/node. I.e. so for this xml (let's ignore the fact it is malformed for clarity sake):
<car make="SupaCar">
<model name="XTreemeR" />

following code would show

puts WhateverXML.getvalue("xml/car","make") #path/to/node, attribute
puts WhateverXML.getvalue("xml/car/model","name") #path/to/node, attribute

Anyway, thanks. I'll try to put some optimizations if performance will be an issue.
Parent - - By jahmaican Date 2014-01-08 08:33 Edited 2014-01-08 08:55
I happen to be Polish, yes.

Can't relate to your issues with xml, I used trial and error driven development for my purposes.
Parent - By darkhog Date 2014-01-08 13:59
Yeah, trial&error is good, but very slow.
Parent - - By IgorJorobus Date 2014-01-08 16:06
There's a gem for Ruby called "retmx". Will make your life easier if you are using Tiled maps.
Parent - By darkhog Date 2014-01-08 20:54
Thanks! Will check it out!
Parent - - By shawn42 Date 2014-01-10 02:02
The gem that is still maintained is the 'tmx' gem. It also supports the JSON Tiled format.
Parent - By IgorJorobus Date 2014-01-14 12:41
I've tried it. But I prefer the other one. Can't remember why, perhaps I see retmx more object oriented.
Up Topic Gosu / Gosu Exchange / Has anyone written OGMO/TilED map renderer for Gosu?

Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill