Spawn particles on teleportation
This commit is contained in:
parent
904b226f00
commit
c56346c8e2
26
init.lua
26
init.lua
@ -13,8 +13,34 @@ function teletool.teleport(player, pointed_thing)
|
||||
local over2 = minetest.get_node({x=pos.x,y=pos.y+2,z=pos.z})
|
||||
local src = player:getpos()
|
||||
local dest = {x=pos.x, y=math.ceil(pos.y)-0.5, z=pos.z}
|
||||
minetest.add_particlespawner({
|
||||
amount = 25,
|
||||
time = 0.1,
|
||||
minpos = {x=src.x-0.4, y=src.y+0.25, z=src.z-0.4},
|
||||
maxpos = {x=src.x+0.4, y=src.y+0.75, z=src.z+0.4},
|
||||
minvel = {x=-0.1, y=-0.1, z=-0.1},
|
||||
maxvel = {x=0, y=0.1, z=0},
|
||||
minexptime=1,
|
||||
maxexptime=1.5,
|
||||
minsize=1,
|
||||
maxsize=1.25,
|
||||
texture = "teletool_particle_departure.png",
|
||||
})
|
||||
minetest.sound_play( {name="teletool_teleport1", gain=1}, {pos=src, max_hear_distance=12})
|
||||
player:setpos(dest)
|
||||
minetest.add_particlespawner({
|
||||
amount = 25,
|
||||
time = 0.1,
|
||||
minpos = {x=dest.x-0.4, y=dest.y+0.25, z=dest.z-0.4},
|
||||
maxpos = {x=dest.x+0.4, y=dest.y+0.75, z=dest.z+0.4},
|
||||
minvel = {x=0, y=-0.1, z=0},
|
||||
maxvel = {x=0.1, y=0.1, z=0.1},
|
||||
minexptime=1,
|
||||
maxexptime=1.5,
|
||||
minsize=1,
|
||||
maxsize=1.25,
|
||||
texture = "teletool_particle_arrival.png",
|
||||
})
|
||||
minetest.after(0.5, function(dest) minetest.sound_play( {name="teletool_teleport2", gain=1}, {pos=dest, max_hear_distance=12}) end, dest)
|
||||
end
|
||||
|
||||
|
BIN
textures/teletool_particle_arrival.png
Normal file
BIN
textures/teletool_particle_arrival.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 151 B |
BIN
textures/teletool_particle_departure.png
Normal file
BIN
textures/teletool_particle_departure.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 121 B |
Loading…
x
Reference in New Issue
Block a user