summaryrefslogtreecommitdiffhomepage
path: root/menu.lua
diff options
context:
space:
mode:
authorAki <nthirtyone@gmail.com>2016-08-15 00:24:09 +0200
committerAki <nthirtyone@gmail.com>2016-08-15 00:24:09 +0200
commitcc518b9216379464ccce1f903686451e428d1479 (patch)
tree3b76f388ee5719a5106a07b11803580e21b9f6f8 /menu.lua
parent6f05166e85f2355826e15b54c178eac57c7853b3 (diff)
downloadroflnauts-cc518b9216379464ccce1f903686451e428d1479.zip
roflnauts-cc518b9216379464ccce1f903686451e428d1479.tar.gz
roflnauts-cc518b9216379464ccce1f903686451e428d1479.tar.bz2
This is so funny, kek
Diffstat (limited to 'menu.lua')
-rw-r--r--menu.lua38
1 files changed, 8 insertions, 30 deletions
diff --git a/menu.lua b/menu.lua
index 28776f8..c281d8c 100644
--- a/menu.lua
+++ b/menu.lua
@@ -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