]> code.bitgloo.com Git - clyne/gamedev2.git/commitdiff
Player init script can now allow the player to jump
authorAndy Belle-Isle <drumsetmonkey@gmail.com>
Sat, 7 Sep 2019 05:15:19 +0000 (01:15 -0400)
committerAndy Belle-Isle <drumsetmonkey@gmail.com>
Sat, 7 Sep 2019 05:15:19 +0000 (01:15 -0400)
Scripts/init.lua

index 6f510c1861db51bab7f62eee7512fdd405692b71..1292ba128a2c848efc2b1cf3bb1d549bac748f77 100644 (file)
@@ -14,6 +14,13 @@ bird = {
         end,
         MoveRightReleased = function(self)
             self.Velocity.x = self.Velocity.x - 100
+        end,
+        JumpKeyPressed = function(self)
+            if self.Physics.standing == true then
+                self.Velocity.y = self.Velocity.y + 210
+            end
+        end,
+        JumpKeyReleased = function(self)
         end
     },
     Position = {
@@ -24,6 +31,7 @@ bird = {
         x = 0.0,
         y = 0.0
     },
+    Physics = 0,
     Name = "bord",
     hellotrue = true,
     hellofalse = false,