mirror of
https://github.com/luanti-org/luanti.git
synced 2025-07-22 17:18:39 +00:00
Add particle animation, glow
This is implemented by reusing and extending the TileAnimation code for the methods used by particles.
This commit is contained in:
parent
c5967f75f0
commit
7279f0b373
16 changed files with 311 additions and 78 deletions
|
@ -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]"..
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue