summaryrefslogtreecommitdiffhomepage
path: root/not/Hero.lua
diff options
context:
space:
mode:
authorAki <nthirtyone@gmail.com>2017-07-17 14:15:36 +0200
committerAki <nthirtyone@gmail.com>2017-07-17 14:15:36 +0200
commit7ad366dcec68c703499e3f6f72b345d1adeac1da (patch)
tree869234374f264c1dba08bfa3461d576109a6dc34 /not/Hero.lua
parentfc43bcb81b5dbfc8ef8dd164193014aa0cf43c9f (diff)
downloadroflnauts-7ad366dcec68c703499e3f6f72b345d1adeac1da.zip
roflnauts-7ad366dcec68c703499e3f6f72b345d1adeac1da.tar.gz
roflnauts-7ad366dcec68c703499e3f6f72b345d1adeac1da.tar.bz2
Moved landing method to Hero from World
Diffstat (limited to 'not/Hero.lua')
-rw-r--r--not/Hero.lua9
1 files changed, 9 insertions, 0 deletions
diff --git a/not/Hero.lua b/not/Hero.lua
index 014eeb2..ff07c36 100644
--- a/not/Hero.lua
+++ b/not/Hero.lua
@@ -219,6 +219,15 @@ function Hero:createEffect (name, dx, dy)
self.world:createEffect(name, x, y)
end
+-- Called by World when Hero starts contact with Platform (lands).
+function Hero:land ()
+ self.inAir = false
+ self.jumpCounter = 2
+ self.salto = false
+ self.smoke = false
+ self:createEffect("land")
+end
+
-- Creates temporary fixture for hero's body that acts as sensor.
-- direction: ("left", "right", "up", "down")
-- Sensor fixture is deleted after time set in UserData[1]; deleted by `not.Hero.update`.