move repeatedly in direction
This commit is contained in:
parent
e065ab83de
commit
f8e3d78332
5 changed files with 126 additions and 62 deletions
8
main.lua
8
main.lua
|
|
@ -41,7 +41,12 @@ function love.load()
|
|||
end
|
||||
|
||||
function love.update(dt)
|
||||
Input:handler(dt)
|
||||
if editorView == "world" then
|
||||
Input:stopMoveRepeat()
|
||||
else
|
||||
local repeatedMove = Input:handler(dt)
|
||||
if repeatedMove then currentRoom:movePlayer(repeatedMove) end
|
||||
end
|
||||
currentRoom:update(dt)
|
||||
|
||||
-- if love.keyboard.isDown("w") then worldSha = worldSha + 1 end
|
||||
|
|
@ -94,6 +99,7 @@ end
|
|||
|
||||
function love.keypressed(key)
|
||||
if editorView ~= "world" and Input.isPlayerMove(key) then
|
||||
Input:beginMove(key)
|
||||
currentRoom:movePlayer(key)
|
||||
elseif editorView ~= "world" and Input.isPlayerSwitch(key) then
|
||||
local c = Input.playerColor(key)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue