40 lines
1.0 KiB
Lua
40 lines
1.0 KiB
Lua
makeclass('login')
|
|
makeclass("engio")
|
|
makeclass('cube')
|
|
makeclass('sphere')
|
|
|
|
function login.init()
|
|
local actor = tangible.actor()
|
|
dprint("login.init:", actor)
|
|
tangible.animinit(actor, {bp="character", plane="earth", xyz={0, 0, 90}})
|
|
tangible.build{class=cube, xyz={500,-100,0}}
|
|
tangible.build{class=sphere, xyz={500,100,0}}
|
|
end
|
|
|
|
function engio.move(action, xyz, facing)
|
|
-- todo: sanity check the parameters.
|
|
local actor = tangible.actor()
|
|
dprint("engio.move ", action, " ", xyz[1], " ", xyz[2], " ", xyz[3])
|
|
tangible.animate(actor, nil, {action=action, xyz=xyz, facing=facing})
|
|
end
|
|
|
|
function cube.getlookat()
|
|
return { "Hotkeys", "X", "I Am a Cube" }
|
|
end
|
|
|
|
function sphere.getlookat()
|
|
return { "Hotkeys", "X", "I Am a Sphere" }
|
|
end
|
|
|
|
function engio.getlookat()
|
|
local class = tangible.getclass(tangible.place())
|
|
if class ~= nil then
|
|
local getlookat = class.getlookat
|
|
if getlookat ~= nil then
|
|
return getlookat()
|
|
end
|
|
end
|
|
return ""
|
|
end
|
|
|