summaryrefslogtreecommitdiffhomepage
path: root/player.lua
diff options
context:
space:
mode:
authorAki <nthirtyone@gmail.com>2016-07-16 22:43:37 +0200
committerAki <nthirtyone@gmail.com>2016-07-16 22:43:37 +0200
commitc5e63ddf5d895db50c7e58a5ac2af05e91dff35f (patch)
tree2b400b8ebced795ec9867ea59465673c2085f3f4 /player.lua
parent89c07885fe40000681235f75798a3d4c519009a9 (diff)
downloadroflnauts-c5e63ddf5d895db50c7e58a5ac2af05e91dff35f.zip
roflnauts-c5e63ddf5d895db50c7e58a5ac2af05e91dff35f.tar.gz
roflnauts-c5e63ddf5d895db50c7e58a5ac2af05e91dff35f.tar.bz2
Initials/moves
Diffstat (limited to 'player.lua')
-rw-r--r--player.lua6
1 files changed, 2 insertions, 4 deletions
diff --git a/player.lua b/player.lua
index e6a2954..83c9b8c 100644
--- a/player.lua
+++ b/player.lua
@@ -30,7 +30,6 @@ Player = {
current = nil,
frame = 1,
delay = 0.10,
- initial = nil,
-- Movement
inAir = true,
salto = false,
@@ -67,7 +66,6 @@ function Player:new (game, world, x, y, name)
o.sprite = newImage("assets/"..o.name..".png")
o.world = game
-- Animation
- o.initial = o.delay
o.current = o.animations.idle
o:createEffect("respawn")
-- Portrait load for first object created
@@ -160,7 +158,7 @@ function Player:update (dt)
-- Animation
self.delay = self.delay - dt
if self.delay < 0 then
- self.delay = self.delay + self.initial
+ self.delay = self.delay + Player.delay -- INITIAL from metatable
-- Thank you De Morgan!
if self.current.repeated or not (self.frame == self.current.frames) then
self.frame = (self.frame % self.current.frames) + 1
@@ -328,7 +326,7 @@ end
-- idle, walk, attack, attack_up, attack_down, damage
function Player:changeAnimation(animation)
self.frame = 1
- self.delay = self.initial
+ self.delay = Player.delay -- INITIAL from metatable
self.current = self.animations[animation]
end