From ebf9369ba5437b87654630a78bedd1f87d20aab2 Mon Sep 17 00:00:00 2001 From: Simon Kellet Date: Wed, 31 Jul 2024 20:37:17 +0100 Subject: [PATCH] fixed game logix --- Game/UpdateGame.lua | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/Game/UpdateGame.lua b/Game/UpdateGame.lua index 2c30460..156ae5a 100644 --- a/Game/UpdateGame.lua +++ b/Game/UpdateGame.lua @@ -21,7 +21,7 @@ local max = math.max -- optimisations function UpdateGame(dt) --Check if anyone has won if checkLossState() == true then - print("STATE CHNAGED: WIN!") + --print("STATE CHNAGED: WIN!") _G.GAMESTATE = "WIN" end --WindField @@ -57,17 +57,17 @@ function UpdateGame(dt) -- Hit player2 if v.collider:enter("Player2") then - print("Player1 hit Player2!") + --print("Player1 hit Player2!") table.remove(Bullets1, i) v.collider:destroy() - if UserPlayer1.health > 0 then - UserPlayer1.health = UserPlayer1.health - 1 + if UserPlayer2.health > 0 then + UserPlayer2.health = UserPlayer2.health - 1 end end -- Hit player1 if v.collider:enter("Player1") then - print("Player 1 hit themselves!") + --print("Player 1 hit themselves!") table.remove(Bullets1, i) v.collider:destroy() if UserPlayer1.health > 0 then @@ -100,19 +100,19 @@ function UpdateGame(dt) v.collider:destroy() end - -- Hit player2 + -- Hit player1 if v.collider:enter("Player1") then - print("Player2 hit Player1!") + --print("Player2 hit Player1!") table.remove(Bullets2, i) v.collider:destroy() - if UserPlayer2.health > 0 then - UserPlayer2.health = UserPlayer2.health - 1 + if UserPlayer1.health > 0 then + UserPlayer1.health = UserPlayer1.health - 1 end end - -- Hit player1 + -- Hit player2 if v.collider:enter("Player2") then - print("Player 2 hit themselves!") + --print("Player 2 hit themselves!") table.remove(Bullets2, i) v.collider:destroy() if UserPlayer2.health > 0 then