summaryrefslogtreecommitdiffhomepage
path: root/selector.lua
diff options
context:
space:
mode:
authorAki <nthirtyone@gmail.com>2016-06-20 22:21:13 +0200
committerAki <nthirtyone@gmail.com>2016-06-20 22:21:13 +0200
commitdae8660f934248a0383c8e71b10701c222aa6bee (patch)
tree8cb0b12cef87512b7e3bc2aa4e33aa7f4901748c /selector.lua
parentc3705e6c90bc0635cd9661284498439d5b31fab2 (diff)
downloadroflnauts-dae8660f934248a0383c8e71b10701c222aa6bee.zip
roflnauts-dae8660f934248a0383c8e71b10701c222aa6bee.tar.gz
roflnauts-dae8660f934248a0383c8e71b10701c222aa6bee.tar.bz2
Naut selection improvmenet
Diffstat (limited to 'selector.lua')
-rw-r--r--selector.lua8
1 files changed, 6 insertions, 2 deletions
diff --git a/selector.lua b/selector.lua
index 778c6cc..b3ab5c4 100644
--- a/selector.lua
+++ b/selector.lua
@@ -66,13 +66,17 @@ end
function Selector:controllerPressed(control, controller)
local n = #self.parent.nauts
if control == "left" and not self.state then
- if self.naut == 1 then
+ if self.naut == 2 or self.naut == 1 then
self.naut = n
else
self.naut = self.naut - 1
end
elseif control == "right" and not self.state then
- self.naut = (self.naut % n) + 1
+ if self.naut == n then
+ self.naut = 2
+ else
+ self.naut = self.naut + 1
+ end
elseif control == "attack" then
if self.naut ~= 1 then
self.state = true