Add labels, fix tornado effect.
This commit is contained in:
parent
fcb4009ce3
commit
791087d7f1
35
demo.lua
35
demo.lua
@ -12,13 +12,17 @@ local bdesc = blackdot:gsub("%^", "\\^"):gsub(":", "\\:")
|
||||
local frame = "[combine:16x16:0,0=" .. bdesc .. ":15,0=" .. bdesc
|
||||
.. ":0,15=" .. bdesc .. ":15,15=" .. bdesc
|
||||
|
||||
local function regdemo(num, func)
|
||||
local function regdemo(num, desc, func)
|
||||
return minetest.register_node(modname .. ":demo" .. num, {
|
||||
description = desc,
|
||||
drawtype = "allfaces",
|
||||
tiles = {{name = frame, backface_culling = false}},
|
||||
groups = {[modname] = 1},
|
||||
paramtype = "light",
|
||||
sunlight_propagates = true,
|
||||
on_construct = function(pos)
|
||||
return minetest.get_meta(pos):set_string("infotext", desc)
|
||||
end,
|
||||
on_punch = function(pos) return minetest.remove_node(pos) end,
|
||||
on_demo = func
|
||||
})
|
||||
@ -34,7 +38,7 @@ minetest.register_abm({
|
||||
end
|
||||
})
|
||||
|
||||
regdemo(1, function(pos)
|
||||
regdemo(1, "ASMD ShockRifle Effect", function(pos)
|
||||
local endpos = {
|
||||
x = pos.x + math_random() * 20 - 10,
|
||||
y = pos.y + math_random() * 20 - 10,
|
||||
@ -59,9 +63,9 @@ regdemo(1, function(pos)
|
||||
})
|
||||
end)
|
||||
|
||||
regdemo(2, function(pos)
|
||||
regdemo(2, "Implosion / Teleport Arrive", function(pos)
|
||||
minetest.add_particlespawner_advanced({
|
||||
amount = 25,
|
||||
amount = 100,
|
||||
time = 0,
|
||||
pos = {
|
||||
x = {pos.x, -10, 20},
|
||||
@ -84,21 +88,26 @@ regdemo(2, function(pos)
|
||||
})
|
||||
end)
|
||||
|
||||
regdemo(3, function(pos)
|
||||
regdemo(3, "Tornado", function(pos)
|
||||
minetest.add_particlespawner_advanced({
|
||||
amount = 200,
|
||||
time = 0,
|
||||
time = 2,
|
||||
pos = {
|
||||
x = {pos.x, -10, 20},
|
||||
y = {pos.y, -10, 0, 20},
|
||||
z = {pos.z, -10, 0, 0, 20}
|
||||
x = {pos.x - 10, 0, 20},
|
||||
y = {pos.y, 0, 0, 10},
|
||||
z = {pos.z - 10, 0, 0, 0, 20}
|
||||
},
|
||||
velocity = {
|
||||
x = {0, -5, 0, 0, 10},
|
||||
y = {0, -5, 0, 10},
|
||||
z = {0, 5, -10}
|
||||
x = {-5, 0, 0, 0, 10},
|
||||
y = {0, 0, 0, 10},
|
||||
z = {5, 0, -10}
|
||||
},
|
||||
expirationtime = {1},
|
||||
acceleration = {
|
||||
x = {2.5, 0, -5},
|
||||
y = {5},
|
||||
z = {2.5, 0, 0, 0, -5}
|
||||
},
|
||||
expirationtime = {2},
|
||||
texture = blackdot,
|
||||
size = {1, 0, 0, 0, 0, 4}
|
||||
})
|
||||
|
Loading…
x
Reference in New Issue
Block a user