fixed arrow physics

This commit is contained in:
lustlion
2022-02-22 01:14:38 +01:00
parent f0bc02c418
commit a4490bc827
10 changed files with 123 additions and 115 deletions

View File

@@ -89,7 +89,7 @@ function Kupo:Smart()
if self.bow_aim_frame > self.bow_aim_frames then
self.bow_aim_frame = self.bow_aim_frame - self.bow_aim_frames
self.bow_frame = self.bow_frame + 1
Arrow:New(self.pos.x,self.pos.y,self.bow_rotation,15)
Arrow:New(self.pos.x,self.pos.y,self.bow_rotation,10)
end
else
self.bow_frame = self.bow_frame + 1
@@ -157,12 +157,5 @@ function Kupo:HandleAnimation()
end
function Kupo:DoPhysics()
-- horizontal collisions
if not isThereAnyCollisionAt(self.pos.x + self.vel.x, self.pos.y) then
self.pos.x = self.pos.x + self.vel.x
end
if not isThereAnyCollisionAt(self.pos.x, self.pos.y + self.vel.y) then
self.pos.y = self.pos.y + self.vel.y
end
self:CollisionMove()
end