# RetroBASIC

## Basicprogramming(.org) => Code and examples => Topic started by: B+ on January 14, 2016, 07:49:47 pm

Title: Plasma Spiraling
Post by: B+ 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 latestxmax=620:ymax=608setDisplay(xmax,ymax,32,1)setcaption( "Plasma Spiraling")autoback(0)xcenter = xmax/2+8ycenter = ymax/2+8red=.2:green=.005:blue=.01:i=1 'plasma initializationdo    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 ifloop`I'd like to know if zip worked (my first one).

Title: Re: Plasma Spiraling
Post by: B+ 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 latestxmax=620:ymax=608setDisplay(xmax,ymax,32,1)setcaption( "Plasma Spiraling")autoback(0)xcenter = xmax/2+8ycenter = ymax/2+8red=0:green=85:blue=170:i=1 'plasma initializationrd=1:gd=1:bd=1:rev=-1do    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 ifloop`
Title: Re: Plasma Spiraling
Post by: johnno56 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
Title: Re: Plasma Spiraling
Post by: B+ 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.