From 75182d1d91ea751ec9f0b98e2118a341679ce796 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Erkki=20Sepp=C3=A4l=C3=A4?= Date: Sun, 19 Oct 2014 02:25:10 +0300 Subject: [PATCH] Plane: set plane angle properly per initial velocity --- entities/plane.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entities/plane.lua b/entities/plane.lua index 5f1b12c..2a0b740 100644 --- a/entities/plane.lua +++ b/entities/plane.lua @@ -58,7 +58,7 @@ Plane = Class{ self.body:setY(self.y - self.ysize / 2) self.body:setLinearVelocity(xDir, yDir) self.goingRight = xDir >= 0 - self.body:setAngle(0) + self.body:setAngle(math.atan2(yDir, xDir)) -- self.body:setMassData(self.xsize / 2, self.ysize / 2, 440 * PIXELS_PER_METER, -1.0) -- self.body:setMassData(self.xsize / 2, 0, 430, 158194) self.fixture:setFriction(0)