diff options
author | Aki <nthirtyone@gmail.com> | 2017-04-06 01:01:07 +0200 |
---|---|---|
committer | Aki <nthirtyone@gmail.com> | 2017-04-06 01:01:07 +0200 |
commit | 5ed018c810a5433851fefc2c45792de1da7e7ca8 (patch) | |
tree | 30e7a891673db6866e3a9ddf770815c5d8d8cae1 /not | |
parent | a46bdb0673461a69fe4467f794f0ddaab9449f85 (diff) | |
download | roflnauts-5ed018c810a5433851fefc2c45792de1da7e7ca8.zip roflnauts-5ed018c810a5433851fefc2c45792de1da7e7ca8.tar.gz roflnauts-5ed018c810a5433851fefc2c45792de1da7e7ca8.tar.bz2 |
Controller-related methods and variables in Player renamed
Diffstat (limited to 'not')
-rw-r--r-- | not/Player.lua | 16 | ||||
-rw-r--r-- | not/World.lua | 2 |
2 files changed, 9 insertions, 9 deletions
diff --git a/not/Player.lua b/not/Player.lua index 515684f..719b77e 100644 --- a/not/Player.lua +++ b/not/Player.lua @@ -2,7 +2,7 @@ -- Special `not.Hero` controllable by a player. Player = { -- TODO: move functions and properties related to controls from `not.Hero`. - controlSet = --[[Controller.sets.*]]nil, + controllerSet = --[[Controller.sets.*]]nil, } -- `Player` is a child of `Hero`. @@ -29,16 +29,16 @@ function Player:init (...) end -- Controller set manipulation. -function Player:assignControlSet (set) - self.controlset = set +function Player:assignControllerSet (set) + self.controllerSet = set end -function Player:getControlSet () - return self.controlset +function Player:getControllerSet () + return self.controllerSet end -- Check if control of assigned controller is pressed. function Player:isControlDown (control) - return Controller.isDown(self:getControlSet(), control) + return Controller.isDown(self:getControllerSet(), control) end -- Update of `Player`. @@ -91,7 +91,7 @@ end -- Controller callbacks. function Player:controlpressed (set, action, key) - if set ~= self:getControlSet() then return end + if set ~= self:getControllerSet() then return end -- Jumping if action == "jump" then if self.jumpCounter > 0 then @@ -160,7 +160,7 @@ function Player:controlpressed (set, action, key) end end function Player:controlreleased (set, action, key) - if set ~= self:getControlSet() then return end + if set ~= self:getControllerSet() then return end -- Jumping if action == "jump" then self.isJumping = false diff --git a/not/World.lua b/not/World.lua index fc5e229..8aa9d28 100644 --- a/not/World.lua +++ b/not/World.lua @@ -118,7 +118,7 @@ function World:spawnNauts (nauts) for _,naut in pairs(nauts) do local x,y = self:getSpawnPosition() local spawn = self:createNaut(x, y, naut[1]) - spawn:assignControlSet(naut[2]) + spawn:assignControllerSet(naut[2]) end end |