Maescool / Catacomb-Snatch

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

Feature/tiled maps #936

Closed LordofMaps closed 12 years ago

LordofMaps commented 12 years ago

This is a pull request of/for Issue #907, Tiled Map support. All of the levels have been changed to TMX (except DevMap, which has been changed) and a base.tmx has been included to make creating new maps using Tiled easier. I haven't been able to test multiplayer map transferring, but other than that this should be fairly bug-free.

Maps must have at least one layer and spawn points for player 1 and 2. Object layers are ignored and there are no checks for tile properties.

Let me know what you think and I will address any issues and make the appropriate changes.

Maescool commented 12 years ago

Is this backward compatible with the old mapsystem? of is there an auto-migration planned/already there? Maybe also update the in-game map-editor to be compatible? looks nice for the rest, you really have earned your name, lord of the maps ;)

Maescool commented 12 years ago

and a sync might be needed, since new abstract screen system has started

LordofMaps commented 12 years ago

@Maescool It is not backwards compatible, although it could be added. No auto-migration. I figured one of the main reasons to switch to TMX (besides it being way better than Bitmaps) was to use the Tiled Map Editor. It would take quite awhile to get the built-in editor up to par with Tiled.

I think what think I'll do is replace the built-in editor with a Bitmap to TMX converter. That and merge with the new abstract layer.

Flet commented 12 years ago

@master-lincoln guessing this Base64 class was pulled from somewhere else?

In any case, this is really good stuff. I've been testing it and ran into just a few minor things to update in order to get it to build and play:

LevelUtils.java:53: change to

    obj = new Integer(32);

GameMode.java:68: change to

    } else if (obj instanceof Integer && ((Integer)obj).equals(32)) {

TiledMap.java:318: change to

            throw new Exception("Failed to parse tilemap - be sure it was saved with gzip compression", e);

With these updates, I think this is a great commit! :)

EDIT: I pushed my above suggestions to my repo so its easier to see the changes I recommend: https://github.com/Flet/Catacomb-Snatch/commit/5a27d79235510ca29661d1ea212274d74b6934ee

master-lincoln commented 12 years ago

@Flet: You could do a pull request to @LordofMaps tiledMaps branch, so it's even easier...