Page 3 of 3

Re: Primitive "Tiled" map loader and 2D game lighting

Posted: Tue Nov 30, 2010 12:24 pm
by adrix89
Added rez independent collisions(and sane/insane coordinates)
Also added spritebatch
I'll play with frame buffer when the final ver of love 0.7 is released
PlanetCute_miab2.love
(793.28 KiB) Downloaded 395 times

Re: Primitive "Tiled" map loader and 2D game lighting

Posted: Tue Nov 30, 2010 12:58 pm
by nevon
How nice of you to have it go full screen and not have a way to exit.

Re: Primitive "Tiled" map loader and 2D game lighting

Posted: Tue Nov 30, 2010 1:47 pm
by adrix89
nevon wrote:How nice of you to have it go full screen and not have a way to exit.
q

damn should have set the fullscreen to false
i'm using fullscreen because of vsync problems

Re: Primitive "Tiled" map loader and 2D game lighting

Posted: Tue Nov 30, 2010 1:52 pm
by nevon
adrix89 wrote:
nevon wrote:How nice of you to have it go full screen and not have a way to exit.
q
Lol. I mashed on the keyboard to try to find a quit key. That must have been one of the few keys I never tried. :ultrashocked:

Re: Primitive "Tiled" map loader and 2D game lighting

Posted: Tue Nov 30, 2010 2:30 pm
by adrix89
nevon wrote:
adrix89 wrote:
nevon wrote:How nice of you to have it go full screen and not have a way to exit.
q
Lol. I mashed on the keyboard to try to find a quit key. That must have been one of the few keys I never tried. :ultrashocked:
I do agree that q isn't the most intuitive,the alternative is however to look at the keyboard constants to be sure what value it has
Also the event push to quit is q so it wouldn't surprise me if more games have q as the quit button

Re: Primitive "Tiled" map loader and 2D game lighting

Posted: Fri Dec 31, 2010 3:06 pm
by headchant
Don't know what adrix did but here is my version of tiledMap.lua

this is an enhanced version of the "Tiled Map Loader" from ninwa

problems:
underscore _ in filenames break the loading of the tileset image
collision check is still off
changes:
removed middleclass and instead used hump
now compatible with more tilesets(only vertically lined up tilesets were allowed in the original version)
faster drawing with spritebatch
draw layers seperatly(for z-stuff)

I noticed that the parser only recognizes .tmx files in the standard "XML" format which is the worst(and biggest) format available . Love 0.7 supports some kind of base64(http://love2d.org/wiki/FileDecoder) so this obviously would be the better choice. The default format for the .tmx files in "Tiled" is base64(gzip compressed). I don't know if that is supported by love?

Re: Primitive "Tiled" map loader and 2D game lighting

Posted: Fri Dec 31, 2010 8:23 pm
by adrix89
The best format for Tiled probably is CSV as it can be far easier to parse

Wait you have spriteBatch = love.graphics.newSpriteBatch( self.tileset.src, self.layers * self.data.width*self.data.height
in draw,be careful as it might gobble insane amounts of memory
Also can you post a .love? as I have no idea what resource you are using for the tileset

Underscores don't work because you don't have the right string pattern in the parase phase
You have to offset collision by the screen resolution(lot of headache as the coordinate system is not sane,better just use my results)