New games every week!
JSE - First None-Jay Code! Blog
15th May 2021
Over on SoCoder, Dan sent the following JSE Code.

-=-=-

// Green-Smilies-Demo // by Dan // Created 2021/5/15 Graphics 640,480,1 Symbol 0,"1__0_0_P_P,0,PI_I,P00PI_I,P00PII7,II7,IIP00PI,WI.WI,P00PI_I,P00PI_I,P00PI_I,P00PI_I,P00PI_I,P00PII4I!4IIP00PI,4!I,P00PI_I,P0,P_P,"; Symbol 1,"1__0_0_x_x,0,xB_B,x00xB_B,x00xBB7,BB7,BBx00xB,HB.HB,x00xB_B,x00xB_B,x00xB_B,x00xB_B,x00xB,4!B,x00xBB4B!4BBx00xB,4!B,x00xB_B,x0,x_x,"; numStars = 40 dim stars(numStars,3) for i = 0 to numStars - 1 stars(i,0) = rand(640) stars(i,1) = rand(480) stars(i,2) = rand(1,5) next Rem String repeat function: for x=1 to 60 msgspc=msgspc+" " next msgtxt=msgspc+"Hi, this is a simple scroller test in the JSEngine. Enjoy the rotating smilies. This demo was written by Dan on 15.5.2021. .... 12345678901234567890"+msgspc+"Out of introtext-text error. "+msgspc SNGDAT="000000220004262008294004330006349002330004294008247004196006220002247004262008220004220006209002220004247008209004165008220004262008294004330006349002330004294008247004196006220002247004262006247002220004209006185002209004220012220012392012392006369002330004294008247004196006220002247004262008220004220006209002220004247008209004165012392012392006369002330004294008247004196006220002247004262006247002220004209006185002209004220012220012000000" SNGL= Len(SNGDAT)/6 SNGP=0 SNGSND=0 x=0 ; y=0 ; degrees=0.0 ; r_x=0 ; r_y=1 r_z=0-1 pii=3.14159265359 tt=millisec() tm=millisec() ts=millisec() msgo=0 Repeat cls for sx=1 to 40 SetCol 255,0,0 text 10+sx*13,150+(Cos((sx*pii)+sx)*radius),mid$(msgtxt,msgo+sx,1) SetCol $0,255,$0 text 10+sx*13,200+(sx*(Tan(msgo))),mid$(msgtxt,msgo+sx,1) SetCol $0,$0,255 text 10+sx*13,300-(sx*(Sin(msgo))),mid$(msgtxt,msgo+sx,1) next if millisec()-ts>48*INT(SNGPAUS) then ts=millisec() sngp=sngp+1 if sngp=>sngl then sngp=0 SNGSND=RAND(0,2) EndIf SNGNOTE=MID$(SNGDAT,SNGP*6,3) SNGPAUS=MID$(SNGDAT,(SNGP*6)+3,3) if SNGSND==0 then PlaySFX("Beep_4",int(SNGNOTE)/192,1,1) if SNGSND==1 then PlaySFX("Error",int(SNGNOTE)/172,1,1) if SNGSND==2 then PlaySFX("Beeper_Toot_Lose",int(SNGNOTE)/132,1,1) EndIf if millisec()-tm>80 then tm=millisec() msgo=msgo+0.5 if msgo>len(msgtxt) then msgo=0 EndIf if millisec()-tt>12 then tt=millisecs() r_x=r_x+r_y if r_y>0 and r_x=>250 then r_y=0-1 if r_y<0 and r_x<0 then r_y=1 EndIF radius=1+r_x Gosub 200 Gosub 100 flip Forever end 100 px=300 ; py=240 degrees = degrees + 2 for DD=0 to 360 step 8 x = (px + cos((dd*pii)+degrees) * radius) y = (py + sin((dd*pii)+degrees) * radius) SetCol y ,y ,x line px,py,x,y SetCol 255,255,255 lineto ox,oy DrawImage x,y,0 ox=x; oy=y next Return 200 for i = 0 to numStars - 1 stars(i,0) = (stars(i,0) - stars(i,2)) if stars(i,0) < 0 then stars(i,0) = stars(i,0) + 640 SetCol 45*Stars(i,2),155,255 Plot stars(i,0),stars(i,1) next Return


A happy little scroller! Hurray!!
Views 131, Upvotes 9  
Jse
New games every week!
Site credits : All of the above : Jayenkai
(c) Jayenkai 2023 and onwards, RSS feed

Blog - JSE - First None-Jay Code! - AGameAWeek