From dae8660f934248a0383c8e71b10701c222aa6bee Mon Sep 17 00:00:00 2001 From: Aki Date: Mon, 20 Jun 2016 22:21:13 +0200 Subject: Naut selection improvmenet --- selector.lua | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'selector.lua') 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 -- cgit v1.1