Be embedded in some block
Hi kikito
Thanks for you BUMP module. I use it in my 2D game.
I found if I set hero high speed and hit some block the hero will be embedded into edge of block. And the hero will lose control.
Move code: local x, y, cols, lens = self.battle.collisionEngine:Move(self, fX, fY , _filter_collision) if lens > 0 then self:OnCollision(x, y, cols, lens) end
Collision filter code: function Player:OnCollisionFilter(item, other) if other.data.base.type == enum_type.Block then return enum_collision.slide elseif other.data.base.type == enum_type.Player then return enum_collision.slide end return nil end
How to solve it?
Do you have your code on GitHub? It's hard to tell what you mean by 'lose control'. After the collision is detected with the block are you stopping movement? for example if you have a velocity variable, is it set to zero since the player just ran into a wall?
Thanks Mlfeanyi. I fixed it. It is my bug. :-)