function to improve entities moving on collisions and fixed accordingly

made math.round()
changed vector() and fixed accordingly
This commit is contained in:
lustlion
2022-03-16 18:50:10 +01:00
parent 4d94cc805d
commit 236e23177d
9 changed files with 189 additions and 113 deletions

View File

@@ -44,8 +44,9 @@ function Kupo:doLogic()
self.target.y = main_player.pos.y - main_player.target_offset.y
local distance_x = self.target.x - self.pos.x
local distance_y = self.target.y - self.pos.y
local distance = math.sqrt(distance_x ^ 2 + distance_y ^ 2)
local angle = getAngleFromVector(distance_x,distance_y)
local angle = getAngleFromVector(vector(distance_x,distance_y))
self.draw_bow = false
if distance <= self.range then
if self.hostile == true then
@@ -153,7 +154,3 @@ function Kupo:handleAnimation()
)
end
end
function Kupo:doPhysics()
self:moveWithCollision()
end