help colliding with tiles

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
User avatar
Vimm
Party member
Posts: 113
Joined: Wed Mar 16, 2016 8:14 pm

help colliding with tiles

Post by Vimm »

I managed to get tiled and AdvTiledLoader working, but I dont know how to properly register collisions, can someone give me a hand? (its a top down game not platformer)

here the love file in all its unorganized glory
Attachments
TopDown.love
(47.08 KiB) Downloaded 69 times
User avatar
Karai17
Party member
Posts: 930
Joined: Sun Sep 02, 2012 10:46 pm

Re: help colliding with tiles

Post by Karai17 »

1) Switch to STI
2) Set any layer, object, tile, etc to have a custom property called "collidable" and give it the value "true"
3) When loading STI, enable the box2d plugin
4) Set up a basic box2d world
5) Pass that world into STI

Code: Select all

local sti = require "sti"
local map = sti.new("map.lua", { "box2d" })
local world = love.physics.newWorld(0, 0)
map:box2d_init(world)
STI - An awesome Tiled library
LÖVE3D - A 3D library for LÖVE 0.10+

Dev Blog | GitHub | excessive ❤ moé
User avatar
Vimm
Party member
Posts: 113
Joined: Wed Mar 16, 2016 8:14 pm

Re: help colliding with tiles

Post by Vimm »

Karai17 wrote:1) Switch to STI
2) Set any layer, object, tile, etc to have a custom property called "collidable" and give it the value "true"
3) When loading STI, enable the box2d plugin
4) Set up a basic box2d world
5) Pass that world into STI

Code: Select all

local sti = require "sti"
local map = sti.new("map.lua", { "box2d" })
local world = love.physics.newWorld(0, 0)
map:box2d_init(world)
yeah someone in the love chat room said the same thing, I'm working on learning it right now ^.^
User avatar
Karai17
Party member
Posts: 930
Joined: Sun Sep 02, 2012 10:46 pm

Re: help colliding with tiles

Post by Karai17 »

That was me :P
STI - An awesome Tiled library
LÖVE3D - A 3D library for LÖVE 0.10+

Dev Blog | GitHub | excessive ❤ moé
Post Reply

Who is online

Users browsing this forum: No registered users and 12 guests