@@ -50,7 +50,15 @@ else | |||||
self.dx = ball_DIR | self.dx = ball_DIR | ||||
end | end | ||||
self.disabled = false | self.disabled = false | ||||
self.x = VIRTUAL_WIDTH /2 - 2 | |||||
if not player then | |||||
self.x = VIRTUAL_WIDTH /2 - 2 | |||||
elseif player == 1 then | |||||
self.x = 50 | |||||
elseif player == 2 then | |||||
self.x = VIRTUAL_WIDTH - 50 | |||||
else | |||||
self.x = VIRTUAL_WIDTH /2 - 2 | |||||
end | |||||
self.y = VIRTUAL_HEIGHT /2 - 2 | self.y = VIRTUAL_HEIGHT /2 - 2 | ||||
self.dy = math.random(-1, 1) | self.dy = math.random(-1, 1) | ||||
@@ -214,6 +214,7 @@ function love.load() | |||||
globalState = "nettest" | globalState = "nettest" | ||||
AGAINST_AI = 0 | AGAINST_AI = 0 | ||||
gameState = "1serve" | gameState = "1serve" | ||||
ball[1]:reset(1, 1) | |||||
end | end | ||||
) | ) | ||||
) | ) | ||||
@@ -225,6 +226,7 @@ function love.load() | |||||
globalState = "clienttest" | globalState = "clienttest" | ||||
AGAINST_AI = 0 | AGAINST_AI = 0 | ||||
gameState = "1serve" | gameState = "1serve" | ||||
ball[1]:reset(1, 1) | |||||
end | end | ||||
) | ) | ||||
) | ) | ||||
@@ -1125,7 +1127,7 @@ function love.keypressed(key) | |||||
gameState = "1serve" | gameState = "1serve" | ||||
resettinggenius() | resettinggenius() | ||||
for i = 1, maxBalls do | for i = 1, maxBalls do | ||||
ball[i]:reset(i) | |||||
ball[i]:reset(i, 1) | |||||
end | end | ||||
end | end | ||||
else | else | ||||
@@ -391,7 +391,7 @@ function goalManager() | |||||
AI_SPEED = difficultyl / 10 | AI_SPEED = difficultyl / 10 | ||||
for i = 1, maxBalls do | for i = 1, maxBalls do | ||||
ball[i]:reset(i) | |||||
ball[i]:reset(i, 2) | |||||
end | end | ||||
if (player2score == ptw and gameMode ~= "practice") then | if (player2score == ptw and gameMode ~= "practice") then | ||||
for i = 1, maxBalls do | for i = 1, maxBalls do | ||||