Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
QBJS Swimming fish with Kelp
#11
@bplus my goodness you are so talented. 134 lines, and it's endlessly entertaining.

how the hell do you consistently keep making amazing stuff so small?

:not worthy:
grymmjack (gj!)
GitHubYouTube | Soundcloud | 16colo.rs
Reply
#12
it even has parallax and fish swim in front of and behind the kelp.

Heart 

stunning!
grymmjack (gj!)
GitHubYouTube | Soundcloud | 16colo.rs
Reply
#13
parallax? are you referring to the underwater effect made by changing the letters in the kelp? 

Quote:@bplus my goodness you are so talented. 134 lines, and it's endlessly entertaining.

how the hell do you consistently keep making amazing stuff so small?

@grymmjack you might like this if you haven't seen it yet. (We were discussing at another forum dbox has really nice fix with pset for QBJS but here is QB64 version:

Particle Fountain (42 LOC):
Code: (Select All)
_Title "Particle Fountain" 'b+ 2020-08-27
Const nP = 50000
Type particle
    x As Single
    y As Single
    dx As Single
    dy As Single
    r As Single
    c As _Unsigned Long
End Type
Dim Shared p(1 To nP) As particle
Screen _NewImage(800, 600, 32)
_Delay .25
_ScreenMove _Middle
For i = 1 To nP
    new i
Next
Color , &HFF002200
Do
    Cls
    If lp < nP Then lp = lp + 100
    For i = 1 To lp
        p(i).dy = p(i).dy + .1
        p(i).x = p(i).x + p(i).dx
        p(i).y = p(i).y + p(i).dy
        If p(i).x < 0 Or p(i).x > _Width Then new i
        If p(i).y > _Height And p(i).dy > 0 Then
            p(i).dy = -.75 * p(i).dy: p(i).y = _Height - 5
        End If
        Circle (p(i).x, p(i).y), p(i).r, p(i).c
    Next
    _Display
    _Limit 60
Loop Until _KeyDown(27)
Sub new (i)
    p(i).x = _Width / 2 + Rnd * 20 - 10
    p(i).y = _Height + Rnd * 5
    p(i).dx = Rnd * 1 - .5
    p(i).dy = -10
    p(i).r = Rnd * 3
    p(i).c = _RGB32(50 * Rnd + 165, 50 * Rnd + 165, 255)
End Sub
b = b + ...
Reply
#14
(08-17-2023, 12:14 AM)bplus Wrote: parallax? are you referring to the underwater effect made by changing the letters in the kelp? 

Quote:@bplus my goodness you are so talented. 134 lines, and it's endlessly entertaining.

how the hell do you consistently keep making amazing stuff so small?

@grymmjack you might like this if you haven't seen it yet. (We were discussing at another forum dbox has really nice fix with pset for QBJS but here is QB64 version:

Particle Fountain (42 LOC):
wow i am speechless. Heart
grymmjack (gj!)
GitHubYouTube | Soundcloud | 16colo.rs
Reply
#15
bplus Wrote:parallax? are you referring to the underwater effect made by changing the letters in the kelp? 
No, the movement of things in different depths of field. Slower, faster, but somehow adding dimension to the illusion to create that depth besides the z-indexing (where it's in front or in back) alone.
grymmjack (gj!)
GitHubYouTube | Soundcloud | 16colo.rs
Reply
#16
(08-17-2023, 01:21 AM)grymmjack Wrote:
bplus Wrote:parallax? are you referring to the underwater effect made by changing the letters in the kelp? 
No, the movement of things in different depths of field. Slower, faster, but somehow adding dimension to the illusion to create that depth besides the z-indexing (where it's in front or in back) alone.

Well happy accident or wishful seeing from random speeds and coloring. 

We could do that on purpose and what a marvelous idea too! 
Add a z factor for speeds and color and putting fish behind the kelp or in front.

Update: Oh I did do that! without a Z, I used the color to decide in front of kelp or behind and fast or slow.
Wow I am so old I forgot how smart I was. ;-))
b = b + ...
Reply
#17
(08-15-2023, 06:38 PM)dbox Wrote: The more I think about it the more inclined I am to change the way this is working in the next release of QBJS to increase compatibility with QB64.  I think instead of extending the array to also support associative arrays (dictionaries), I'll pull this functionality out into a new type called Dictionary.  Then I can implicitly convert any index values passed to an array to an integer, just as in QB64.
Actually, I take that back...  So as not to introduce a new keyword that could have other backwards compatibility challenges, I think I will just continue to use the array syntax.  However, if no sizing is specified (e.g.  dim lookup() As String) then I will assume it is an associative array (dictionary).  Otherwise, we'll assume it is a normal QBasic style array and implicitly convert the index values to integers.  This should make it more compatible in the future with examples like @bplus shared.

Here is what it looks like if you want to create a dictionary:
Reply
#18
(08-17-2023, 12:14 AM)bplus Wrote: parallax? are you referring to the underwater effect made by changing the letters in the kelp? 

Quote:@bplus my goodness you are so talented. 134 lines, and it's endlessly entertaining.

how the hell do you consistently keep making amazing stuff so small?

@grymmjack you might like this if you haven't seen it yet. (We were discussing at another forum dbox has really nice fix with pset for QBJS but here is QB64 version:

Particle Fountain (42 LOC):
Code: (Select All)
_Title "Particle Fountain" 'b+ 2020-08-27
Const nP = 50000
Type particle
    x As Single
    y As Single
    dx As Single
    dy As Single
    r As Single
    c As _Unsigned Long
End Type
Dim Shared p(1 To nP) As particle
Screen _NewImage(800, 600, 32)
_Delay .25
_ScreenMove _Middle
For i = 1 To nP
    new i
Next
Color , &HFF002200
Do
    Cls
    If lp < nP Then lp = lp + 100
    For i = 1 To lp
        p(i).dy = p(i).dy + .1
        p(i).x = p(i).x + p(i).dx
        p(i).y = p(i).y + p(i).dy
        If p(i).x < 0 Or p(i).x > _Width Then new i
        If p(i).y > _Height And p(i).dy > 0 Then
            p(i).dy = -.75 * p(i).dy: p(i).y = _Height - 5
        End If
        Circle (p(i).x, p(i).y), p(i).r, p(i).c
    Next
    _Display
    _Limit 60
Loop Until _KeyDown(27)
Sub new (i)
    p(i).x = _Width / 2 + Rnd * 20 - 10
    p(i).y = _Height + Rnd * 5
    p(i).dx = Rnd * 1 - .5
    p(i).dy = -10
    p(i).r = Rnd * 3
    p(i).c = _RGB32(50 * Rnd + 165, 50 * Rnd + 165, 255)
End Sub
  i never knew about _title, crap!
Reply
#19
"i never knew about _title, crap!"

Also you might not know, if you start a new program with a _Title at the top the IDE will suggest that title for filename when you go to save the code file.
b = b + ...
Reply
#20
(08-17-2023, 12:00 AM)grymmjack Wrote: @bplus my goodness you are so talented. 134 lines, and it's endlessly entertaining.

how the hell do you consistently keep making amazing stuff so small?

:not worthy:

That's right.  Don't let the size of his code fool you.  It is small, but mighty.

Warms my heart when a fella does not have small code syndrome.  Or big code syndrome.  Six of one half a dozen of the other?
Reply




Users browsing this thread: 1 Guest(s)