aboutsummaryrefslogtreecommitdiff
path: root/games/minimal/mods
diff options
context:
space:
mode:
authorsfan5 <sfan5@live.de>2017-01-14 16:48:49 +0100
committersfan5 <sfan5@live.de>2017-01-18 23:21:01 +0100
commit7279f0b37335396c85f6bdd7dc67ff56e53df0f9 (patch)
treebe0ee716cf8bc6e5379415a663db91b8a358c8ab /games/minimal/mods
parentc5967f75f0a9827d1b65b384edd6ba07c73ffd2f (diff)
downloadminetest-7279f0b37335396c85f6bdd7dc67ff56e53df0f9.tar.gz
minetest-7279f0b37335396c85f6bdd7dc67ff56e53df0f9.tar.bz2
minetest-7279f0b37335396c85f6bdd7dc67ff56e53df0f9.zip
Add particle animation, glow
This is implemented by reusing and extending the TileAnimation code for the methods used by particles.
Diffstat (limited to 'games/minimal/mods')
-rw-r--r--games/minimal/mods/experimental/init.lua37
1 files changed, 37 insertions, 0 deletions
diff --git a/games/minimal/mods/experimental/init.lua b/games/minimal/mods/experimental/init.lua
index 142734cda..5e98e1a80 100644
--- a/games/minimal/mods/experimental/init.lua
+++ b/games/minimal/mods/experimental/init.lua
@@ -523,6 +523,43 @@ minetest.register_craft({
}
})
+minetest.register_craftitem("experimental:tester_tool_2", {
+ description = "Tester Tool 2",
+ inventory_image = "experimental_tester_tool_1.png^[invert:g",
+ on_use = function(itemstack, user, pointed_thing)
+ local pos = minetest.get_pointed_thing_position(pointed_thing, true)
+ if pos == nil then return end
+ pos = vector.add(pos, {x=0, y=0.5, z=0})
+ local tex, anim
+ if math.random(0, 1) == 0 then
+ tex = "default_lava_source_animated.png"
+ anim = {type="sheet_2d", frames_w=3, frames_h=2, frame_length=0.5}
+ else
+ tex = "default_lava_flowing_animated.png"
+ anim = {type="vertical_frames", aspect_w=16, aspect_h=16, length=3.3}
+ end
+
+ minetest.add_particle({
+ pos = pos,
+ velocity = {x=0, y=0, z=0},
+ acceleration = {x=0, y=0.04, z=0},
+ expirationtime = 6,
+ collisiondetection = true,
+ texture = tex,
+ animation = anim,
+ size = 4,
+ glow = math.random(0, 5),
+ })
+ end,
+})
+
+minetest.register_craft({
+ output = 'experimental:tester_tool_2',
+ recipe = {
+ {'group:crumbly','group:crumbly'},
+ }
+})
+
--[[minetest.register_on_joinplayer(function(player)
minetest.after(3, function()
player:set_inventory_formspec("size[8,7.5]"..