Circle Dance Screensaver

Post Reply
User avatar
rbytes
Posts: 1338
Joined: Sun May 31, 2015 12:11 am
My devices: iPhone 11 Pro Max
iPad Pro 11
MacBook
Dell Inspiron laptop
CHUWI Plus 10 convertible Windows/Android tablet
Location: Calgary, Canada
Flag: Canada
Contact:

Circle Dance Screensaver

Post by rbytes »

I spent most of the day waiting for my new CHUWI dual-boot tablet to install the latest version of Windows 10. I had to do that because when I went to get SPL from the Windows store, it would not download to my pre-installed Windows 10. I looked through the command set and decided that I would try to modify some existing code instead of starting from scratch.

SPL does very fast graphics rendering. I look forward to seeing it developed further.

Code: Select all

''
Circle Dance Screensaver
by rbytes
My first SPL program
based on circles.txt by Dav
in Smart Basic examples
August 2017
''
mx,my = #.scrsize()
mr = #.min(mx,my)/7
ms = #.max(mx,my)/100
x=mx/2
y=my/2
r=#.RND(255)
g=#.RND(255)
b=#.RND(255)
z=1
x=mx/2
y=my/2
t=.0001
#.scrclear(0,0,0)

:main
> i, 1..200
  x1=#.cos(i)*z +x
  y1=#.sin(i)*z +y

  #.drawsize(#.rnd(ms))
  #.drawcolor (r/255,g/255,b/255)
'  #.drawcolor(#.rnd(1),#.rnd(1),#.rnd(1))
  #.drawcircle(x1,y1,#.rnd(mr))
  z=z+1 ; ? z > x, z = 1
  r=r+1 ; ? r> 255, r=#.RND(255)
  g=g+1 ; ? g> 255, g=#.RND(255)
  b=b+1 ; ? b> 255, b=#.RND(255)
'  ? #.scrwidth()<>x*2, main ->
  #.delay(t)
<
main ->

Attachments
Screenshot (1).png
Screenshot (1).png (3.3 MiB) Viewed 1786 times
The only thing that gets me down is gravity...

User avatar
Mr. Kibernetik
Site Admin
Posts: 4786
Joined: Mon Nov 19, 2012 10:16 pm
My devices: iPhone, iPad, MacBook
Location: Russia
Flag: Russia

Re: Circle Dance Screensaver

Post by Mr. Kibernetik »

This works nicely!

User avatar
Mr. Kibernetik
Site Admin
Posts: 4786
Joined: Mon Nov 19, 2012 10:16 pm
My devices: iPhone, iPad, MacBook
Location: Russia
Flag: Russia

Re: Circle Dance Screensaver

Post by Mr. Kibernetik »

Instead of a labeled loop like:

Code: Select all

:main
...
main->
it is possible to use usual loop without conditions - it will loop continuously:

Code: Select all

>
...
<

User avatar
rbytes
Posts: 1338
Joined: Sun May 31, 2015 12:11 am
My devices: iPhone 11 Pro Max
iPad Pro 11
MacBook
Dell Inspiron laptop
CHUWI Plus 10 convertible Windows/Android tablet
Location: Calgary, Canada
Flag: Canada
Contact:

Re: Circle Dance Screensaver

Post by rbytes »

That is a handy feature. Thanks.
The only thing that gets me down is gravity...

Post Reply