! XMas2015.bas ! Aat Don 2015 GR.OPEN 255,0,0,0,0,0 PAUSE 1000 GR.SCREEN w,h ScaleX=900 ScaleY=h/w*ScaleX sx=w/ScaleX sy=h/ScaleY GR.SCALE sx,sy WAKELOCK 3 DataPath$="../../XMas2014/data/" AUDIO.LOAD song,DataPath$+"12days.mp3" AUDIO.STOP AUDIO.PLAY song SOUNDPOOL.OPEN 1 SOUNDPOOL.LOAD pling,DataPath$+"sound.mp3" FONT.LOAD Fnt1,DataPath$+"ANDROID ROBOT.ttf" FONT.LOAD Fnt2,DataPath$+"CROCHET PATTERN.ttf" LIST.CREATE N,hatpntr1 LIST.ADD hatpntr1,587,275,620,235,680,200,710,330,670,250,642,285 LIST.CREATE N,hatpntr2 LIST.ADD hatpntr2,583,275,617,230,683,195,713,335,660,254,647,285 GR.SET.STROKE 5 GR.COLOR 255,255,0,0,0 GR.RECT g,ScaleX/2-75,ScaleY/2-75,ScaleX/2+75,ScaleY/2+75 GR.TEXT.SIZE 40 GR.COLOR 255,255,255,0,1 GR.TEXT.DRAW g,300,450,"december 2015....." GR.TEXT.SETFONT Fnt1 GR.SET.STROKE 20 GR.CLIP p1,ScaleX/2-75,ScaleY/2-75,ScaleX/2+75,ScaleY/2+75,0 !Sky GR.COLOR 255,0,130,200,1 GR.RECT g,0,0,ScaleX,ScaleY !Snow FOR i=0 to 280 STEP 5 IF i/2>100 THEN c=105 ELSE c=i/2 ENDIF GR.COLOR 255,150+c,150+c,150+c,1 GR.LINE g,0,300+i,900,300+i NEXT i GR.RECT g,0,580,900,700 GR.RENDER DO AUDIO.POSITION.CURRENT pos UNTIL pos>4000 !Stars FOR i=1 to 50 GR.COLOR 100+RND()*155,255,255,255,1 GR.CIRCLE g,RND()*900,RND()*270,RND()*4+1 NEXT i !Moon GR.SET.STROKE 12 GR.COLOR 200,255,255,255,1 GR.ARC g,500,70,570,150,-70,180,1 GR.COLOR 255,0,130,200,1 GR.ARC g,500,50,550,150,-70,180,1 GR.COLOR 255,255,0,0,1 GR.RENDER FOR i=0 TO ScaleX/2-70 STEP 20 GR.MODIFY p1,"left",ScaleX/2-75-i,"top",ScaleY/2-75-ScaleY/ScaleX*i,"right",ScaleX/2+75+i,"bottom",ScaleY/2+75+ScaleY/ScaleX*i GR.RENDER PAUSE 200 NEXT i DO AUDIO.POSITION.CURRENT pos UNTIL pos>10000 !text GR.TEXT.SIZE 120 GR.COLOR 255,255,255,0,1 GR.TEXT.DRAW txt,50,300,"Happy 2016 !" GR.HIDE txt GR.TEXT.SETFONT "serif","BI" GR.TEXT.SIZE 35 GR.COLOR 255,0,0,0,1 GR.TEXT.DRAW greet,370,190,"Season's Greetings" GR.HIDE greet !Mountains Amplitude=50 WaveLength=600 FOR i=250 to 1150 step 10 y1=Amplitude*SIN(2*PI()*i/WaveLength) GR.COLOR 255,0,30+y1/4,100+y1/2,1 GR.LINE g,i-250,300,i-250,y1+150+i/10 GR.OVAL g,i-260,y1+130+i/10,i-245,y1+170+i/10 NEXT i GR.RENDER DO AUDIO.POSITION.CURRENT pos UNTIL pos>15000 !Lake Amplitude=20 WaveLength=800 GR.COLOR 50,0,100,170,1 FOR i=0 to 1000 y1=Amplitude*SIN(2*PI()*i/WaveLength) GR.LINE g,i,300,i,y1+300+i/10 NEXT i GR.RENDER DO AUDIO.POSITION.CURRENT pos UNTIL pos>18000 !Trees FOR i=50 to 950 STEP 50 y1=Amplitude*SIN(2*PI()*i/WaveLength) OffDown=RND()*20 OffUp=RND()*20 OffWidth=RND()*10 GR.COLOR 255,165,40,40,1 GR.SET.STROKE OffWidth/2+2 GR.LINE g,i,y1+280+i/10-OffDown,i,y1+330+i/10 GR.COLOR 200,195,195,155,1 GR.OVAL g,i-6-OffWidth,y1+255+i/10-OffUp,i+6+OffWidth,y1+300+i/10-OffDown GR.COLOR 255,0,55,0,1 GR.OVAL g,i-5-OffWidth,y1+260+i/10-OffUp,i+5+OffWidth,y1+300+i/10-OffDown NEXT i GR.RENDER DO AUDIO.POSITION.CURRENT pos UNTIL pos>20000 !Snowman GR.SET.STROKE 3 GR.COLOR 255,255,255,255,1 GR.CIRCLE g,600,440,80 GR.COLOR 255,55,55,55,0 GR.CIRCLE g,600,440,80 GR.COLOR 255,255,255,255,1 GR.CIRCLE g,610,340,60 GR.COLOR 255,55,55,55,0 GR.CIRCLE g,610,340,60 GR.RENDER DO AUDIO.POSITION.CURRENT pos UNTIL pos>22000 !Shawl GR.SET.STROKE 31 GR.COLOR 255,55,55,55,0 GR.ARC g,470,390,620,490,-28,50,0 GR.SET.STROKE 24 GR.COLOR 255,255,55,55,0 GR.ARC g,470,390,620,490,-30,46,0 GR.SET.STROKE 31 GR.COLOR 255,55,55,55,0 GR.ARC g,480,390,630,490,-28,64,0 GR.SET.STROKE 24 GR.COLOR 255,255,55,55,0 GR.ARC g,480,390,630,490,-30,60,0 GR.SET.STROKE 31 GR.COLOR 255,55,55,55,0 GR.ARC g,537,277,683,413,38,116,0 GR.SET.STROKE 24 GR.COLOR 255,255,55,55,0 GR.ARC g,537,277,683,413,40,112,0 GR.RENDER DO AUDIO.POSITION.CURRENT pos UNTIL pos>23000 !buttons GR.SET.STROKE 3 GR.COLOR 255,55,55,55,1 GR.CIRCLE g,560,430,7 GR.CIRCLE g,550,460,7 GR.CIRCLE g,555,490,7 GR.RENDER DO AUDIO.POSITION.CURRENT pos UNTIL pos>24000 !arms GR.ROTATE.START 20,540,410 GR.SET.STROKE 17 GR.COLOR 255,55,55,55,1 GR.LINE g,540,410,483,410 GR.SET.STROKE 10 GR.COLOR 255,160,60,60,1 GR.LINE g,536,410,486,410 GR.ROTATE.END GR.SET.STROKE 5 GR.LINE g,510,395,500,375 GR.LINE g,510,390,480,410 GR.SET.STROKE 14 GR.COLOR 255,55,55,55,1 GR.LINE g,725,420,663,420 GR.SET.STROKE 7 GR.COLOR 255,160,60,60,1 GR.LINE g,721,420,666,420 GR.SET.STROKE 3 GR.LINE g,720,420,740,420 GR.LINE g,700,420,740,400 GR.LINE g,680,420,720,450 GR.RENDER DO AUDIO.POSITION.CURRENT pos UNTIL pos>25000 !eyes GR.COLOR 255,55,55,55,1 GR.CIRCLE g,580,320,7 GR.CIRCLE g,610,330,7 GR.RENDER DO AUDIO.POSITION.CURRENT pos UNTIL pos>26000 !nose GR.SET.STROKE 8 GR.COLOR 255,55,55,55,1 FOR i=335 TO 350 GR.LINE g,527,330,593,i NEXT i GR.SET.STROKE 3 GR.COLOR 255,230,120,0,1 FOR i=335 TO 350 GR.LINE g,530,330,590,i NEXT i GR.RENDER DO AUDIO.POSITION.CURRENT pos UNTIL pos>27000 !mouth GR.COLOR 255,55,55,55,1 GR.CIRCLE g,565,355,5 GR.CIRCLE g,574,362,5 GR.CIRCLE g,582,363,5 GR.CIRCLE g,595,361,5 GR.RENDER DO AUDIO.POSITION.CURRENT pos UNTIL pos>28000 !hat GR.CIRCLE g,710,335,16 GR.COLOR 255,200,200,200,1 GR.CIRCLE g,710,335,12 GR.SET.STROKE 5 GR.COLOR 255,55,55,55,1 GR.POLY g,hatpntr2 GR.COLOR 255,255,55,55,1 GR.POLY g,hatpntr1 GR.SET.STROKE 35 GR.COLOR 255,55,55,55,0 GR.ROTATE.START 20,570,190 GR.ARC g,570,190,700,270,35,80,0 GR.COLOR 255,225,225,225,0 GR.SET.STROKE 26 GR.ARC g,570,190,700,270,38,74,0 GR.ROTATE.END GR.RENDER DO AUDIO.POSITION.CURRENT pos UNTIL pos>35000 !tree GR.SET.STROKE 20 GR.COLOR 255,160,60,60,1 GR.LINE g,250,410,250,500 GR.COLOR 255,0,125,0,1 FOR i=0 TO 300 STEP 30 GR.ARC g,100+i,150-i*2,400-i,450-i,30,120,1 NEXT i GR.RENDER DO AUDIO.POSITION.CURRENT pos UNTIL pos>38000 !decorations !baubles GR.TEXT.SIZE 50 FOR i=1 TO 21 READ.NEXT x,y GR.COLOR 255,255-RND()*60,215+RND()*60,RND()*60,1 GR.TEXT.DRAW g,x,y,CHR$(10040+RND()*11) GR.RENDER SOUNDPOOL.PLAY n1,pling,0.99*RND(),0.99*RND(),1,0,1 DO AUDIO.POSITION.CURRENT pos UNTIL pos>39000+i*500 NEXT i !pick GR.TEXT.SIZE 100 GR.COLOR 255,255,215,0,1 GR.TEXT.DRAW pick,205,160,CHR$(10021) GR.RENDER FOR i=1 TO 5 PAUSE 300 GR.HIDE pick GR.RENDER SOUNDPOOL.PLAY n1,pling,0.99,0.99,1,0,1 PAUSE 300 GR.SHOW pick GR.RENDER SOUNDPOOL.PLAY n1,pling,0.99,0.99,1,0,1 NEXT i DO AUDIO.POSITION.CURRENT pos UNTIL pos>60000 !let it snow GR.SHOW txt GR.COLOR 200,255,255,255,1 GR.BITMAP.CREATE snow,900,1200 GR.BITMAP.DRAW snowObj,snow,0,-1200 Q=0 FOR i=-1200 TO 0 STEP 10 GR.BITMAP.DRAWINTO.START snow FOR j=0 TO 900 STEP 20 GR.CIRCLE g,j+RND()*10-5,-i+RND()*10-5,RND()*3+1 NEXT j GR.BITMAP.DRAWINTO.END GR.MODIFY snowObj,"y",i !show message GR.MODIFY txt,"y",INT((-i/6+90)/10)*10 ! alternate greeting IF Q=1 THEN GR.HIDE greet Q=0 ELSE GR.SHOW greet Q=1 ENDIF GR.RENDER PAUSE 500 NEXT i TIMER.CLEAR PAUSE 500 GR.HIDE snowObj GR.TEXT.SETFONT Fnt2 GR.TEXT.SIZE 60 GR.COLOR 255,0,0,0,1 GR.TEXT.DRAW g,250,520,"Hit screen to exit" GR.RENDER FONT.DELETE FONT.DELETE DO GR.TOUCH Touched,x,y UNTIL Touched DO GR.TOUCH Touched,x,y UNTIL !Touched WAKELOCK 5 GR.CLOSE AUDIO.STOP EXIT READ.DATA 240,210,210,230,190,270,225,275,265,280,180,310,200,320,230,340,280,310,160,350,200,350 READ.DATA 290,360,260,380,210,400,140,400,160,430,210,440,250,445,290,440,310,420,330,380