Browse Source

Trying to bring back the good version

tags/chalkboard
madiwka3 4 years ago
parent
commit
dcb757406b
2 changed files with 10 additions and 5 deletions
  1. +4
    -3
      main.lua
  2. +6
    -2
      src/baseGame.lua

+ 4
- 3
main.lua View File

@@ -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)


+ 6
- 2
src/baseGame.lua View File

@@ -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


Loading…
Cancel
Save