Page 1 of 1

How do I do collision with Tiled ?

Posted: Tue Oct 22, 2013 7:53 pm
by VetruvianSprite
I'm in the process of making a game right now, and I made a map with the Tiled map editor and am using ATL to load it, I got it to display and everything properly but I'm a bit lost as far as how to do collision, can anyone tell me how to go about doing it ? and please if you can, keep in mind i'm not very good yet, thanks. XD


Here is the .love
http://www.filedropper.com/wip

I want to make it so the player collides with the stone tiles.

Re: How do I do collision with Tiled ?

Posted: Tue Oct 22, 2013 9:06 pm
by micha
Technically there are two parts you have to do: (1) Access the collision information from the map and (2) Do the actual collision stuff.

In which part do you need help?

Re: How do I do collision with Tiled ?

Posted: Tue Oct 22, 2013 9:20 pm
by VetruvianSprite
micha wrote:In which part do you need help?
Well honestly, both. :?

[]

Posted: Tue Oct 22, 2013 9:31 pm
by bekey
-snip-

Re: How do I do collision with Tiled ?

Posted: Wed Oct 23, 2013 5:51 am
by micha
I learned a lot from the tutorial on Exploding Rabbit. It does collision and uses Advanced Tiled Loader, so hopefully exactly what you need.

Re: How do I do collision with Tiled ?

Posted: Fri Oct 25, 2013 1:32 am
by VetruvianSprite
bekey wrote:if you right click on the stone tile in the tilesheet and give it a property called "obstacle" or "solid" or "poophole" and then when you iterate over the tiles on your map inside the code, you can say something like:

Code: Select all

for x, y, tile in map("Layer_Name"):iterate() do
		if tile.properties.obstacle then
                        -- Make it solid, lel
		end
end

Where in the program would I want to put this?

[]

Posted: Fri Oct 25, 2013 7:55 am
by bekey
-snip-

Re: How do I do collision with Tiled ?

Posted: Wed Nov 20, 2013 4:43 am
by ac3raven
Would anyone mind going into a little more detail on how to make obstacle tiles solid, as in the above for loop?

[]

Posted: Wed Nov 20, 2013 6:55 am
by bekey
-snip-