Browse Source

Fixed slowdowns

tags/crossplatform
Madiwka4 3 years ago
parent
commit
00f85394f6
3 changed files with 9 additions and 9 deletions
  1. +6
    -6
      main.lua
  2. +2
    -2
      src/baseGame.lua
  3. +1
    -1
      src/constantvars.lua

+ 6
- 6
main.lua View File

@@ -2062,7 +2062,7 @@ function love.touchpressed( id, x, y, dx, dy, pressure )
table.insert(touches, newTouch(id, x*DIFFERENCE_X, y*DIFFERENCE_Y))
local time = love.timer.getTime()
if x * DIFFERENCE_X < VIRTUAL_WIDTH/2 then
if time <= lastclick + clickInterval and x*DIFFERENCE_X > 50 then
if time <= lastclick + clickInterval and x*DIFFERENCE_X > 100 then
doubleclick1 = true
if gameState == "1serve" then
lastSentKey = "q"
@@ -2074,7 +2074,7 @@ function love.touchpressed( id, x, y, dx, dy, pressure )
lastclick = time
end
else
if time <= lastclick + clickInterval and x*DIFFERENCE_X > VIRTUAL_WIDTH-50 then
if time <= lastclick + clickInterval and x*DIFFERENCE_X > VIRTUAL_WIDTH-100 then
doubleclick2 = true
if gameState == "2serve" then
lastSentKey = "p"
@@ -2143,16 +2143,16 @@ function table.empty (self)
end
function sectortouched(sector)
for i, touch in ipairs(touches) do
if sector == 1 and touch.x > VIRTUAL_WIDTH-60 and touch.y < VIRTUAL_HEIGHT/2 then
if sector == 1 and touch.x > VIRTUAL_WIDTH-100 and touch.y < VIRTUAL_HEIGHT/2 then
lastSentKey = p2control.up
return true
elseif sector == 2 and touch.x < 60 and touch.y < VIRTUAL_HEIGHT/2 then
elseif sector == 2 and touch.x < 100 and touch.y < VIRTUAL_HEIGHT/2 then
lastSentKey = p1control.up
return true
elseif sector == 3 and touch.x < 60 and touch.y > VIRTUAL_HEIGHT/2 then
elseif sector == 3 and touch.x < 100 and touch.y > VIRTUAL_HEIGHT/2 then
lastSentKey = p1control.down
return true
elseif sector == 4 and touch.x > VIRTUAL_WIDTH-60 and touch.y > VIRTUAL_HEIGHT/2 then
elseif sector == 4 and touch.x > VIRTUAL_WIDTH-100 and touch.y > VIRTUAL_HEIGHT/2 then
lastSentKey = p2control.down
return true
end


+ 2
- 2
src/baseGame.lua View File

@@ -1326,7 +1326,7 @@ function clientsBaseGame(dt)
--love.window.setTitle('Trying to update the ball')
if timeIsSlow then
if ballSpeed > originalSpeed / 3 then
paddle_SPEED = 30
paddle_SPEED = 300
ballSpeed = ballSpeed / (1 + (dt * 2))
end
player1nukescore = player1nukescore - (dt * 50)
@@ -1344,7 +1344,7 @@ function clientsBaseGame(dt)
end
player2nukescore = player2nukescore - (dt * 50)
if player2nukescore < 1 or ball[1].dx < 0 then
paddle_SPEED = 30
paddle_SPEED = 300
timeIsSlow2 = false
player2reverbav = false
ballSpeed = originalSpeed


+ 1
- 1
src/constantvars.lua View File

@@ -2,4 +2,4 @@ VIRTUAL_WIDTH = 1280
VIRTUAL_HEIGHT = 720
WINDOW_WIDTH = 1280
WINDOW_HEIGHT = 720
isAndroid = false
isAndroid = true

Loading…
Cancel
Save