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 30 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: 720
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.
Do you frequently have great ideas but immediately lose them? Check out the MVP for my website called IdeaVault. It is designed to solve that problem. Desktop browsers only currently.

Post Reply

Who is online

Users browsing this forum: No registered users and 10 guests