28 lines
624 B
Lua
28 lines
624 B
Lua
local scene = assert( require 'client.scene' )
|
|
local lg = assert( love.graphics )
|
|
local server = assert( require 'client.udp' )
|
|
local connecting = {}
|
|
|
|
local time, ip, port = 0
|
|
|
|
function connecting.draw()
|
|
lg.print( "Connecting to server:\t"..time, 0, 0, 0 )
|
|
return false
|
|
end
|
|
|
|
function connecting.update(dt)
|
|
time = time + dt
|
|
|
|
if time > 5 then
|
|
return scene.loadScene( scene.game )
|
|
end
|
|
return false
|
|
end
|
|
|
|
function connecting:onLoad( params )
|
|
local ip, port = assert( params, "No IP address specified!" ).ip, params.port
|
|
return server.connect( ip, port )
|
|
end
|
|
|
|
scene.connecting = connecting
|
|
return connecting |