From 84e2125214160794b288b3d3c627cdf603dfe188 Mon Sep 17 00:00:00 2001 From: Simon Kellet Date: Sun, 21 Apr 2024 13:38:19 +0100 Subject: [PATCH] added timer for key delay --- updateGame.lua | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/updateGame.lua b/updateGame.lua index 094a22d..d5f3e2d 100644 --- a/updateGame.lua +++ b/updateGame.lua @@ -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