Advanced Tiled Loader - No longer maintained

Showcase your libraries, tools and other projects that help your fellow love users.
User avatar
Kadoba
Party member
Posts: 399
Joined: Mon Jan 10, 2011 8:25 am
Location: Oklahoma

Re: Advanced Tiled Loader

Post by Kadoba »

It looks like you called Object.moveTo() without using a colon.

Code: Select all

--Change line 53 in your main.lua file from this:
player.moveTo(player.tileX * map.tileWidth, (player.tileY + 1) * map.tileHeight - player.height)

--to this:
player:moveTo(player.tileX * map.tileWidth, (player.tileY + 1) * map.tileHeight - player.height)
User avatar
Karai17
Party member
Posts: 930
Joined: Sun Sep 02, 2012 10:46 pm

Re: Advanced Tiled Loader

Post by Karai17 »

Oh bollocks! Thank you so much for finding this for me!

On that note, can you explain to me why...

Code: Select all

player:moveTo(player.tileX * map.tileWidth, (player.tileY + 1) * map.tileHeight - player.height)
...is not...

Code: Select all

player:moveTo(player.tileX * map.tileWidth, player.tileY * map.tileHeight)
STI - An awesome Tiled library
LÖVE3D - A 3D library for LÖVE 0.10+

Dev Blog | GitHub | excessive ❤ moé
User avatar
Kadoba
Party member
Posts: 399
Joined: Mon Jan 10, 2011 8:25 am
Location: Oklahoma

Re: Advanced Tiled Loader

Post by Kadoba »

It's an offset. If you were to draw the character directly at a tile's draw point then the top-left corner of the character would be exactly aligned with the tile's top-left corner. But the character is suppose to look like he's standing on the tile.
User avatar
Karai17
Party member
Posts: 930
Joined: Sun Sep 02, 2012 10:46 pm

Re: Advanced Tiled Loader

Post by Karai17 »

Well isn't that brilliant, heh. Thanks again for your help, mate <3
STI - An awesome Tiled library
LÖVE3D - A 3D library for LÖVE 0.10+

Dev Blog | GitHub | excessive ❤ moé
User avatar
KingRecycle
Prole
Posts: 44
Joined: Thu May 24, 2012 1:01 am

Re: Advanced Tiled Loader

Post by KingRecycle »

Is it possible to change the properties of a tile in the code?
User avatar
Kadoba
Party member
Posts: 399
Joined: Mon Jan 10, 2011 8:25 am
Location: Oklahoma

Re: Advanced Tiled Loader

Post by Kadoba »

Yes, it's just a simple table with all of the values.
User avatar
KingRecycle
Prole
Posts: 44
Joined: Thu May 24, 2012 1:01 am

Re: Advanced Tiled Loader

Post by KingRecycle »

I assume it's the same as getting the property except you assign it to something?
User avatar
Kadoba
Party member
Posts: 399
Joined: Mon Jan 10, 2011 8:25 am
Location: Oklahoma

Re: Advanced Tiled Loader

Post by Kadoba »

Yep
User avatar
KingRecycle
Prole
Posts: 44
Joined: Thu May 24, 2012 1:01 am

Re: Advanced Tiled Loader

Post by KingRecycle »

One last question, How would I go about changing the tile within the code?
gregkwaste
Prole
Posts: 19
Joined: Fri Aug 31, 2012 8:32 am

Re: Advanced Tiled Loader

Post by gregkwaste »

i've made a post in my topic, but i think the question suits more here.

Is there anything like tiledata structure in objectlayers?
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 32 guests