Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Happy Easter QB64 fans!
#1
Code: (Select All)
_Title "Eggs o Dozens" 'b+ 2022-03-30 mod
Randomize Timer
Const Xmax = 1200, Ymax = 400, Pi = _Pi
Screen _NewImage(Xmax, Ymax, 32)
_ScreenMove 100, 100
scale = 96
Do
    Cls
    For y = 100 To 300 Step 200
        For x = 100 To 1100 Step 200
            drawEasterEgg x, y, Rnd * .75 * scale + .25 * scale, Rnd * 2 * Pi
        Next
    Next
    _Delay 1
Loop Until _KeyDown(27)

Sub drawEasterEgg (xc, yc, scale, radianAngle)
    r = Rnd: g = Rnd: b = Rnd
    For x = -1 To 1 Step .01
        For y = -1 To 1 Step .01
            If x < 0 Then c = c + .0005 Else c = c - .0005
            If (x * x + (1.4 ^ x * 1.6 * y) ^ 2 - 1) <= .01 Then
                If y > 0 Then
                    Color _RGB32(128 * (1 - y) + 128 * (1 - y) * Sin(c * r), 128 * (1 - y) + 128 * (1 - y) * Sin(c * g), 127 * (1 - y) + 127 * (1 - y) * Sin(c * b))
                Else
                    Color _RGB32(128 + 128 * Sin(c * r), 128 + 128 * Sin(c * g), 127 + 127 * Sin(c * b))
                End If
                a = _Atan2(y, x)
                d = scale * Sqr(x * x + y * y)
                Line (xc + d * Cos(a + radianAngle), yc + d * Sin(a + radianAngle))-Step(1, 1)
            End If
        Next
    Next
End Sub

   

Hidden in this program is an Easter egg or 2 Smile
b = b + ...
Reply
#2
HAPPY EASTER @bplus

That's egg great algorithm for drawing eggs.

Thought I would try to beat @Pete to the puns.
grymmjack (gj!)
GitHubYouTube | Soundcloud | 16colo.rs
Reply
#3
Yeah hes scrambbling to get over easy.
b = b + ...
Reply
#4
Yoke!  Yoke!  Yoke!   Dat's punny!
Reply
#5
(04-20-2025, 05:22 PM)SMcNeill Wrote: Yoke!  Yoke!  Yoke!   Dat's punny!

Ok, 'nuff of those wisecracked yokes! Fryday was bad enuff!
(sorry Steve, I poached your pun)
Of all the places on Earth, and all the planets in the Universe, I'd rather live here (Perth, Western Australia.) Big Grin
Please visit my Website at: http://oldendayskids.blogspot.com/
Reply
#6
(04-21-2025, 01:59 AM)PhilOfPerth Wrote: (sorry Steve, I poached your pun)

Man, that's being hard boiled!  

Why everyone so mean to me?  It's almost like I have a cross to bear or something.  I'm going to lay down and may not rise again for three days at this rate!
Reply
#7
Very pretty! Can we add other patterns (leopard spots? tiger stripes? cow?) or have it create 3-D eggs and rotate them along different axes on the screen?  Big Grin

Or how about an isometric egg hunt game where the rggs you find have the generated patterns?
Reply




Users browsing this thread: 1 Guest(s)