aboutsummaryrefslogtreecommitdiff
path: root/data
diff options
context:
space:
mode:
authorPerttu Ahola <celeron55@gmail.com>2011-11-12 02:25:30 +0200
committerPerttu Ahola <celeron55@gmail.com>2011-11-29 19:13:39 +0200
commitf145d498a6d91e3f5f3dcf921db8b74c98a7dad2 (patch)
tree8546af949d63af226fc4e858fe5678248a9f8e4a /data
parent41c91391fce65147aa7f3b5ceb7db5758709199a (diff)
downloadminetest-f145d498a6d91e3f5f3dcf921db8b74c98a7dad2.tar.gz
minetest-f145d498a6d91e3f5f3dcf921db8b74c98a7dad2.tar.bz2
minetest-f145d498a6d91e3f5f3dcf921db8b74c98a7dad2.zip
Scripting WIP
Diffstat (limited to 'data')
-rw-r--r--data/scripts/default.lua17
1 files changed, 5 insertions, 12 deletions
diff --git a/data/scripts/default.lua b/data/scripts/default.lua
index 005e9ac15..b6c6b0d89 100644
--- a/data/scripts/default.lua
+++ b/data/scripts/default.lua
@@ -155,28 +155,21 @@ end
-- Called periodically
function TNT:on_step(dtime)
- print("TNT:on_step()")
- --[[self.timer = self.timer + dtime
- if self.timer > 4.0 then
- self.to_be_deleted = true -- Environment will delete this object at a suitable point of execution
- env:explode(self.pos, 3) -- Uh... well, something like that
- end]]
+ --print("TNT:on_step()")
end
-- Called when object is punched
function TNT:on_punch(hitter)
print("TNT:on_punch()")
- --[[-- If tool is bomb defuser, revert back to being a block
- local item = hitter.inventory.get_current()
- if item.itemtype == "tool" and item.param == "bomb_defuser" then
- env:add_node(self.pos, 3072)
- self.to_be_deleted = true
- end]]
end
-- Called when object is right-clicked
function TNT:on_rightclick(clicker)
print("TNT:on_rightclick()")
+ pos = self.object:getpos()
+ print("TNT:on_rightclick(): object position: "..dump(pos))
+ 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))