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
Primitive "Tiled" map loader and 2D game lighting
- nevon
- Commander of the Circuloids
- Posts: 938
- Joined: Thu Feb 14, 2008 8:25 pm
- Location: Stockholm, Sweden
- Contact:
Re: Primitive "Tiled" map loader and 2D game lighting
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
qnevon wrote:How nice of you to have it go full screen and not have a way to exit.
damn should have set the fullscreen to false
i'm using fullscreen because of vsync problems
- nevon
- Commander of the Circuloids
- Posts: 938
- Joined: Thu Feb 14, 2008 8:25 pm
- Location: Stockholm, Sweden
- Contact:
Re: Primitive "Tiled" map loader and 2D game lighting
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.adrix89 wrote:qnevon wrote: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
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 hasnevon wrote: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.adrix89 wrote:qnevon wrote:How nice of you to have it go full screen and not have a way to exit.
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
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?
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?
- Attachments
-
- tiledMap.lua
- (5.76 KiB) Downloaded 245 times
Re: Primitive "Tiled" map loader and 2D game lighting
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)
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)
Who is online
Users browsing this forum: Ahrefs [Bot] and 2 guests