From cd6967aa046d230b710f01edda61f0dcfd88f9d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Erkki=20Sepp=C3=A4l=C3=A4?= Date: Tue, 21 Oct 2014 20:42:34 +0300 Subject: [PATCH] player: When going flipped, handle wing lift properly --- entities/plane.lua | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/entities/plane.lua b/entities/plane.lua index fe5ea5d..2b7b3bc 100644 --- a/entities/plane.lua +++ b/entities/plane.lua @@ -220,7 +220,12 @@ Plane = Class{ PhysicsEntity.update(self, dt) self.machinegun:update(dt) - + local dir_coeff; + if self.goingRight then + dir_coeff = 1 + else + dir_coeff = -1 + end local coeff_multiplier = 1 if self.body:getY() < 0 then @@ -328,7 +333,7 @@ Plane = Class{ air_wing_angle = tmp end - local lift_coeff = lift(-air_wing_angle) + local lift_coeff = lift(-air_wing_angle) * dir_coeff -- print("lift coeff: ", lift_coeff)