From 21f99608c94cec208a8012d3b98d7cfaa36da400 Mon Sep 17 00:00:00 2001 From: Thomas Rudin Date: Sat, 24 Aug 2019 23:14:27 +0200 Subject: [PATCH] particles --- abm.lua | 30 ++++++++++++++++++++++++++++++ init.lua | 2 +- 2 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 abm.lua diff --git a/abm.lua b/abm.lua new file mode 100644 index 0000000..a0ca19e --- /dev/null +++ b/abm.lua @@ -0,0 +1,30 @@ + +minetest.register_abm({ + label = "Telemosaic beacon effect", + nodenames = {"telemosaic:beacon"}, + interval = 2.0, + chance = 2, + catch_up = false, + action = function(pos, node, active_object_count, active_object_count_wider) + minetest.add_particlespawner({ + amount = 4, + time = 2, + minpos = vector.add(pos, {x=-0.2, y=0, z=-0.2}), + maxpos = vector.add(pos, {x=0.2, y=0, z=0.2}), + minvel = {x=0, y=1, z=0}, + maxvel = {x=0, y=2, z=0}, + minacc = {x=0, y=0, z=0}, + maxacc = {x=0, y=0, z=0}, + minexptime = 1, + maxexptime = 2, + minsize = 1, + maxsize = 1.7, + collisiondetection = false, + collision_removal = false, + object_collision = false, + vertical = false, + texture = "telemosaic_particle_arrival.png", + glow = 9 + }) + end +}) diff --git a/init.lua b/init.lua index b4627d1..4a2faa2 100644 --- a/init.lua +++ b/init.lua @@ -61,4 +61,4 @@ local modpath = minetest.get_modpath(minetest.get_current_modname()) dofile(modpath.."/teleport.lua") dofile(modpath.."/crafts.lua") - +dofile(modpath.."/abm.lua")