]> code.bitgloo.com Git - clyne/gamedev2.git/commitdiff
Script now flips player when they go left
authorAndy Belle-Isle <drumsetmonkey@gmail.com>
Wed, 4 Sep 2019 00:13:41 +0000 (20:13 -0400)
committerAndy Belle-Isle <drumsetmonkey@gmail.com>
Wed, 4 Sep 2019 00:13:41 +0000 (20:13 -0400)
Scripts/init.lua

index d1f108c11f52d7f05e915d6a3ab6764a83c01458..a57e8b38d89541a11e941b2f390b7406a439ae12 100644 (file)
@@ -3,12 +3,14 @@ bird = {
     EventListeners = {
         MoveLeftPressed = function(self)
             self.Velocity.x = self.Velocity.x - 100
+            self.Render.flipx = true;
         end,
         MoveLeftReleased = function(self)
             self.Velocity.x = self.Velocity.x + 100
         end,
         MoveRightPressed = function(self)
             self.Velocity.x = self.Velocity.x + 100
+            self.Render.flipx = false;
         end,
         MoveRightReleased = function(self)
             self.Velocity.x = self.Velocity.x - 100