diff options
author | Aki <nthirtyone@gmail.com> | 2018-04-09 02:03:21 +0200 |
---|---|---|
committer | Aki <nthirtyone@gmail.com> | 2018-04-09 02:03:21 +0200 |
commit | c36b981f54d22c3891856c64b6be780815e8b7df (patch) | |
tree | a0d7cab756e52782db4e16bad3ce52d7f55b13dd | |
parent | 6124f00707856980f1c5a7809ebf03351783f4a4 (diff) | |
download | roflnauts-c36b981f54d22c3891856c64b6be780815e8b7df.zip roflnauts-c36b981f54d22c3891856c64b6be780815e8b7df.tar.gz roflnauts-c36b981f54d22c3891856c64b6be780815e8b7df.tar.bz2 |
Changed jump-related-variables to match to newer parts of code
-rw-r--r-- | not/Hero.lua | 8 | ||||
-rw-r--r-- | not/Player.lua | 2 |
2 files changed, 6 insertions, 4 deletions
diff --git a/not/Hero.lua b/not/Hero.lua index f49ed14..118b9f1 100644 --- a/not/Hero.lua +++ b/not/Hero.lua @@ -4,8 +4,6 @@ Hero = require "not.PhysicalBody":extends() -- Few are left... -Hero.jumpTimer = 0.16 -Hero.jumpCounter = 2 Hero.sfx = require "config.sounds" Hero.QUAD_FRAME = love.graphics.newQuad(0, 15, 32,32, 80,130) @@ -19,6 +17,8 @@ Hero.PUNCH_LEFT = {-2,-6, -20,-6, -20,6, -2,6} Hero.PUNCH_RIGHT = {2,-6, 20,-6, 20,6, 2,6} Hero.PUNCH_UP = {-8,-4, -8,-20, 8,-20, 8,-4} Hero.PUNCH_DOWN = {-8,4, -8,20, 8,20, 8,4} +Hero.JUMP_TIMER = 0.16 +Hero.JUMP_COUNT = 2 -- TODO: Portrait managment in Hero and config passed from Menu should be reviewed! -- TODO: Clean-up, see `menus/select`. @@ -44,6 +44,8 @@ function Hero:new (config, x, y, world) self.smoke = false self.isAlive = true self.spawntimer = 2 + self.jumpTimer = Hero.JUMP_TIMER + self.jumpCounter = Hero.JUMP_COUNT self.punchCooldown = 0 -- TODO: Pass loaded portrait from menu to Hero. self.portrait = love.graphics.newImage(config.portrait) @@ -291,7 +293,7 @@ end -- Called by World when Hero starts contact with Platform (lands). function Hero:land () self.inAir = false - self.jumpCounter = 2 + self.jumpCounter = Hero.JUMP_COUNT self.salto = false self.smoke = false self:createEffect("land") diff --git a/not/Player.lua b/not/Player.lua index 3722cb3..5e73e25 100644 --- a/not/Player.lua +++ b/not/Player.lua @@ -63,7 +63,7 @@ function Player:controlreleased (set, action, key) if set ~= self:getControllerSet() then return end -- Jumping if action == "jump" then - self.jumpTimer = Hero.jumpTimer -- take initial from metatable + self.jumpTimer = Hero.JUMP_TIMER end -- Walking if (action == "left" or action == "right") then |