You are not logged in or registered. Please login or register to use the full functionality of this board...
SIGN IN Join Our Community For FREE


Connett circles
04-30-2017, 11:03 PM (This post was last modified: 05-01-2017 04:00 PM by bplus.)
Post: #1
 (Print Post)
Connett circles
Sometimes it's called wallpaper and random screens are shown. Here in this example code, I start from the beginning and screen by screen show how the circles start to develop. It will show 1000 screens before cycling back to beginning.

I added a little bonus XOR Magic, should have been easy. Confused

PS, Oh! BTW QB64 blows the doors off SmallBASIC with speed, I had to create a delay subroutine.


EDIT: 2017-05-01 I just noticed the note at the start of this board not to post exe's in attached files. I have repackaged Connett circles and XOR Magic without the exe's and removed old package and replaced with new.


Attached File(s) Image(s)
       

.zip  Connett Circles.zip (Size: 1.24 KB / Downloads: 6)
Find all posts by this user
Like Post
The following 1 user Likes bplus's post:
Waltersmind (Admin)
05-01-2017, 12:32 AM
Post: #2
 (Print Post)
RE: Connett circles
bplus,

I looked at the "Connet circles.bas" file you shared and I noticed you used, "DELAY 1000" (which is a SUB) to add some delay to the animation. Well, in QB64, you no longer have to create timed delays any more. QB64 has an added command called, "_LIMIT" that does all the work for you. Here is a code snippet to show you how to use it:

Code Snippet: [Select]
DO
    _LIMIT 60 ' 60 = 60 FRAMES A SECOND

    FOR j = 0 TO ymax
        FOR i = 0 TO xmax
            '...
        NEXT
    NEXT

    '...

    _DISPLAY
    'delay 1000

    '...
LOOP

The " '... " comments just shows you had other code in that area, and that I removed them for simplicity purposes.

Also, QB64 has a the same command built in, but with an underscore before it (i.e.  _DELAY 1000).

Right after the "DO" command, you will see the "_LIMIT 60" command. This statement states that QB64 should limit it's refresh rate to 60 frames a second. You can use higher or lower values if you want. This statement should be before the _DISPLAY command, but you could put it right after. It just tells the _DISPLAY command to slow down the frame to a specific speed. Basically, you can look at like the _LIMIT command sets a delay flag for _DISPLAY command, and the _DISPLAY command acts accordingly. Once the _DISPLAY command is ran, it turns the delay like flag to off (and I am just making simple here without trying to overwhelm you with the internal workings of QB64), and so _LIMIT will need to be called again for there to be a delay. If the _LIMIT command is not used, then QB64 will refresh the screen every single time it is called, which things could get choppy.

On another note, after running your demo with DELAY 1000 and _LIMIT 60, there is not difference. Also, the demo ran at the same speed with only the _DISPLAY command. It appears to be drawing once every second anyway without any delays.

I love your BASIC version of the XOR squares, it was brilliant!

My goal is to bring joy, excitement, fun and education to all computer programming hobbyists, tinkerers, and amateurs. I also enjoy helping and working with those who aspire at becoming masters of their craft.
Find all posts by this user
Like Post
The following 1 user Likes Waltersmind's post:
bplus
05-01-2017, 01:54 AM (This post was last modified: 05-01-2017 01:56 AM by bplus.)
Post: #3
 (Print Post)
RE: Connett circles
Walter thanks for feedback and tip on _DELAY. According to help, delay is called with number of seconds, does that allow small fractions say _DELAY .0167 or 1/60 of second. Oh, systems are different and judging by some feedback I get, my seem strange sometimes. Wait til Johnno56 reports how fast his machine runs things! For me, my delay sub did slow down screens from maybe 3 per sec to 1, it was really fast with 800 x 600 screen size which is what I had coded for SmallBASIC so it would output at a decent speed. A guy at Retro did something I think with JS that went so fast I modified code to do a movie and I didn't know JS! I might be able to dig that up too.

Yes, figosdev had started a little round he wrote a couple lines of code and then I, it went back and forth a couple days and got quite crazy! I think I still have the code.

Yes Walter, I could see from your screen shots of games of home page of this forum we might have similar interests.  Smile
Find all posts by this user
Like Post
The following 1 user Likes bplus's post:
Waltersmind (Admin)



Forum Jump:


User(s) browsing this thread: 1 Guest(s)




QB64 Member Project - STxAxTIC 3D World
QB64 Member Project - Spiro Roses
QB64 Member Project - Touche
QB64 Member Project - Splatter
QB64 Member Project - Othello
QB64 Member Project - Color Rotating Text
QB64 Member Project - MAPTRIANGLE
QB64 Member Project - Rotating Background
QB64 Member Project - Line Thickness
QB64 Member Project - OpenGL Triangles
QB64 Member Project - Pivot version two
QB64 Member Project - Kings Valley verion one
QB64 Member Project - Blokus
QB64 Member Project - Full Color LED Sign
QB64 Member Project - Quarto
QB64 Member Project - Martin Fractals version four
QB64 Member Project - Basic Dithering
QB64 Member Project - Sabotage
QB64 Member Project - Martin Fractals version two
QB64 Member Project - Spinning Color Wheel
QB64 Member Project - Score 4
QB64 Member Project - Algeria Weather
QB64 Member Project - Overboard
QB64 Member Project - Martin Fractals version one
QB64 Member Project - RGB Color Wheel
QB64 Member Project - Amazon
QB64 Member Project - Inside Moves
QB64 Member Project - Point Blank
QB64 Member Project - Bowditch curve
QB64 Member Project - Color Triangles
QB64 Member Project - Martin Fractals version three
QB64 Member Project - Red Scrolling LED Sign
QB64 Member Project - Qubic
QB64 Member Project - Input
QB64 Member Project - Swirl
QB64 Member Project - ARB Checkers
QB64 Member Project - Domain
QB64 Member Project - Kobolts Monopoly
QB64 Member Project - Foursight
QB64 Member Project - Exit
QB64 Member Project - Isolation
QB64 Member Project - Rubix's Magic
QB64 Member Project - Pivet version one
QB64 Member Project - 9 Board
QB64 Member Project - Connect Four
QB64 Member Project - Dreamy Clock
QB64 Member Project - Kings Vallery version two
QB64 Member Project - Dakapo
QB64 Member Project - Kings Court