Tiled Drawer

Showcase your libraries, tools and other projects that help your fellow love users.
User avatar
adrix89
Party member
Posts: 135
Joined: Fri Oct 15, 2010 10:58 am

Tiled Drawer

Post by adrix89 »

Based on work from Ninwa http://love2d.org/forums/viewtopic.php?f=5&t=2097
I present you the super modified version
Features:
My very own inefficient .tmx parser
Camera
Buckets(Damn you feature I hate you!)
Spritebatches
Support for multiple tilesets
Arbitrary layer drawing(so you can you can draw over your sprites)
Your very own 512x512 map so you can claw your eyes when yous see the framerate(press m to change to map 2)
And lots of obsolete files and comments as well as test functions so you can see how messy I code

The engine is still WIP and is generally intended for those who like to tinker with things
Also since its intended for a game don't expect it to be any less quirky then it is
http://dl.dropbox.com/u/1027218/gamesource.love

Warning: Do not export from Tiled maps with other encoding other then CVS,that includes the default xml encoding which is shit

Update: Added y collision offset as well as change the image directory so you can load .tmx files in tiled
Updated!: Retarded performance edition
Update: Fixed image initializing, added some smart garbage collection, cron.lua FTW!
Last edited by adrix89 on Wed Jun 22, 2011 11:25 am, edited 6 times in total.
I use Workflowy but you can check out Dynalist as its the better offer.
User avatar
Franc[e]sco
Prole
Posts: 19
Joined: Sun May 08, 2011 9:09 am

Re: Tiled Drawer

Post by Franc[e]sco »

erm, could you Include the profiler module or add a link to it?
User avatar
adrix89
Party member
Posts: 135
Joined: Fri Oct 15, 2010 10:58 am

Re: Tiled Drawer

Post by adrix89 »

Damn that shouldn't be there,just delete the require

Fixed it
I use Workflowy but you can check out Dynalist as its the better offer.
User avatar
Franc[e]sco
Prole
Posts: 19
Joined: Sun May 08, 2011 9:09 am

Re: Tiled Drawer

Post by Franc[e]sco »

The chests drawing order is a bit messed up but it's pretty nice :)
User avatar
tentus
Inner party member
Posts: 1060
Joined: Sun Oct 31, 2010 7:56 pm
Location: Appalachia
Contact:

Re: Tiled Drawer

Post by tentus »

Maybe it's because the render was larger than my screen, but collision detection seemed way off, and a little nonsensical. Also, I could see tiles at the top of the screen get clipped at some points.
Kurosuke needs beta testers
User avatar
adrix89
Party member
Posts: 135
Joined: Fri Oct 15, 2010 10:58 am

Re: Tiled Drawer

Post by adrix89 »

tentus wrote:Maybe it's because the render was larger than my screen, but collision detection seemed way off, and a little nonsensical. Also, I could see tiles at the top of the screen get clipped at some points.
The top of the screen is because the rate is 80 while the sprites are 170,it wouldn't happen if the rate was the same, you can fix it by adding -2 to the selector for loop y variable
I wanted people to know about it since its a limitation of the engine
As for collision it should be screen independent,can you post your screen dimensions?
The collisions on y should aligned perfectly the front edge of the chest with the white dot
As for x you can see it between the two chests
As for the quirkiness it should be because of the collision map not the engine,since again the rate is 80 not the whole sprites
If it really is nonsensical can you post a screen with the problem collisions?
Franc[e]sco wrote:The chests drawing order is a bit messed up but it's pretty nice :)
There is no drawing order,it renders layer 1 then sprites then layer 2
The good thing with this is that you can script it when to draw and when not to draw
I use Workflowy but you can check out Dynalist as its the better offer.
User avatar
Lafolie
Inner party member
Posts: 809
Joined: Tue Apr 05, 2011 2:59 pm
Location: SR388
Contact:

Re: Tiled Drawer

Post by Lafolie »

Yeah... I could walk under the chests and bridges. Plus I could walk over the water tiles, and could not walk along the path that leads from the starting area to outside - I had to walk to the bridge and go all the way around.
Do you recognise when the world won't stop for you? Or when the days don't care what you've got to do? When the weight's too tough to lift up, what do you? Don't let them choose for you, that's on you.
User avatar
adrix89
Party member
Posts: 135
Joined: Fri Oct 15, 2010 10:58 am

Re: Tiled Drawer

Post by adrix89 »

Lafolie wrote:Yeah... I could walk under the chests and bridges. Plus I could walk over the water tiles, and could not walk along the path that leads from the starting area to outside - I had to walk to the bridge and go all the way around.
Check the tiled map collision layer and tell me if its accurate with the collisions in game
I use Workflowy but you can check out Dynalist as its the better offer.
User avatar
Lafolie
Inner party member
Posts: 809
Joined: Tue Apr 05, 2011 2:59 pm
Location: SR388
Contact:

Re: Tiled Drawer

Post by Lafolie »

Will do when I get the chance.
Do you recognise when the world won't stop for you? Or when the days don't care what you've got to do? When the weight's too tough to lift up, what do you? Don't let them choose for you, that's on you.
User avatar
adrix89
Party member
Posts: 135
Joined: Fri Oct 15, 2010 10:58 am

Re: Tiled Drawer

Post by adrix89 »

Updated it for massive performance increase!
Basically I just check if we a are in a new bucket and if we are not use the previous calculated spritebatches
There is also allot less memory consumption and pretty much disregards the layer penalty
Also updated the maps, now the first map is a layer test with 7 layers, while the second is a mind boggling 512x512 map
Remember to press lshift to traverse faster ;)
I use Workflowy but you can check out Dynalist as its the better offer.
Post Reply

Who is online

Users browsing this forum: Google [Bot] and 72 guests