madiwka3 преди 4 години
родител
ревизия
a47666fbb5
променени са 2 файла, в които са добавени 5 реда и са изтрити 3 реда
  1. +2
    -2
      main.lua
  2. +3
    -1
      src/baseGame.lua

+ 2
- 2
main.lua Целия файл

@@ -695,7 +695,7 @@ function speedControl()
end

function love.update(dt)
print(globalState .. gameState)
print("IMPORTANT!!!!!" .. globalState .. gameState)
staticanimatorcounter(dt)
musicController('norm', 1)
if debug then
@@ -763,7 +763,7 @@ function clienttest(dt)
local die = tonumber(p[2])
print(p[2])
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]
lastSentKeyClient, ball[i].dy, player2.y, player1.y, player1score, player2score, player1nukescore, player2nukescore, confirmation, gameState = p[1], die, tonumber(p[3]), tonumber(p[4]), tonumber(p[5]), tonumber(p[6]), tonumber(p[7]), tonumber(p[8]), p[9], p[10]
end
end
print(confirmation .. " recieved " .. lastSentKeyClient)


+ 3
- 1
src/baseGame.lua Целия файл

@@ -985,11 +985,13 @@ function clientsBaseGame(dt)
if ((confirmation == "up1" and love.keyboard.isDown(p1control.up)) or lastSentKeyP1 == p1control.up) then
player1.dy = (paddle_SPEED + p2bonus) * -1
print("moving player1 up")
elseif ((confirmation == "up1" and love.keyboard.isDown(p1control.down)) or lastSentKeyP1 == p1control.down) then
player1.dy = paddle_SPEED + p2bonus
print("moving player1 down")
else
player1.dy = 0
print("stopping player")
end
if ((confirmation == "up2" and love.keyboard.isDown(p2control.up)) or lastSentKeyP2 == p2control.up) then
player2.dy = (paddle_SPEED + p2bonus) * -1


Зареждане…
Отказ
Запис