Tried Push library on mobile
This commit is contained in:
parent
cc83d13b38
commit
0c2629ada1
11
main.lua
11
main.lua
@ -23,7 +23,7 @@ function love.load()
|
|||||||
lg.setDefaultFilter("nearest")
|
lg.setDefaultFilter("nearest")
|
||||||
if game.OS ~= "Horizon" then
|
if game.OS ~= "Horizon" then
|
||||||
game:changesize(416,234)
|
game:changesize(416,234)
|
||||||
love.window.setTitle('Overflown')
|
love.window.setTitle('Neutron')
|
||||||
w,h = love.window.getDesktopDimensions()
|
w,h = love.window.getDesktopDimensions()
|
||||||
res = game.OSTYPE=="PC"
|
res = game.OSTYPE=="PC"
|
||||||
push:setupScreen(game.WIDTH, game.HEIGHT, w, h, {fullscreen = true,resizable = res, pixelperfect = true})
|
push:setupScreen(game.WIDTH, game.HEIGHT, w, h, {fullscreen = true,resizable = res, pixelperfect = true})
|
||||||
@ -34,9 +34,9 @@ function love.load()
|
|||||||
end
|
end
|
||||||
|
|
||||||
function love.draw(screen)
|
function love.draw(screen)
|
||||||
if game.OSTYPE=="PC" then push:start() end
|
if game.OSTYPE~="Horizon" then push:start() end
|
||||||
game:draw(screen)
|
game:draw(screen)
|
||||||
if game.OSTYPE=="PC" then push:finish() end
|
if game.OSTYPE~="Horizon" then push:finish() end
|
||||||
end
|
end
|
||||||
|
|
||||||
function love.update()
|
function love.update()
|
||||||
@ -47,9 +47,7 @@ end
|
|||||||
function love.keypressed(key,scancode)
|
function love.keypressed(key,scancode)
|
||||||
game.inputs.keys[scancode] = true
|
game.inputs.keys[scancode] = true
|
||||||
end
|
end
|
||||||
|
function love.gamepadpressed(joystick, button) game.inputs.buttons[button] = true
|
||||||
function love.gamepadpressed(joystick, button)
|
|
||||||
game.inputs.buttons[button] = true
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function love.keyreleased(key,scancode)
|
function love.keyreleased(key,scancode)
|
||||||
@ -70,7 +68,6 @@ end
|
|||||||
|
|
||||||
function love.mousepressed(x,y,button,istouch,presses)
|
function love.mousepressed(x,y,button,istouch,presses)
|
||||||
-- Format positions according to screen
|
-- Format positions according to screen
|
||||||
|
|
||||||
if game.OS ~= "Horizon" then
|
if game.OS ~= "Horizon" then
|
||||||
x,y = push:toGame(x,y)
|
x,y = push:toGame(x,y)
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user