̬̬̬̈̬̬̬̬̈̬̬̬̬̬̪쬪̬̬̬̪쬪 = ?ͼͻݼͻݬ񈈘̼̪̼̼̼̻̼̻̻̼̻̻̼̼̻̼̼̼̼񈈘̼̼̼̼̼̼̼̼̼̻̼̼̼̻̻̼̻񈈘ͱͻݽݻݭݪݭ̪񈈘-- title: time sync -- author: borb -- desc: run in two windows to sync two cartridges -- script: lua --------------------------- ----change these values---- --------------------------- --number of screens screens_x=2 screens_y=1 --size of bezels in pixels w_bezel=0 h_bezel=0 --------------------------- --------------------------- w_screen=240+w_bezel h_screen=136+h_bezel w_world=240*screens_x+w_bezel*(screens_x-1) h_world=136*screens_y+h_bezel*(screens_y-1) balls={} ball=function(x,y,r,c) return{ r=r,col=c, init=function(e) e.x,e.y=x,y e.x0,e.y0=x,y e.dx,e.dy=1,1 end, upd=function(e) if e.xw_world-e.r then e.dx=-1 end if e.yh_world-e.r then e.dy=-1 end e.x=e.x+e.dx e.y=e.y+e.dy end, drw=function(e) circ(e.x-cam.x,e.y-cam.y,e.r,e.col) end } end cam={x=0,y=0} t_start=0 for i=1,100 do local r=5 a=ball( (10+i*4)%(w_world-r*2)+r, (10+i*4)%(h_world-r*2)+r, r,i%8+8 ) a:init() table.insert(balls,a) end function TIC() local t_countdown=(t_start-tstamp())//1 if btn(4) then if fft then sfx(0,"C-2",15,0,5) else reseting=true t_start=(tstamp()+5)//5*5 end end if btnp(0) then cam.y=math.max(cam.y-h_screen,0)end if btnp(1) then cam.y=cam.y+h_screen end if btnp(2) then cam.x=math.max(cam.x-w_screen,0)end if btnp(3) then cam.x=cam.x+w_screen end if (fft and fft(3)>0.8)or(reseting and t_countdown==0)then for i,e in ipairs(balls)do e:init() end reseting=false end cls(1) for i,e in ipairs(balls)do e:upd() end for i,e in ipairs(balls)do e:drw() end if reseting then print(t_countdown,1,1,12,true,1,true)end end