̬̬̬̈̬̬̬̬̈̬̬  ̬̬̬̪쬪̬̬̬̪쬪 %%&')+,,,+)'&%%%//////////////A CppppC A AAAaaaaaaaa a aaa a a a a a aaa a aaaAAaa A AAAaa A A A AAAaa A A A A A A A A Ia=ca `a a a a a a a aaaaaaaaa a aaaaaAAaaAAaa A 00a A A AA a a aa0D-- title: it's alive -- author: lsquared (leon.creates.things@gmail.com) -- desc: z a p . -- site: https://www.youtube.com/@Leon-Creates -- license: MIT License -- version: 1.1 -- script: lua t=0 sx=240 sy=136 yjprev=0 N_CHARGE=11 O_CHARGE=12 charge=N_CHARGE ORBSPD1=100 ORBSPD2=50 ORBSPD3=150 LOOPTIME=20 tnow=0 timer=0.1 tstart=0 noball_message="faint zaps" oneball_message="greetings, orb" twoball_message="friend for orb!" twobolt_message="electricity noises" threebolt_message="much zap very wow" overcharge_message="overcharge!!!" message=noball_message timesec=0 music(2) sfx(0) function setpal(id,r,g,b) addr=0x3fc0+(3*id) poke(addr,r) poke(addr+1,g) poke(addr+2,b) end function BDR(y) setpal(7,29,36+(y/10),60+(y/4)) end function noball() message=noball_message end function oneball() message=oneball_message spr(5+((charge-N_CHARGE)*2), 112+math.cos(time()/(ORBSPD1- ((charge-N_CHARGE)*20)))*32, 60+math.sin(time()/(ORBSPD1- ((charge-N_CHARGE)*20)))*32, 0,1,0,0,2,2) end function twoball() message=twoball_message bolt(120+math.cos(time()/(ORBSPD1- ((charge-N_CHARGE)*20)))*32, 68+math.sin(time()/(ORBSPD1- ((charge-N_CHARGE)*20)))*32, 48+math.cos(time()/(ORBSPD2- ((charge-N_CHARGE)*20)))*16, 68+math.sin(time()/(ORBSPD2- ((charge-N_CHARGE)*20)))*16, 16,charge) spr(5+((charge-N_CHARGE)*2), 112+math.cos(time()/(ORBSPD1- ((charge-N_CHARGE)*20)))*32, 60+math.sin(time()/(ORBSPD1- ((charge-N_CHARGE)*20)))*32, 0,1,0,0,2,2) spr(5+((charge-N_CHARGE)*2), 40+math.cos(time()/(ORBSPD2- ((charge-N_CHARGE)*20)))*16, 60+math.sin(time()/(ORBSPD2- ((charge-N_CHARGE)*20)))*16, 0,1,0,0,2,2) end function twobolt() message=twobolt_message bolt(120+math.cos(time()/(ORBSPD1- ((charge-N_CHARGE)*20)))*32, 68+math.sin(time()/(ORBSPD1- ((charge-N_CHARGE)*20)))*32, 48+math.cos(time()/(ORBSPD2- ((charge-N_CHARGE)*20)))*16, 68+math.sin(time()/(ORBSPD2- ((charge-N_CHARGE)*20)))*16, 16,charge) bolt(120+math.cos(time()/(ORBSPD1- ((charge-N_CHARGE)*20)))*32, 68+math.sin(time()/(ORBSPD1- ((charge-N_CHARGE)*20)))*32, 188+math.cos(time()/(ORBSPD3- ((charge-N_CHARGE)*20)))*12, 68+math.sin(time()/(ORBSPD3- ((charge-N_CHARGE)*20)))*12, 16,charge) spr(5+((charge-N_CHARGE)*2), 112+math.cos(time()/(ORBSPD1- ((charge-N_CHARGE)*20)))*32, 60+math.sin(time()/(ORBSPD1- ((charge-N_CHARGE)*20)))*32, 0,1,0,0,2,2) spr(5+((charge-N_CHARGE)*2), 40+math.cos(time()/(ORBSPD2- ((charge-N_CHARGE)*20)))*16, 60+math.sin(time()/(ORBSPD2- ((charge-N_CHARGE)*20)))*16, 0,1,0,0,2,2) spr(5+((charge-N_CHARGE)*2), 180+math.cos(time()/(ORBSPD3- ((charge-N_CHARGE)*20)))*12, 60+math.sin(time()/(ORBSPD3- ((charge-N_CHARGE)*20)))*12, 0,1,0,0,2,2) end function threebolt() if charge==O_CHARGE then message=overcharge_message else message=threebolt_message end bolt(120+math.cos(time()/(ORBSPD1- ((charge-N_CHARGE)*20)))*32, 68+math.sin(time()/(ORBSPD1- ((charge-N_CHARGE)*20)))*32, 48+math.cos(time()/(ORBSPD2- ((charge-N_CHARGE)*20)))*16, 68+math.sin(time()/(ORBSPD2- ((charge-N_CHARGE)*20)))*16, 16,charge) bolt(120+math.cos(time()/(ORBSPD1- ((charge-N_CHARGE)*20)))*32, 68+math.sin(time()/(ORBSPD1- ((charge-N_CHARGE)*20)))*32, 188+math.cos(time()/(ORBSPD3- ((charge-N_CHARGE)*20)))*12, 68+math.sin(time()/(ORBSPD3- ((charge-N_CHARGE)*20)))*12, 16,charge) bolt(188+math.cos(time()/(ORBSPD3- ((charge-N_CHARGE)*20)))*12, 68+math.sin(time()/(ORBSPD3- ((charge-N_CHARGE)*20)))*12, 48+math.cos(time()/(ORBSPD2- ((charge-N_CHARGE)*20)))*16, 68+math.sin(time()/(ORBSPD2- ((charge-N_CHARGE)*20)))*16, 16,charge) spr(5+((charge-N_CHARGE)*2), 112+math.cos(time()/(ORBSPD1- ((charge-N_CHARGE)*20)))*32, 60+math.sin(time()/(ORBSPD1- ((charge-N_CHARGE)*20)))*32, 0,1,0,0,2,2) spr(5+((charge-N_CHARGE)*2), 40+math.cos(time()/(ORBSPD2- ((charge-N_CHARGE)*20)))*16, 60+math.sin(time()/(ORBSPD2- ((charge-N_CHARGE)*20)))*16, 0,1,0,0,2,2) spr(5+((charge-N_CHARGE)*2), 180+math.cos(time()/(ORBSPD3- ((charge-N_CHARGE)*20)))*12, 60+math.sin(time()/(ORBSPD3- ((charge-N_CHARGE)*20)))*12, 0,1,0,0,2,2) end function TIC() cls() timesec=time()/1000 circgrid((time()/10)%16, (time()/10)%16,5,16,7) circgrid(-(time()/25)%16, -(time()/25)%16,3,16,7) tnow=time() charge=N_CHARGE if math.random(500)==500 and not (timer==0) then --print "set tstart" timer=math.random(1)+1 tstart=time() end --print(timer) --print(time()/1000,0,6) if not ((tnow/1000)-(tstart/1000) >=timer) and ((timesec%LOOPTIME)>10) then --print("overcharge"..timer) charge=O_CHARGE message=overcharge_message end bolt(0,(time()/5)%136,240,(time()/5)%136,32,10) bolt(0,(time()/10)%136,240,(time()/10)%136,32,9) if (timesec%LOOPTIME)<1 then noball() elseif (timesec%LOOPTIME)<4 then oneball() elseif (timesec%LOOPTIME)<7 then twoball() elseif (timesec%LOOPTIME)<10 then twobolt() else threebolt() end print(message,70, 16+math.sin(time()/30)*3, charge-1) print(message,69,15+ math.sin(time()/30)*3,charge) end function dist(x1,y1,x2,y2) local dx=x2-x1 local dy=y2-y1 return math.sqrt(dx*dx+dy*dy) end function circgrid(xo,yo,r,s,col) for y=(-(sy/4))+yo,(sy+(sy/4))+yo,s do for x=(-(sx/4))+xo,(sx+(sx/4))+xo,s do circ(x,y,r,col) end end end function bolt(x1,y1,x2,y2,pnts,col) --doop calls the pnts variable pants --but it's actually a shortening for points local xprev=x1 local yprev=y1 for i=1,pnts-2 do local dx=x2-x1 local dy=y2-y1 local xs=dx/(pnts-1) local ys=dy/(pnts-1) local yj=math.random(33)-16 line(xprev,yprev,x1+(i*xs),y1+(i*ys)+yj,col) line(xprev,yprev-1,x1+(i*xs),(y1+(i*ys)+yj)-1,col-1) line(xprev,yprev+1,x1+(i*xs),(y1+(i*ys)+yj)+1,col-1) xprev=x1+(i*xs) yprev=y1+(i*ys)+yj end line(xprev,yprev,x2,y2,col) line(xprev,yprev-1,x2,y2-1,col-1) line(xprev,yprev+1,x2,y2+1,col-1) end