From 526eedf98e45fc3b0ad768ecb1d0cbc1968def2f Mon Sep 17 00:00:00 2001 From: Perttu Ahola Date: Sat, 12 Nov 2011 11:59:56 +0200 Subject: Scripting WIP --- data/scripts/default.lua | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'data/scripts') diff --git a/data/scripts/default.lua b/data/scripts/default.lua index baf541f46..c35558341 100644 --- a/data/scripts/default.lua +++ b/data/scripts/default.lua @@ -163,6 +163,12 @@ function TNT:on_punch(hitter) end -- Called when object is right-clicked +function TNT:on_rightclick(clicker) + pos = self.object:getpos() + pos = {x=pos.x, y=pos.y+0.1, z=pos.z} + self.object:moveto(pos) +end +--[[ function TNT:on_rightclick(clicker) print("TNT:on_rightclick()") print("self: "..dump(self)) @@ -173,6 +179,7 @@ function TNT:on_rightclick(clicker) pos = {x=pos.x+0.5+1, y=pos.y+0.5, z=pos.z+0.5} --minetest.env:add_node(pos, 0) end +--]] print("TNT dump: "..dump(TNT)) -- cgit v1.2.3