Board Logo
« Boom »

Welcome Guest. Please Login or Register.
Jan 16th, 2018, 3:40pm


Conforums Terms of Service | Membership Rules | Home | Search | Recent Posts | Notification | Format Your Message | Installation FAQ

Please use the forums Search feature before asking.
Please post code using the code box described in Format Your Messages.
This will keep indentation, separate it better form the message and prevent gibberish.
If the code is too long for one post or additional files are needed, upload a ZIP archive to the Just BASIC Files Archive Site.

« Previous Topic | Next Topic »
Pages: 1  Notify Send Topic Print
 thread  Author  Topic: Boom  (Read 310 times)
Rod
Administrator
ImageImageImageImageImage


member is offline

Avatar

Graphics = Goosebumps!


PM

Gender: Male
Posts: 3151
xx Boom
« Thread started on: Jun 18th, 2017, 06:41am »

If you want some simple fun go and explore old QuickBasic sites and puzzle out the conversion. It can push you into using Just BASIC commands and functions you might not have tried.

Code:
 'https://www.bamsoftware.com/bzr/qbasic/boom.bas

    'TYPE Dot x AS INTEGER y AS INTEGER xvel AS SINGLE yvel AS SINGLE col AS INTEGER END
    'TYPE DIM Dots(0 TO 255) AS Dot
    dim dot(255,5)
    X=1
    Y=2
    Xvel=3
    Yvel=4
    Col=5


    'SCREEN 13
    nomainwin
    WindowWidth = 800
    WindowHeight = 600
    graphicbox #w.g, 10,10,320,200
    open "Boom" for window as #w
    #w "trapclose [quit]"
    #w.g "down ; fill black ; size 2"

    [boom]
    FOR y = 0 TO 15
        FOR x = 0 TO 15
            'PSET (x + 160, y + 100), RND * 256
            #w.g "color black"
            #w.g "set ";x+160;" ";y+100

            dot(16 * y + x,X) = x + 160
            dot(16 * y + x,Y) = y + 100
            dot(16 * y + x,Col) = rnd(0)*255
            dot(16 * y + x,Xvel) = rnd(0) * 10 - 5
            dot(16 * y + x,Yvel) = rnd(0) * 10 - 5
        NEXT
    NEXT


    [draw]

    playwave "media\bump.wave",async

    FOR c = 1 TO 100
        FOR x = 0 TO 255
            scan
            'PSET (Dots(x).x, Dots(x).y), 0
            #w.g "color black"
            #w.g "set ";dot(x,X);" ";dot(x,Y)
            dot(x,X) = dot(x,X) + dot(x,Xvel)
            dot(x,Yvel) = dot(x,Yvel) + 1
            IF dot(x,Y) > 200 THEN dot(x,Yvel) = 0-dot(x,Yvel)
            dot(x,Y) = dot(x,Y) + dot(x,Yvel)
            'PSET (Dots(x).x, Dots(x).y), Dots(x).col
            #w.g "color ";dot(x,Col);" 10 10"
            dot(x,Col)=abs(dot(x,Col)-4)
            #w.g "set ";dot(x,X);" ";dot(x,Y)

        NEXT
    NEXT
    goto [boom]

    [quit]
    timer 0
    close #w
    end

 
User IP Logged

Pages: 1  Notify Send Topic Print
« Previous Topic | Next Topic »

Conforums Terms of Service | Membership Rules | Home | Search | Recent Posts | Notification | Format Your Message | Installation FAQ

Donate $6.99 for 50,000 Ad-Free Pageviews!

| |

This forum powered for FREE by Conforums ©
Sign up for your own Free Message Board today!
Terms of Service | Privacy Policy | Conforums Support | Parental Controls