diff options
author | Aki <nthirtyone@gmail.com> | 2016-08-15 00:24:09 +0200 |
---|---|---|
committer | Aki <nthirtyone@gmail.com> | 2016-08-15 00:24:09 +0200 |
commit | cc518b9216379464ccce1f903686451e428d1479 (patch) | |
tree | 3b76f388ee5719a5106a07b11803580e21b9f6f8 | |
parent | 6f05166e85f2355826e15b54c178eac57c7853b3 (diff) | |
download | roflnauts-cc518b9216379464ccce1f903686451e428d1479.zip roflnauts-cc518b9216379464ccce1f903686451e428d1479.tar.gz roflnauts-cc518b9216379464ccce1f903686451e428d1479.tar.bz2 |
This is so funny, kek
-rw-r--r-- | menu.lua | 38 | ||||
-rw-r--r-- | selector.lua | 2 |
2 files changed, 8 insertions, 32 deletions
@@ -78,29 +78,6 @@ function Menu:getSelectorsInactive() return t end --- Selectors numbers getters -function Menu:getSelectorsNumberAll() - return #self.selectors -end -function Menu:getSelectorsNumberActive() - local n = 0 - for _,selector in pairs(self.selectors) do - if selector:getController() ~= nil then - n = n + 1 - end - end - return n -end -function Menu:getSelectorsNumberInactive() - local n = 0 - for _,selector in pairs(self.selectors) do - if selector:getController() == nil then - n = n + 1 - end - end - return n -end - -- Header get bounce move function Menu:getBounce(f) local f = f or 1 @@ -133,7 +110,7 @@ end -- Update function Menu:update(dt) local state = true - if self:getSelectorsNumberActive() > 1 then + if #self:getSelectorsActive() > 1 then for _,selector in pairs(self:getSelectorsActive()) do state = state and selector.state end @@ -184,12 +161,9 @@ end -- Controller callbacks function Menu:controlpressed(set, action, key) - -- assign to character selection - if control == "attack" then - local selector = self:getSelectorsInactive()[1] - if selector ~= nil then - selector:assignController(controller) - end + -- pass to selectors + for k,selector in pairs(Menu:getSelectorsAll()) do + selector:controlpressed(set, action, key) end -- map selection chaos! if action == "left" then @@ -206,6 +180,10 @@ function Menu:controlpressed(set, action, key) self.map = 1 end end + -- speed up the countdown + if action ~= "jump" then + self:countdownJump() + end end function Menu:controlreleased(set, action, key) end
\ No newline at end of file diff --git a/selector.lua b/selector.lua index 23939b6..ae62e13 100644 --- a/selector.lua +++ b/selector.lua @@ -93,8 +93,6 @@ function Selector:controlpressed(set, action, key) self.parent:unselectSelector(self) end end - -- Speed up countdown - self.parent:countdownJump() end function Selector:controlreleased(set, action, key) end
\ No newline at end of file |