소스 검색

Slowed down game for online

tags/online
madiwka3 5 년 전
부모
커밋
5b39b0bdac
1개의 변경된 파일5개의 추가작업 그리고 5개의 파일을 삭제
  1. +5
    -5
      main.lua

+ 5
- 5
main.lua 파일 보기

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


불러오는 중...
취소
저장