From dcb757406b56f371920766d4699549cbe0ee2c25 Mon Sep 17 00:00:00 2001 From: madiwka3 Date: Fri, 7 Aug 2020 19:25:05 +0600 Subject: [PATCH] Trying to bring back the good version --- main.lua | 7 ++++--- src/baseGame.lua | 8 ++++++-- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/main.lua b/main.lua index a2cfdd4..9b379ec 100644 --- a/main.lua +++ b/main.lua @@ -754,9 +754,9 @@ function clienttest(dt) clientinit = true end udp:send(tostring(lastSentKey)) - print(lastSentKey) + print("SENT TO SERVER:" .. lastSentKey) data = udp:receive() - print(data) + --print(data) if data then local p = split(data, '|') for i = 1, maxBalls do @@ -765,7 +765,8 @@ function clienttest(dt) print(p[2] + 0) lastSentKeyClient, ball[i].dy, player2.y, player1.y, player1score, player2score, player1nukescore, player2nukescore, confirmation = p[1], die, tonumber(p[3]), tonumber(p[4]), tonumber(p[5]), tonumber(p[6]), tonumber(p[7]), tonumber(p[8]), p[9] end - end + end + print(confirmation .. " recieved " .. lastSentKeyClient) end function wallbreaker(x, y) diff --git a/src/baseGame.lua b/src/baseGame.lua index 563697b..a652549 100644 --- a/src/baseGame.lua +++ b/src/baseGame.lua @@ -961,9 +961,11 @@ function rules(query, i) end function clientsBaseGame(dt) if confirmation == "up1" then - player1.RED = 1 + player1.RED = 0 + print("KEYS ARE: " .. confirmation .. " " .. lastSentKeyP2) elseif confirmation == "up2" then - player2.RED = 1 + player2.RED = 0 + print("KEYS ARE: " .. confirmation .. " " .. lastSentKeyP1) end if gameMode == "reverse" then reversegame(dt) @@ -980,8 +982,10 @@ function clientsBaseGame(dt) if t < shakeDuration then t = t + dt end + if ((confirmation == "up1" and love.keyboard.isDown(p1control.up)) or lastSentKeyP1 == p1control.up) then player1.dy = (paddle_SPEED + p2bonus) * -1 + elseif ((confirmation == "up1" and love.keyboard.isDown(p1control.down)) or lastSentKeyP1 == p1control.down) then player1.dy = paddle_SPEED + p2bonus else