scenes/levels: use actor2D changeSpeedToCollisionNormal

This commit is contained in:
Kazhnuz 2019-06-11 19:04:58 +02:00
parent caca456614
commit 83788cc075
1 changed files with 0 additions and 14 deletions

View File

@ -70,20 +70,6 @@ function Entity:friction(dt)
end
end
function Entity:changeSpeedToCollisionNormal(nx, ny)
local xsp, ysp = self.xsp, self.ysp
if (nx < 0 and xsp > 0) or (nx > 0 and xsp < 0) then
xsp = -xsp * self.bounceFactor
end
if (ny < 0 and ysp > 0) or (ny > 0 and ysp < 0) then
ysp = -ysp * self.bounceFactor
end
self.xsp, self.ysp = xsp, ysp
end
function Entity:purge()
self.world:removeActor(self)
end