29 lines
450 B
Lua
29 lines
450 B
Lua
local network = require("client")
|
|
|
|
local player = {
|
|
x = 100,
|
|
y = 100,
|
|
}
|
|
|
|
function love.load()
|
|
network.connect("127.0.0.1", 9000)
|
|
|
|
network.on(network.MSG_GAMESTATE, function(payload)
|
|
print("Server:", payload)
|
|
end)
|
|
end
|
|
|
|
function love.keypressed(key)
|
|
network.sendKey(key)
|
|
end
|
|
|
|
function love.update()
|
|
network.update()
|
|
end
|
|
|
|
function love.draw()
|
|
love.graphics.print("Connected", 20, 20)
|
|
|
|
love.graphics.circle("fill", player.x, player.y, 10)
|
|
end
|