Guest User

Untitled

a guest
Aug 17th, 2017
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.97 KB | None | 0 0
  1. local do_circle = function(pos)
  2.  
  3. local size = 3
  4. local step = 4
  5.  
  6. for i = 0, 360, step do
  7.  
  8. local angle = (i * math.pi / 180)
  9. local x = size * math.cos(angle)
  10. local z = size * math.sin(angle)
  11. local newpos = {x = pos.x + x, y = pos.y, z = pos.z + z}
  12.  
  13. minetest.add_particle({
  14. pos = newpos,
  15. velocity = {x = 0, y = 0, z = 0},
  16. acceleration = {x = 0, y = 0, z = 0},
  17. expirationtime = 0.25,
  18. collisiondetection = false,
  19. texture = "default_wood.png",
  20. size = 5,
  21. glow = 15,
  22. })
  23. end
  24. end
  25.  
  26. minetest.register_node("test:block", {
  27. description = "Test Node",
  28. tiles = {"default_wood.png"},
  29. light_source = default.LIGHT_MAX,
  30. groups = {dig_immediate = 3},
  31. on_construct = function(pos)
  32. minetest.get_node_timer(pos):start(0.4) -- start timer
  33. end,
  34. on_timer = function(pos, elapsed)
  35. do_circle(pos)
  36. minetest.get_node_timer(pos):start(1.0) -- set timer to every 1 second
  37. end,
  38. -- unaffected by explosions
  39. on_blast = function() end,
  40. })
Advertisement
Add Comment
Please, Sign In to add comment