summaryrefslogtreecommitdiffhomepage
path: root/not
diff options
context:
space:
mode:
Diffstat (limited to 'not')
-rw-r--r--not/Player.lua16
-rw-r--r--not/World.lua2
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