Fun little app I made

This is very simple but fun android app I made (with some help in optimizations) in rfo-basic… I really like the glass mode:

The formatting looks a bit messy, but this is the entire app code (fortunately, my brain can still work in BASIC :slight_smile: ) :

REM Start of BASIC! Program
INPUT “pixel size”,pz,8

DIALOG.MESSAGE “confetti”,“select mode”,c,“zigzag”,“normal”,"glass"
nm=(c<>1)
grd=(c=3)

GR.OPEN 255,0,0,0,0
GR.ORIENTATION 1
GR.SCREEN w,h
w+=5:h+=5:e=-5
POPUP "touch or drag screen to create moving dots"
LIST.CREATE n,l :LIST.CREATE n,lvx :LIST.CREATE n,lvy
GR.SET.STROKE pz
GR.SET.ANTIALIAS 0
br=50:hh=99:p5=0.5:a=255:mv=10
GR.RECT screen,0,0,w,h

!DIM tbuffer[30]
DO

!tic = CLOCK()
GR.TOUCH t,x,y

IF t

if grd
xc+=0.1

gr.color 50,hh*(1+sin(xc))+br,hh*(1+sin(xc1.2))+br,hh(1+sin(xc*1.3))+br

else
GR.COLOR a, RND()*hh+br , RND()*hh+br , RND()hh+br
endif
GR.POINT p,x,y
LIST.ADD l,p
LIST.ADD lvx, SGN(RND()-0.5)
(RND()mv+1):LIST.ADD lvy, SGN(RND()-0.5)(RND()*mv+1)
ENDIF

LIST.SIZE l,z
max = z

FOR i = 1 TO z

ii = MIN(max,i)
LIST.GET l,ii,q

IF GR_COLLISION(q,screen)

LIST.GET lvx,ii,dx
LIST.GET lvy,ii,dy
GR.MOVE q,dx,dy

ELSE

GR.HIDE q
LIST.REMOVE l,ii
IF nm
LIST.REMOVE lvx,ii
LIST.REMOVE lvy,ii
ENDIF
max–

ENDIF

NEXT

!tbuffer[MOD(ctr++,30)+1] = CLOCK()-tic
!ARRAY.AVERAGE tavg, tbuffer[]
!PRINT INT$(ctr), ROUND(tavg,1), INT$(z)

GR.RENDER

UNTIL 0

1 Like

@keepsimple Cool! Watching the colorful pixels moving around is soothing. :thumbsup:

@shutterbug You have competition in the dancing pixels department :smile:

1 Like

Phooey. No one rocks a Speedo like I do.

2 Likes