## Problem with tile collision

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Prole
Posts: 35
Joined: Wed Mar 28, 2018 5:13 pm
Location: Lima

### Problem with tile collision

Hi all, I have a problem...
I tried to make a platformer game to learn, like http://osmstudios.com/tutorials/love2d- ... ing-levels
and and that works, but only for the main character, the enemies is another history.
Enemies no step the ground, they just move in x axis (velocity + -), I tried to make like the player, the problem is where they collision, they can´t move.

Code: Select all

function espadachin:init()
....
Entity.init(self, world, x, y, self.imgx[self.it],self.imgy[self.it])
end

local x, y, w, h = self.world:getRect(other)
local espadachinBottom = self.y + self.h
local otherBottom = y + h
return 'slide'
end

....
self.x, self.y, collisions, len = self.world:move(self, self.x, self.y, self.collisionFilter)

for i, coll in ipairs(collisions) do
if coll.normal.y < 0 then
self.isGrounded = true
else
self.isGrounded= false
end
end


I thinking to use love.physics and take a dynamic body all the map, but I would need get all tilelayer with any function, like.

Code: Select all

	for k, object in pairs(map.objects) do
end

Someone can explain me any solution, please?

I used STI library and bump library

Pospos
Citizen
Posts: 70
Joined: Sun Jun 18, 2017 11:10 am

### Re: Problem with tile collision

Post the love file using attachements.
ⵜⴰⵎⴰⵣⵉⵖⵜ(https://en.wikipedia.org/wiki/Berbers)

Prole
Posts: 35
Joined: Wed Mar 28, 2018 5:13 pm
Location: Lima

### Re: Problem with tile collision

Pospos wrote:
Sat Jun 16, 2018 2:24 pm
Post the love file using attachements.
Sorry, here's the love file (ma_nocollidable.love):

Edit: I added the same player collision filter in babas.lua(slime), but I need to babas pass through player. (ma.love)
Result with collision filter:
Attachments
ma_nocollidable.love