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