I'm having trouble trying to get set up with LUBE :c, I'm using the current development version and hump.class.
Code: Select all
local Vector = require "hump.vector"
local Class = require "hump.class"
require "LUBE" -- for the intertubes[
require "player"
After that I'm trying to set up a ucpClient for use, but for the life of me I can't figure out how to do this correctly, even after seeing an apparently correct implementation at
https://github.com/Nevon/cardboard/blob ... n.lua#L181
Here's what two methods I've tried:
Code: Select all
local client
function love.load()
love.graphics.setBackgroundColor(33, 89, 125)
cfg = love.filesystem.read("userconfig.cfg")
ip, port = cfg:match("^(.+):(%d+)$")
assert(ip and port)
client = lube.udpClient()
client.callbacks.recv = onReceive
p:load()
end
attempt to call field 'udpClient' (a nil value)
Code: Select all
local client = Class{}
function love.load()
love.graphics.setBackgroundColor(33, 89, 125)
cfg = love.filesystem.read("userconfig.cfg")
ip, port = cfg:match("^(.+):(%d+)$")
assert(ip and port)
client:include(lube.udpClient)
client:init()
client.callbacks.recv = onReceive
p:load()
end
attempt to index field 'callbacks' (a nil value)
I'm very new to networking and classes, so I'm sure I'm at fault here - if someone could tell me how, it'd be greatly appreciated!