added timer for key delay

This commit is contained in:
Simon Kellet 2024-04-21 13:38:19 +01:00
parent 2e6fdcd3f0
commit 84e2125214

View File

@ -7,6 +7,12 @@ function CheckHealth(p1, p2)
end
function updateGame(dt)
--add delay between key presses
KeyPressTime = math.max(0, KeyPressTime - dt)
if KeyPressTime <= 0 then
EnableKeyPress = true
end
TimeToPlaceWall = TimeToPlaceWall - dt
if TimeToPlaceWall <= 0 then
--place a wall at a random location