Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Challenges
#71
(11-17-2025, 06:06 PM)Dav Wrote: Cool!  Thanks. Didn’t you get that exploding planet thing I made a couple yeras ago to work in qbjs?  I seem to recall that one some reason.  You added a sound effect or something extra I believe.
EDIT:  Found the exploding planet here: https://qb64phoenix.com/forum/showthread...7#pid19507
Oh yeah, that's a nice one!  I've added it as well as the reverse explosion one you did from the same thread:
(11-17-2025, 06:06 PM)Dav Wrote: Any code i ever post here you have my permission to adapt/incude in your qbjs project.  Qbjs is wonderful. I have the offline version on my ipad home screen.
Awesome, I'll take you up on that!
Reply
#72
Thumbs Up 
(11-17-2025, 06:28 PM)NakedApe Wrote: Great stuff, @Dav. Fun to play with! +1

Ditto from me too on reply #64, fantastic and different from what we've been doing!
  724  855  599  923  575  468  400  206  147  564  878  823  652  556 bxor cross forever
Reply
#73
Thank's, ya'll.  My wife went off to rehearsal tonight, so that gave me some free time to make one last one (I have to code on the sly...) 

- Dav

Code: (Select All)
'SinCosPlay5.bas
'Dav, Nov/2025

Screen _NewImage(_DesktopHeight, Int(_DesktopHeight * .75), 32)

cw = _Width / 2: ch = _Height / 2

n = 24 'number of layers..24 is max of what my slow laptop can do smoothly

Do
    Cls , _RGB(16, 16, 32)
    For n = 0 To n Step .3
        For i = 0 To 360 Step .2
            a = i * _Pi / 180
            rad = Sin(t + i * .002 + n * .003)
            x = cw + rad * cw * Sin(a * 2 + t * 2 + n * .2) * Sin(a)
            y = ch + rad * ch * Cos(a * 2 + t * 3 + n * .2) * Cos(a)
            'uncomment below to add rotation
            'x = cw + ((x - cw) * Cos(t) - (y - ch) * Sin(t))
            'y = ch + ((x - cw) * Sin(t) + (y - ch) * Cos(t))
            r = 127 + 127 * Sin(a * 4 + t + n * .2)
            g = 127 + 127 * Sin(a * 4 + t + n * .2 + _Pi / 3)
            b = 127 + 127 * Sin(a * 4 + t + n * .2 + 2 * _Pi / 3)
            Line (x, y)-Step(4, 4), _RGBA(r * 2, g * 2, b * 2, 5), BF
        Next
    Next
    t = t + .02
    _Display
    _Limit 30
Loop Until _KeyHit

Find my programs here in Dav's QB64 Corner
Reply
#74
+1 @Dav another wow! Amazing all the variations you come up with.
  724  855  599  923  575  468  400  206  147  564  878  823  652  556 bxor cross forever
Reply
#75
Hi @bplus.  I decided to tweak one more of these before the end of the year.  Probably last one, they are all started to look the same.  Twirling threads.  

Have a happy New Year! 

- Dav

Code: (Select All)
'SinCosPlay6.bas
'by Dav, Dec 31st/2025

Screen _NewImage(_DesktopHeight, Int(_DesktopHeight * .75), 32)

cw = _Width / 2: ch = _Height / 2

Do
    Cls

    For n = 1 To 4
        For t = 0 To 7.3 Step .01
            h = (Timer / 50 + t * 20) Mod 180
            r = 127 + 127 * Sin(h * _Pi / 180)
            g = 127 + 127 * Cos(h * _Pi / 180)
            b = 255 * Abs(Sin(t))
            x = cw + Cos(t + a * n) * (cw / 2 + 50 * Sin(t * 3 * n))
            y = ch + Sin(t + a + n) * (ch / 2 + 50 * Cos(t * 3 + n))
            rad = 10 + Sin(t * 4) * n
            r2 = rad * rad
            For y2 = -rad To rad
                x2 = Abs(Sqr(r2 - y2 * y2))
                Line (x - x2, y + y2)-(x + x2, y + y2), _RGBA(r, g, b, h), BF
            Next
        Next
    Next
    a = a + .02
    _Display
    _Limit 30
Loop While InKey$ <> Chr$(27)

Find my programs here in Dav's QB64 Corner
Reply
#76
Weird, I get an "Illegal Function on Line 22" crash.

x2 = Abs(Sqr(r2 - y2 * y2)) doesn't work on MacOS?   Huh
Reply
#77
(12-31-2025, 10:04 PM)NakedApe Wrote: Weird, I get an "Illegal Function on Line 22" crash.

x2 = Abs(Sqr(r2 - y2 * y2)) doesn't work on MacOS?   Huh

Hmm, I think that is the same radius < 1 error that happened when we were testing out the filled circle routine last year, some mac users had that.  See if this clear it up.  Add this between line 19 and 20, to keep rad from being 0.

if rad < 1 then rad = 1

- Dav

Find my programs here in Dav's QB64 Corner
Reply
#78
Here is the QBJS version, if you still can't get it working in the IDE...

- Dav


Find my programs here in Dav's QB64 Corner
Reply
#79
Dammit Dav! I warned you any re-posting of my live streaming colonoscopy would bring about con-see-quences. Prepare to hears from my lawyer, varmint!

 - Sam  Angry
Reply
#80
(12-31-2025, 11:11 PM)Pete Wrote: Dammit Dav! I warned you any re-posting of my live streaming colonoscopy would bring about con-see-quences. Prepare to hears from my lawyer, varmint!

 - Sam  Angry


Lol, I guess it does kind of look like that.  I made a version that looked like a spaghetti noodles, but I didn't want to be accused of posting spaghetti code. 

Happy New year, Pete!

- Dav

Find my programs here in Dav's QB64 Corner
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Rosetta Code Challenges bplus 15 3,353 04-29-2024, 03:03 AM
Last Post: bplus

Forum Jump:


Users browsing this thread: 1 Guest(s)