function to improve entities moving on collisions and fixed accordingly
made math.round() changed vector() and fixed accordingly
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user