diff options
author | Aki <nthirtyone@gmail.com> | 2017-01-14 21:08:23 +0100 |
---|---|---|
committer | Aki <nthirtyone@gmail.com> | 2017-01-14 21:08:23 +0100 |
commit | efe80dc4f1e5c52929717b442e6305731577808c (patch) | |
tree | 088b79b759e8fa0ee4f01ea929fc4686d07e0689 /player.lua | |
parent | 1f787dd7d68247669ebcdf71b2afab56cb1c3d9b (diff) | |
download | roflnauts-efe80dc4f1e5c52929717b442e6305731577808c.zip roflnauts-efe80dc4f1e5c52929717b442e6305731577808c.tar.gz roflnauts-efe80dc4f1e5c52929717b442e6305731577808c.tar.bz2 |
Get initial value from metatable
Diffstat (limited to 'player.lua')
-rw-r--r-- | player.lua | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -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 |