 Author Topic: Plasma Spiraling  (Read 1414 times)

B+

• Guest Plasma Spiraling
« on: January 14, 2016, 07:49:47 pm »
Something from SdlBasic:
Code: [Select]
'plasma spiral.sdlbs  2015-10-5 MGA/B+ inspired by Johnno and Peter's latest
xmax=620:ymax=608
setDisplay(xmax,ymax,32,1)
setcaption( "Plasma Spiraling")
autoback(0)
xcenter = xmax/2+8
ycenter = ymax/2+8
red=.2:green=.005:blue=.01:i=1 'plasma initialization
do
a = 1: r = 0 'spiral initialization
do
Plasma=rgb(127+127*sin(red*i),127+127*sin(green*i),127+127*sin(blue*i))
ink(Plasma)
fillcircle(xcenter + r * cos(a), ycenter - r * sin(a), 16)
'screenswap    'if too flashy uncomment this
'spiral drawing
a = a + 1/a  'this is very interesting !
r =5* a
if r >= 300 then: exit do: end if
'plasma mixing
i=i+1
red=red+.2:green=green+.3:blue=blue+.4
if red>.5 then: red=.02:end if
if green>.5 then: green=.005:end if
if blue>.5 then: blue=.01:end if
loop
screenswap
if key(27) then: exit do: end if
loop
I'd like to know if zip worked (my first one).

B+

• Guest Re: Plasma Spiraling
« Reply #1 on: January 14, 2016, 08:28:26 pm »
Here is smoother version 2:
Code: [Select]
'plasma spiral v2.sdlbs  2015-10-5 MGA/B+ inspired by Johnno and Peter's latest
xmax=620:ymax=608
setDisplay(xmax,ymax,32,1)
setcaption( "Plasma Spiraling")
autoback(0)
xcenter = xmax/2+8
ycenter = ymax/2+8
red=0:green=85:blue=170:i=1 'plasma initialization
rd=1:gd=1:bd=1:rev=-1
do
a = 1: r = 0 'spiral initialization
do
ink(rgb(red,green,blue))
fillcircle(xcenter + r * cos(a), ycenter - r * sin(a), 17)
'screenswap    'if too flashy uncomment this
'spiral drawing
a = a + 1/a  'this is very interesting !
r =5* a
if r >= 300 then: exit do: end if
'plasma mixing
i=i+1
d=2
red=red+d*rd:green=green+d*gd:blue=blue+d*bd
if red>255 then: red=255:rd=rd*rev:end if
if red<0 then: red=d*(rnd(4)-1)/4:rd=rd*rev:end if
if green>255 then: green=255:gd=gd*rev:end if
if green<0 then:green=2*d*(rnd(4)-1)/4:gd=gd*rev:end if
if blue>255 then: blue=255:bd=bd*rev:end if
if blue<0 then: blue=3*d*(rnd(4)-1)/4:bd=bd*rev:end if
loop
screenswap
if key(27) then: exit do: end if
loop

johnno56

• Guest Re: Plasma Spiraling
« Reply #2 on: January 14, 2016, 09:13:35 pm »
Both zips worked just fine. Both contained the sdlbasic and exec files. Curious. How did you make the exe?

J

B+

• Guest Re: Plasma Spiraling
« Reply #3 on: January 14, 2016, 10:14:41 pm »
Both zips worked just fine. Both contained the sdlbasic and exec files. Curious. How did you make the exe?

J

Hey Johnno!

Two methods are described in help "What's New in latest release" link for creating exes. I tried the first method with new Windows 10 setup and still no luck binding the files from inside the editor. We had a discussion about this awhile back at BP.org. For myself, I rewrote the bind file .sdlbas, all it does is copy the source file to the end of sdlbrt.exe. I can not find that file yet (if I have that backed up at all).

The second method is to put sdlbrt.exe with the source file in a separate folder, rename the sdlbrt file the same as the source and you are done but you still need to keep the source with the exe, so it's 2 files.

Eventually it is cheaper storage wise to just get sdlbasic, you can do the same thing with SmallBASIC and any interpreted Basic.