Browse Source

Slowed down game for online

tags/online
madiwka3 4 years ago
parent
commit
5b39b0bdac
1 changed files with 5 additions and 5 deletions
  1. +5
    -5
      main.lua

+ 5
- 5
main.lua View File

@@ -24,7 +24,7 @@ wall1width = 30
nuclearanimation = 3 nuclearanimation = 3
easternum = 0 easternum = 0
ball_DIR = 0 ball_DIR = 0
updaterate = 0.03
updaterate = 0.1
RED = 255 RED = 255
hitNum = {} hitNum = {}
hitNum[1] = 0 hitNum[1] = 0
@@ -709,7 +709,7 @@ function speedControl()
end end


function love.update(dt) function love.update(dt)
print("IMPORTANT!!!!!" .. globalState .. gameState)
--print("IMPORTANT!!!!!" .. globalState .. gameState)
staticanimatorcounter(dt) staticanimatorcounter(dt)
musicController('norm', 1) musicController('norm', 1)
@@ -781,7 +781,7 @@ function nettest(dt)
'|' .. gameState .. '|' .. gameState ..
'|' .. tostring(ball[i].dx) .. '|' .. tostring(ball[i].dx) ..
"|HOST") "|HOST")
print("SENT: " .. lastSentKey .. " TO ADDRESS: " .. IP)
print("SENT: " .. lastSentKey)
end end
data = udp:receive() data = udp:receive()
if data then if data then
@@ -813,7 +813,7 @@ function clienttest(dt)
clientinit = true clientinit = true
end end
udp:send(tostring(lastSentKey) .. '|' .. tostring(player2.y) .. "|CLIENT") udp:send(tostring(lastSentKey) .. '|' .. tostring(player2.y) .. "|CLIENT")
print("SENT TO SERVER:" .. lastSentKey .. " AT ADDRESS: " .. IP)
print("SENT TO SERVER:" .. lastSentKey)
data = udp:receive() data = udp:receive()
if data then if data then
@@ -835,7 +835,7 @@ function clienttest(dt)
else else
confirmation = "D" confirmation = "D"
end end
print(confirmation .. " recieved " .. lastSentKeyClient .. " AND ")
print("GOT: " .. lastSentKeyClient)


end end
function wallbreaker(x, y) function wallbreaker(x, y)


Loading…
Cancel
Save