Ÿ""""""""""""""""""""""""333333333333333333333333DDDDDDDDDDDDDDDDDDDDDDDDwwwwwwwwwwwwwwwwwwwwwwww   """"""""   00033333333000@@@DDDDDDDD@@@pppwwwwwwwwppp    0000000@@@@@@@ppppppp     00000000@@@@@@@@ppppppppÀª ª ªDC ÐÌÍ ÐÌÍ" ""DC ÐÌÍ ÐÌÍU UUDC ÐÌÍ ÐÌÍ3 33DC ÐÌÍ ÐÌÍ DC ÐÌÍ ÐÌÍ >r>00000003330333pppwwwwwwwwppp""" """ """" " @@" @@@D""""@@@@""""@DDDD@@DDDDDDDD@@DDDD@@@@@@@DDDD@@D@DDDD@@@@"@"""""""""""" """"" """0"""0p"""0q"""""0""""ppp0pp0p0w p p p 0p0 0  p 3333   3343@ """ """"@DDDp@0C """p """ """@DDD@0@  'r  """@@t@0@ 'pp 3" @@""""p@ p 0# @@""""t@@  p'r 2! @@""p@@ ""rwp 2'" @DDD""@ ""'r 2r""""@DDD""pw1"""D""pp0@""""pp3@""""p@p@p0333@ 00333@ 000D 000 00000 003333333 0"03333333DDDD 033DDDDD 33DDpw'w33""""DDpw'w@33 """"DDp@r 3333 ""DDp@"3333 ""DDDDpt"@""""@""pDDDDp'p""""@""1333q 'pwwwG"""" @@""""1333#p pwww'0"""" @@""""10 q " 0""0 @10  " 0""0DDDD@10r " 33"3"0wDDDD@10p  """33"3"0p@@1333#r """ 0""""p@0333 " 0""""""""s0@" 0""""0p" ""0p3 ""p3 wwww""w3 wwww""0333 ww""""0333ww""""03ww03ww03wwww0wwwwp0p0p0wwww0wwwwpppwwwwwwÝ wÐ ÐÐ ÐÐ Ý ÝÐ Ð Ðw Ð ÝÝ ÝÝ Ð Ðww Ð ÝÐ Ý ÐwwÐ Ý Ð ÐÐ Ý Ð Ðm-- title: Particle Wand -- author: Zeflyn -- desc: wave the particle wand -- site: https://twitch.tv/Zeflyn -- license: MIT License (change this to your license of choice) -- version: 0.1 -- script: lua function BOOT() local mx,my = mouse() particles = {} wand = { x=mx, y=my, update=function(self) local mx, my, lmb = mouse() self.x = mx self.y = my if lmb then create_particle(mx, my) end end, draw=function(self) local _,_,lmb = mouse() if lmb then poke(0x3ffb,rnd({2,3,4,5})) else poke(0x3ffb,1) end end } end function TIC() update() draw() clean_up() end --Lifecycles function update() wand:update() for i,p in pairs(particles) do p:update() end end function draw() cls() wand:draw() for i,p in pairs(particles) do p:draw() end print("click for magic :)",8,128,13,false,1,true) end function clean_up() for i,p in pairs(particles) do if p.done then table.remove(particles,i) end end end --Factories function create_particle(x,y) local dir = {x=math.random(), y=math.random()} if rnd({0,1}) == 1 then dir.x = dir.x * -1 end if rnd({0,1}) == 1 then dir.y = dir.y * -1 end table.insert(particles, { done=false, x=x, y=y, dir=dir, s=math.random(20), lifespan=120, update=function(self) self.lifespan = self.lifespan - 1 if self.lifespan <= 0 then self.done = true end self.x = self.x + self.dir.x self.y = self.y + self.dir.y end, draw=function(self) spr(self.s,self.x-4,self.y-4,0) end }) end --Helpers function rnd(x) if type(x) == "table" then return x[math.random(#x)] else return math.random(x) end end