-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathparticle.lua
More file actions
40 lines (39 loc) · 1.27 KB
/
particle.lua
File metadata and controls
40 lines (39 loc) · 1.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
-- luacheck: globals euthamia minetest _ nodecore vector
local modn = minetest.get_current_modname()
euthamia.spore_distribute = function(pos,dir,mag)
if(pos and euthamia.check(pos))then
dir = dir or {x = 0, y = 0, z = 0}
mag = mag or 1
local bas = {x = 1, y = 1, z = 1}
minetest.add_particlespawner({
amount = 16,
time = 3,
minpos = {x=pos.x-0.2, y=pos.y, z=pos.z-0.2},
maxpos = {x=pos.x+0.3, y=pos.y+0.3, z=pos.z+0.3},
minvel = dir,
maxvel = vector.multiply(dir,mag/10),
minacc = {x = 0, y = 0, z = 0},
maxacc = vector.multiply(bas,mag/10),
minexptime = 4,
maxexptime = 7,
minsize = 0.1,
maxsize = 0.2,
collisiondetection = false,
collision_removal = false,
vertical = true,
texture = modn.."_spore.png",
animation = {
type = "vertical_frames",
aspect_w = 4,
aspect_h = 4,
length = 0.5},
{
type = "sheet_2d",
frames_w = 1,
frames_h = 5,
frame_length = 0.1,
},
glow = 8
})
end
end