Add timer blocks

master
Wuzzy 2014-06-26 02:17:00 +02:00
parent 7bd641aced
commit 93af1c7442
3 changed files with 52 additions and 1 deletions

View File

@ -11,7 +11,7 @@ minetest.register_node("pseudonodes:pseudo_block", {
alpha = 0
})
minetest.register_node("pseudonodes:replacable_pseudo_block", {
description = "replacable pseudo-block",
description = "replacable fixed pseudo-block",
drawtype = "glasslike",
paramtype = "light",
tiles = { "pseudonodes_replacable_pseudo_block.png" },
@ -24,6 +24,57 @@ minetest.register_node("pseudonodes:replacable_pseudo_block", {
buildable_to = true
})
minetest.register_node("pseudonodes:pseudo_block_timer", {
description = "timed pseudo-block",
drawtype = "glasslike",
paramtype = "light",
tiles = {
{
image="pseudonodes_pseudo_block_timer_animated.png",
animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=2}
}
},
inventory_image = minetest.inventorycube("pseudonodes_pseudo_block_timer.png"),
groups = { pseudo = 1 },
sunlight_propagates = true,
walkable = false,
sounds = { dig = { name="", gain = 0 } },
alpha = 0,
on_construct = function(pos)
local timer = minetest.get_node_timer(pos)
timer:start(5)
end,
on_timer = function(pos,elapsed)
minetest.remove_node(pos)
end,
})
minetest.register_node("pseudonodes:replacable_pseudo_block_timer", {
description = "replacable timed pseudo-block",
drawtype = "glasslike",
paramtype = "light",
tiles = {
{
image="pseudonodes_replacable_pseudo_block_timer_animated.png",
animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=2}
}
},
inventory_image = minetest.inventorycube("pseudonodes_replacable_pseudo_block_timer.png"),
groups = { pseudo = 1 },
sunlight_propagates = true,
walkable = false,
sounds = { dig = { name="", gain = 0 } },
alpha = 0,
buildable_to = true,
on_construct = function(pos)
local timer = minetest.get_node_timer(pos)
timer:start(5)
end,
on_timer = function(pos,elapsed)
minetest.remove_node(pos)
end,
})
minetest.register_node("pseudonodes:switch_block_off", {
description = "switch block (off)",
drawtype = "glasslike",

Binary file not shown.

After

Width:  |  Height:  |  Size: 115 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 129 B