boxes n walls n movement etcgit status
This commit is contained in:
parent
9763040c99
commit
2772ec2563
10 changed files with 318 additions and 45 deletions
26
input.lua
26
input.lua
|
|
@ -1,11 +1,27 @@
|
|||
local input = {}
|
||||
Input = {}
|
||||
|
||||
function input:handler()
|
||||
Input.playermovekeys = { up = "up", down = "down", left = "left", right = "right" }
|
||||
Input.playerswitchkeys = { ["1"] = "1", ["2"] = "2", ["3"] = "3" }
|
||||
Input.colorfromkey = {"red", "green", "blue"}
|
||||
|
||||
function Input:handler()
|
||||
|
||||
end
|
||||
|
||||
function input:moveIsPressed()
|
||||
|
||||
function Input.isPlayerMove(key)
|
||||
if Input.playermovekeys[key] then
|
||||
return true
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
return input
|
||||
function Input.isPlayerSwitch(key)
|
||||
if Input.playerswitchkeys[key] then
|
||||
return true
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
function Input.playerColor(key)
|
||||
return Input.colorfromkey[tonumber(key)]
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue