Detect collisions for STI with bump by layer id

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
EnbyAdams
Prole
Posts: 1
Joined: Mon Jun 10, 2019 7:53 pm

Detect collisions for STI with bump by layer id

Post by EnbyAdams » Mon Jun 10, 2019 7:57 pm

Hiya friends, is it possible to check for collisions with specific STI tile layer ids with bump? If not, how can I differentiate between enemy collisions and collisions with the map? Current code is attached, enemies aren't programmed yet.
Attachments
thingy.love
(159.48 KiB) Downloaded 6 times

Code: Select all

local code = "broken"
function love.update(dt)
	if code == "broken" then
		print("god is dead")
	elseif code ~= "broken"
		print("lmao as if that'll happen, it's def still broken")
	end
end

bobbyjones
Party member
Posts: 712
Joined: Sat Apr 26, 2014 7:46 pm

Re: Detect collisions for STI with bump by layer id

Post by bobbyjones » Wed Jun 12, 2019 2:37 pm

I haven't used it in a while but I believe the collision object returns the items the took place in the collision. That's how I handled it.
Check out my most recent medium post, please give feedback.
Link

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 5 guests