diff options
author | Aki <nthirtyone@gmail.com> | 2017-09-20 13:27:03 +0200 |
---|---|---|
committer | Aki <nthirtyone@gmail.com> | 2017-09-20 13:27:03 +0200 |
commit | f2979320625eceeaadd594ccf6bad6c6b2543aff (patch) | |
tree | 2ffdf0063467986cb01d43c4839d5e72e8077714 /not/Trap.lua | |
parent | 03ccc9890c2b349eb939b0d9fcaa982ead98f0cd (diff) | |
download | roflnauts-f2979320625eceeaadd594ccf6bad6c6b2543aff.zip roflnauts-f2979320625eceeaadd594ccf6bad6c6b2543aff.tar.gz roflnauts-f2979320625eceeaadd594ccf6bad6c6b2543aff.tar.bz2 |
Added fadein and fadeout methods to Trap
Diffstat (limited to 'not/Trap.lua')
-rw-r--r-- | not/Trap.lua | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/not/Trap.lua b/not/Trap.lua index 25eeb0b..2ebb4d2 100644 --- a/not/Trap.lua +++ b/not/Trap.lua @@ -38,6 +38,23 @@ function Trap:new (direction, x, y, world, imagePath) self.mirror = mirror end +function Trap:fadeIn () + self.hidden = false + self:setBodyActive(true) + if self.animations.fadein then + self:setAnimation("fadein") + end +end + +function Trap:fadeOut () + self:setBodyActive(false) + if self.animations.fadeout then + self:setAnimation("fadeout") + else + self.hidden = true + end +end + function Trap:getHorizontalMirror () return self.mirror end |