Maescool / Catacomb-Snatch

Mojang's Humble bundle source
Other
295 stars 99 forks source link

Tiled Map Support (testing needed) #907

Closed LordofMaps closed 11 years ago

LordofMaps commented 12 years ago

I currently have a branch (feature/tiledMap) with Tiled map support, or more accurately Tiled Map XML (TMX) file support. Maps can have any number of layers but only the top most tile at any position (x,y) will be considered active. Object layers are not supported. Also, as part of this player spawn points and shop items are now map defined.

I'm using the Slick2d code to load the maps, however the code does NOT require Slick, nor does it use Slick. This was done because the code was already there, and quite good, and if the project ever switches over to Slick the only thing that will need to be changed are imports.

I'm posting this because I need testers! It would take me way to long to find all of the bugs on my own and it's not quite ready for a develop pull request. I need people to play around and make TMX maps.

To create a map download Tiled Map editor and load the base.tmx file found in my tiledMap branch under res/tiled. Any feedback will be greatly appreciated! Sorry if this is the wrong place to post something like this.

EDIT: The tile sets are not actually loaded from the map. The tile sets are used as a reference for the ID of each tile and not the image of each tile. This is why I've included base.tmx so that the tile set order will be consistent across maps.

Currently each map is assumed to have at least one spawn point for player one.

Tipaa commented 12 years ago

Is there capability for map scripts within the file?

Maescool commented 12 years ago

looks nice :)

LordofMaps commented 12 years ago

@Tipaa I don't think there is native support for scripts within TMX maps. However, I'm not sure what would be possible with an object layer.

Tipaa commented 12 years ago

If you could add the ability to tie a piece of JS into the .tmx that would be good enough to work.

RaXaR commented 12 years ago

This is sweet, I'm itching to test this. I'll send feedback as soon as I can.

master-lincoln commented 12 years ago

@Tipaa tmx can have arbitrary properties on all elements. We could add one containing a filename pointing to the script...

Flet commented 12 years ago

@LordofMaps I'll have to take a look at this tonight! Moving to Tiled was one of the more daunting tasks when looking to move to Slick2d. If this could be done in advance it would make the transition easier.

I haven't looked, but does it also play nice with the level editor?

Can you possibly synch up the branch to the latest and do a pull request? Even if there are a few lingering bugs, it would be great to have this merged. Also, others can help fix bugs if its been committed :)

LordofMaps commented 12 years ago

@Flet It does not work with the built-in level editor (which reminds me I should remove the option from the main menu). You have to use Tiled with the tile sets under 'res/tiled'.

LordofMaps commented 12 years ago

@master-lincoln I think that would be the best way to implement scripts on map, as long as the tile properties are loaded with the map and not every tick.

RaXaR commented 12 years ago

@LordofMaps I coudn't get this compile with either gradle or netbeans .. something about the Sound.java not sure EDIT: http://www.pasteall.org/30203 EDIT#2: Looks like it's happening in the main repo as well. Think I'm gonna create a new issue for this rather.

godleydemon commented 11 years ago

looks like the issue is resolved here and everything is setup for tiled maps :)