First, install Lua and Lua-Socket. Then, launch the server with "lua server.lua". Afterwards, launch your game, enter "127.0.0.1" as IP on this PC, and your local address on your friends PC (e.g 192.168.1.110). One player picks Host, the other Picks Client!
if ((globalState ~= "nettest" and love.keyboard.isDown(p2control.up)) or lastSentKeyClient == p2control.up) then
if ((globalState ~= "nettest" and love.keyboard.isDown(p2control.up)) ) then
player2.dy = (paddle_SPEED + p2bonus) * -1
elseif ((globalState ~= "nettest" and love.keyboard.isDown(p2control.down)) or lastSentKeyClient == p2control.down) then
elseif ((globalState ~= "nettest" and love.keyboard.isDown(p2control.down))) then
player2.dy = paddle_SPEED + p2bonus
else
elseif (globalState ~= "nettest") then
player2.dy = 0
end
end
@@ -456,20 +456,20 @@ end
function powerAvailability()
if (player1nukescore >= 20 and player1nukescore < 140) then
potentialstrike1 = 1
if (((globalState ~= "clienttest" and love.keyboard.isDown(p1control.super)) or (confirmation == "confirmed" and lastSentKeyP1 == p1control.super)) ) then
if (((globalState ~= "clienttest" and love.keyboard.isDown(p1control.super)) or (globalState == "clienttest" and lastSentKeyP1 == p1control.super)) ) then
player1striken = 1
player1reverbav = 0
end
end
if (player1nukescore >= 140) and timeIsSlow2 == false and timeIsSlow == false then
player1reverbav = 1
if ((confirmation == "confirmed" and lastSentKeyP1 == p1control.counter) or (globalState ~= "clienttest" and love.keyboard.isDown(p1control.counter))) then
if ((globalState == "clienttest" and lastSentKeyP1 == p1control.counter) or (globalState ~= "clienttest" and love.keyboard.isDown(p1control.counter))) then
powerControl(1, "special")
end
end
if (player1nukescore >= 200) then
potentialnuke1 = 1
if ((confirmation == "confirmed" and lastSentKeyP1 == p1control.super)or (globalState ~= "clienttest" and love.keyboard.isDown(p1control.super))) then
if ((globalState == "clienttest" and lastSentKeyP1 == p1control.super)or (globalState ~= "clienttest" and love.keyboard.isDown(p1control.super))) then