From 5ed018c810a5433851fefc2c45792de1da7e7ca8 Mon Sep 17 00:00:00 2001 From: Aki Date: Thu, 6 Apr 2017 01:01:07 +0200 Subject: Controller-related methods and variables in Player renamed --- not/Player.lua | 16 ++++++++-------- 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 -- cgit v1.1