From efe80dc4f1e5c52929717b442e6305731577808c Mon Sep 17 00:00:00 2001 From: Aki Date: Sat, 14 Jan 2017 21:08:23 +0100 Subject: Get initial value from metatable --- player.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/player.lua b/player.lua index 133e266..40d091c 100644 --- a/player.lua +++ b/player.lua @@ -22,8 +22,7 @@ Player = { lives = 3, spawntimer = 2, alive = true, - punchcd = 0, - punchinitial = 0.25, + punchcd = 0.25, punchdir = 0, -- a really bad thing -- Animation animations = require "animations", @@ -68,6 +67,7 @@ function Player:new (game, world, x, y, name) o.name = name or "empty" o.sprite = newImage("assets/nauts/"..o.name..".png") o.world = game + o.punchcd = 0 -- Animation o.current = o.animations.idle o:createEffect("respawn") @@ -380,7 +380,7 @@ end -- (string) direction function Player:hit(direction) -- start cooldown - self.punchcd = self.punchinitial + self.punchcd = Player.punchcd -- INITIAL from metatable -- actual punch local fixture if direction == "left" then -- cgit v1.1