fixed arrow physics
This commit is contained in:
@@ -59,16 +59,37 @@ function Entity:Move()
|
||||
end
|
||||
|
||||
function Entity:CollisionMove()
|
||||
local r = false
|
||||
if not self:isCollidingAt(self.pos.x + self.vel.x, self.pos.y, LoadedObjects.Collisions) then
|
||||
self.pos.x = self.pos.x + self.vel.x
|
||||
else
|
||||
self.vel.x = 0
|
||||
r = true
|
||||
end
|
||||
if not self:isCollidingAt(self.pos.x, self.pos.y + self.vel.y, LoadedObjects.Collisions) then
|
||||
self.pos.y = self.pos.y + self.vel.y
|
||||
else
|
||||
self.vel.y = 0
|
||||
r = true
|
||||
end
|
||||
return r
|
||||
end
|
||||
|
||||
function Entity:MoveX()
|
||||
local r = false
|
||||
if not self:isCollidingAt(self.pos.x + self.vel.x, self.pos.y, LoadedObjects.Collisions) then
|
||||
self.pos.x = self.pos.x + self.vel.x
|
||||
else
|
||||
self.vel.x = 0
|
||||
r = true
|
||||
end
|
||||
if not self:isCollidingAt(self.pos.x, self.pos.y + self.vel.y, LoadedObjects.Collisions) then
|
||||
self.pos.y = self.pos.y + self.vel.y
|
||||
else
|
||||
self.vel.y = 0
|
||||
r = true
|
||||
end
|
||||
return r
|
||||
end
|
||||
|
||||
function Entity:LightAdjust(x,y)
|
||||
@@ -181,13 +202,13 @@ end
|
||||
function Entity:isCollidingAtAll(x,y)
|
||||
local result = false
|
||||
if not result then
|
||||
result = self:isCollidingAt(x,y,objects.collisions)
|
||||
result = self:isCollidingAt(x,y,LoadedObjects.Platforms)
|
||||
end
|
||||
if not result then
|
||||
result = self:isCollidingAt(x,y,objects.ladders)
|
||||
result = self:isCollidingAt(x,y,LoadedObjects.Platforms)
|
||||
end
|
||||
if not result then
|
||||
result = self:isCollidingAt(x,y,objects.platforms)
|
||||
result = self:isCollidingAt(x,y,LoadedObjects.Platforms)
|
||||
end
|
||||
return result
|
||||
end
|
||||
@@ -250,8 +271,10 @@ function Entity:Debug()
|
||||
end
|
||||
end
|
||||
|
||||
function Entity:DrawBackground()
|
||||
function Entity:HandleAnimation()
|
||||
end
|
||||
|
||||
function Entity:DrawBackground()
|
||||
end
|
||||
|
||||
require "code/entities/kupo"
|
||||
|
||||
Reference in New Issue
Block a user