ÎÌÌÌ̈ˆˆ¬ªªª¬ˆˆˆ¬ÌÌ̬ÌÀ̬ÌÀ̬ÌÀÌÌÌìÌÀÀî̬ÀÌÀ¬ÀÀÀ¬ÀÀÀ¬ÀÀÎÌÌÌ̈ˆˆ¬ªªª¬ˆˆˆ¬ÌÌ̬ÌÌ̬ÌÀ̬ÌÀÌÌÌìÌÀÀî̬ÀÌ̬ÀÀÀ¬ÀÀÀ¬ÀÀ¬ÌÌ̬ªªª¬ª¬ª¬ªÊ̬ªªªŒˆˆˆÌÀÌÎÌÌÎ̬̪ªÀ쬪ÀÀÀÌîÀìîÌÌîî¬ÌÌ̬ªªª¬ª¬ª¬ªÊ̬ªªªŒˆˆˆÌÀÌÎÌÌÎ̬̪ªÀ쬪ÀÀÀÌîÀìîÌÌîî >î.ffffff`fffffffffff`fffffff`fffffffffffffffffffffffffffffffffffffffffffffff`fffffff`fffffffffffff`fffffffffffÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌ$-- title: red-green light -- author: - -- desc: jump with up key -- script: lua t=0 cx=120 cy=68 r=8 col=2 sec=0 px=25 py=cy+30 isjump=false i=0 xs=0 ys=0 red=true ok=false parti={} function TIC() if t==60 then t=0 sec=sec+1 end if sec==1 then sec=0 if col==2 then col=6 red=false else col=2 red=true end end if isjump and red and not ok then ok=true die() end cls() if ok then drawPart() print("you lose",cx-20,cy,12) return end circ(cx,cy,r,col) rect(px-3,py-3,6,6,12) if px>240 then cls() print("you win",cx-20,cy,12) end if isjump then jump() end if btn(0) and not isjump then isjump=true i=0 xs=px ys=py end drawPart() t=t+1 end function die() for k=1,40 do part(px,py,12) end end function jump() i=i+0.1 px=xs+(i*10) py=ys-(math.sin(i)*20) if i>=math.pi then isjump=false end end function drawPart() local toDelete={} for i=1,#parti do local p=parti[i] circ(p.x,p.y,p.size/5,p.c) p.x=p.x+math.cos(p.d)*(p.spd*p.size) p.y=p.y+math.sin(p.d)*(p.spd*p.size) p.spd=p.spd*0.9 p.size=p.size-1 if p.size<=0 then table.insert(toDelete,i) end end for i=#toDelete,1,-1 do table.remove(parti,toDelete[i]) end end function part(x,y,c) table.insert(parti,{x=x,y=y,d=math.random()*2*math.pi,size=50+math.random(20),spd=0.02+0.03*math.random(),c=c}) end