2021-02-10 16:22:24 -05:00
|
|
|
maketangible('player')
|
|
|
|
|
|
2021-02-25 14:09:16 -05:00
|
|
|
function player.interface(actor, place)
|
2021-10-14 11:43:16 -04:00
|
|
|
-- print("actor=", actor)
|
|
|
|
|
-- print("place=", place)
|
|
|
|
|
-- print("t.actor=", tangible.actor())
|
|
|
|
|
-- print("t.place=", tangible.place())
|
2021-02-25 14:09:16 -05:00
|
|
|
gui.menu_item("north", "Go North")
|
|
|
|
|
gui.menu_item("south", "Go South")
|
|
|
|
|
gui.menu_item("east", "Go East")
|
|
|
|
|
gui.menu_item("west", "Go West")
|
2021-02-10 16:22:24 -05:00
|
|
|
end
|
|
|
|
|
|
2021-06-03 13:29:19 -04:00
|
|
|
function player:printanimstate()
|
|
|
|
|
graphic,plane,x,y,z,facing = tangible.animstate(self)
|
|
|
|
|
print("Resulting state: ", graphic, plane, x, y, z, facing)
|
|
|
|
|
end
|
|
|
|
|
|
2021-02-25 14:09:16 -05:00
|
|
|
function player.action.north(actor, place, dialog)
|
2021-02-10 16:22:24 -05:00
|
|
|
print("Moving north")
|
2021-02-25 16:32:48 -05:00
|
|
|
tangible.animate(place, {action="walk", dy=1})
|
2021-06-03 13:29:19 -04:00
|
|
|
actor:printanimstate()
|
2021-02-10 16:22:24 -05:00
|
|
|
end
|
|
|
|
|
|
2021-02-25 14:09:16 -05:00
|
|
|
function player.action.south(actor, place, dialog)
|
2021-02-10 16:22:24 -05:00
|
|
|
print("Moving south")
|
2021-02-25 16:32:48 -05:00
|
|
|
tangible.animate(place, {action="walk", dy=-1})
|
2021-06-03 13:29:19 -04:00
|
|
|
actor:printanimstate()
|
2021-02-10 16:22:24 -05:00
|
|
|
end
|
|
|
|
|
|
2021-02-25 14:09:16 -05:00
|
|
|
function player.action.east(actor, place, dialog)
|
2021-02-10 16:22:24 -05:00
|
|
|
print("Moving east")
|
2021-02-25 16:32:48 -05:00
|
|
|
tangible.animate(place, {action="walk", dx=1})
|
2021-06-03 13:29:19 -04:00
|
|
|
actor:printanimstate()
|
2021-02-10 16:22:24 -05:00
|
|
|
end
|
|
|
|
|
|
2021-02-25 14:09:16 -05:00
|
|
|
function player.action.west(actor, place, dialog)
|
2021-02-10 16:22:24 -05:00
|
|
|
print("Moving west")
|
2021-02-25 16:32:48 -05:00
|
|
|
tangible.animate(place, {action="walk", dx=-1})
|
2021-06-03 13:29:19 -04:00
|
|
|
actor:printanimstate()
|
2021-10-14 11:43:16 -04:00
|
|
|
-- print("actor=", actor)
|
|
|
|
|
-- print("place=", place)
|
|
|
|
|
-- print("t.actor=", tangible.actor())
|
|
|
|
|
-- print("t.place=", tangible.place())
|
|
|
|
|
-- wait(1)
|
|
|
|
|
-- print("actor=", actor)
|
|
|
|
|
-- print("place=", place)
|
|
|
|
|
-- print("t.actor=", tangible.actor())
|
|
|
|
|
-- print("t.place=", tangible.place())
|
2021-02-10 16:22:24 -05:00
|
|
|
end
|
2021-02-25 16:32:48 -05:00
|
|
|
|