diff --git a/src/client/game.lua b/src/client/game.lua index e69de29..4bdf48d 100644 --- a/src/client/game.lua +++ b/src/client/game.lua @@ -0,0 +1,33 @@ +local lg = assert( love.graphics ) +local scene = assert( require 'client.scene' ) +local socket = assert( require 'socket' ) +local shared = assert( require 'shared' ) +local udp = socket.udp() + +local game = {} +local t = 0 +local tick = 0 + +local currentWorld = shared.NewWorld() + +function game.draw() + +end + +function game.update( dt ) + t = dt + t + if t > 0.1 then + t = 0 + tick = tick + 1 + local s = string.format("client: %d", tick) + print( s ) + udp:send( s ) + end +end + +function game.onLoad( ) + udp:settimeout( 0 ) + udp:setpeername( "192.168.2.15", 51312 ) +end + +return scene.add( game, 'game' ) \ No newline at end of file diff --git a/src/client/menu.lua b/src/client/menu.lua index 9197755..1fdb83a 100644 --- a/src/client/menu.lua +++ b/src/client/menu.lua @@ -50,7 +50,9 @@ function menu.mousemoved( x, y, dx, dy, istouch ) end function menu.mousepressed( x, y, button, istouch, presses ) - scene.load( 'browser' ) + if button == 1 then scene.load( 'browser' ) + else scene.load( 'game' ) + end end function menu.keypressed( key, code, isrepeat ) diff --git a/src/main.lua b/src/main.lua index 2abcde2..0829491 100644 --- a/src/main.lua +++ b/src/main.lua @@ -6,5 +6,6 @@ function love.load() local scenes = assert( require 'client.scene' ) assert( require 'client.menu' ) assert( require 'client.browser' ) + assert( require 'client.game' ) scenes.load( 'menu' ) end diff --git a/src/strings.lua b/src/strings.lua deleted file mode 100644 index e69de29..0000000