diff options
author | Aki <nthirtyone@gmail.com> | 2017-07-17 12:53:00 +0200 |
---|---|---|
committer | Aki <nthirtyone@gmail.com> | 2017-07-17 12:53:00 +0200 |
commit | fc43bcb81b5dbfc8ef8dd164193014aa0cf43c9f (patch) | |
tree | 70f103e6add9f0ef9c9fa2d3c1b4d15a3243ee8f /not/Hero.lua | |
parent | b1885629faea4ea4c1c0694ef90e4ffef730b0ce (diff) | |
download | roflnauts-fc43bcb81b5dbfc8ef8dd164193014aa0cf43c9f.zip roflnauts-fc43bcb81b5dbfc8ef8dd164193014aa0cf43c9f.tar.gz roflnauts-fc43bcb81b5dbfc8ef8dd164193014aa0cf43c9f.tar.bz2 |
Trail now works mostly as intended
Diffstat (limited to 'not/Hero.lua')
-rw-r--r-- | not/Hero.lua | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/not/Hero.lua b/not/Hero.lua index d92d003..014eeb2 100644 --- a/not/Hero.lua +++ b/not/Hero.lua @@ -44,6 +44,7 @@ function Hero:new (name, x, y, world) self.lives = 3 self.inAir = true self.salto = false + self.smoke = false self.isAlive = true self.isWalking = false self.isJumping = false @@ -105,7 +106,8 @@ function Hero:update (dt) end -- Trail spawner - if self.combo > 100 and self.punchCooldown > 0 then + -- TODO: lower the frequency of spawning - currently it is each frame. + if self.smoke and self.inAir then local dx, dy = love.math.random(-5, 5), love.math.random(-5, 5) self:createEffect("trail", dx, dy) end @@ -263,6 +265,9 @@ function Hero:damage (direction) self.combo = math.min(999, self.combo + 10) self.punchCooldown = 0.08 + self.combo*0.0006 self:playSound(2) + if self.combo > 80 then + self.smoke = true + end end -- DIE |