Showcase your libraries, tools and other projects that help your fellow love users.
Kadoba
Party member
Posts: 399 Joined: Mon Jan 10, 2011 8:25 am
Location: Oklahoma
Post
by Kadoba » Tue Sep 04, 2012 8:11 pm
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)
Karai17
Party member
Posts: 930 Joined: Sun Sep 02, 2012 10:46 pm
Post
by Karai17 » Tue Sep 04, 2012 8:17 pm
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)
Kadoba
Party member
Posts: 399 Joined: Mon Jan 10, 2011 8:25 am
Location: Oklahoma
Post
by Kadoba » Tue Sep 04, 2012 8:26 pm
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.
Karai17
Party member
Posts: 930 Joined: Sun Sep 02, 2012 10:46 pm
Post
by Karai17 » Tue Sep 04, 2012 8:30 pm
Well isn't that brilliant, heh. Thanks again for your help, mate <3
KingRecycle
Prole
Posts: 44 Joined: Thu May 24, 2012 1:01 am
Post
by KingRecycle » Tue Sep 04, 2012 9:23 pm
Is it possible to change the properties of a tile in the code?
Kadoba
Party member
Posts: 399 Joined: Mon Jan 10, 2011 8:25 am
Location: Oklahoma
Post
by Kadoba » Tue Sep 04, 2012 9:40 pm
Yes, it's just a simple table with all of the values.
KingRecycle
Prole
Posts: 44 Joined: Thu May 24, 2012 1:01 am
Post
by KingRecycle » Tue Sep 04, 2012 11:18 pm
I assume it's the same as getting the property except you assign it to something?
Kadoba
Party member
Posts: 399 Joined: Mon Jan 10, 2011 8:25 am
Location: Oklahoma
Post
by Kadoba » Wed Sep 05, 2012 12:58 am
Yep
KingRecycle
Prole
Posts: 44 Joined: Thu May 24, 2012 1:01 am
Post
by KingRecycle » Wed Sep 05, 2012 3:07 am
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
Post
by gregkwaste » Wed Sep 05, 2012 9:31 am
i've made a post in my topic, but i think the question suits more here.
Is there anything like tiledata structure in objectlayers?
Users browsing this forum: Ahrefs [Bot] and 6 guests