Files
integration/luprex/core/lua/player.lua
2021-12-28 14:07:15 -05:00

43 lines
1.1 KiB
Lua

makeclass('player')
function player.interface(actor, place)
-- print("actor=", actor)
-- print("place=", place)
-- print("t.actor=", tangible.actor())
-- print("t.place=", tangible.place())
gui.menu_item("cb_north", "Go North")
gui.menu_item("cb_south", "Go South")
gui.menu_item("cb_east", "Go East")
gui.menu_item("cb_west", "Go West")
end
function player:printanimstate()
local graphic,plane,x,y,z,facing = tangible.animstate(self)
print("Resulting state: ", graphic, plane, x, y, z, facing)
end
function player.cb_north(actor, place, dialog)
print("Moving north")
tangible.animate(place, {action="walk", dy=1})
actor:printanimstate()
end
function player.cb_south(actor, place, dialog)
print("Moving south")
tangible.animate(place, {action="walk", dy=-1})
actor:printanimstate()
end
function player.cb_east(actor, place, dialog)
print("Moving east")
tangible.animate(place, {action="walk", dx=1})
actor:printanimstate()
end
function player.cb_west(actor, place, dialog)
print("Moving west")
tangible.animate(place, {action="walk", dx=-1})
actor:printanimstate()
end