Win Screensavers with qbasic ARE possible! Read on...

I got it to work just the other day. This works, so give it a shot. To do it, you will need Windows 98, or a similiar MS operating system that has something called "Task Scheduler" installed. I don't know if Win95 has it, and Win98 is the only OS that I have, so it might not work on other OSes.

First, a sample program.

RANDOMIZE TIMER
SCREEN 13
shape$ = "r2d2l2u2"
DO
xpos = INT(RND * 319)
ypos = INT(RND * 199)
clr = INT(RND * 256)
kbd$ = INKEY$
IF kbd$ <> "" THEN EXIT DO
DRAW "bm" + LTRIM$(RTRIM$(STR$(xpos))) + "," + LTRIM$(RTRIM$(STR$(ypos))) + "c" + LTRIM$(RTRIM$(STR$(clr))) + shape$
LOOP
SCREEN 0
END

Simply put, that will draw random little squares in various colors all over the screen. Now, how to make this into a screen saver? Well, it doesn't require you to have qbasic 4.5, or even a compilier, just plain old qbasic (or the 4.5/7 vers will work).

I'm going to show you how to transform this into a screen saver by using just qbasic, or using a compiled version of your source code.

First, compiled version:
Build program, compile to .exe, make sure "Stand Alone" is selected. Take note of the .exe file's location. Exit out of qbasic, and goto the .exe file. I'm assuming the saver that you've made is some sort of graphical saver, so i'm going to use the opts that I used for the example prog above. Right click on the .exe file, then select properties.
in the program tab, select maximized from the RUN drop down box, and check the box marked 'closed on exit.' Now, if your saver uses some kind of data files, fill in the working directory to match where these data files are located. If not, you can leave it blank. Go onto the screen tab, click the radio button "full screen", and on the misc tab, uncheck the "Allow Screensaver" checkbox (we don't want your work of art getting bumped out of the picture!). There, basic settings done. if you're a tweak monkey, keep going until it suits your needs. After all is said and done, click the OK button to save the .pif file.
Now, we start up task scheduler. Double click on "Add Scheduled Task". Click Next. The program will examine your start menu for programs that are on your computer. Unless you are really wierd about your file system, your .exe file won't be on that list. Click browse, then select the .pif file we just made in the step above, NOT the .exe file. That selected, click open, then click the 'daily' radio button. (We'll change this in a minute.) Click next, then next again, these settings don't matter. you should now be at a success screen, stating 'you have successfully scheduled the following task:' . There? Good. Check the "Open advanced properties" checkbox, then finish.
Now, we are in the advanced properties for this task. Click the schedule tab, then under the "Schedule Task:" dropbox, select "When Idle" (it's at the bottom of the list). Here's your screen saver delay in that next box, the arrowed one. default is 10 minutes. change to suit your needs. Click OK. If all went well, x minutes after your computer being idle, your qbasic program will kick in, and you will have a glorious screen saver that you made, without all that complicated WinAPI garbage. LONG LIVE QB BABY! YEAH!

Second, nothing but qbasic 1.0/1.1.
Build your file as normal, but this time, right click your qbasic.exe file, then select properties. Click OK. Another PIF file created. Edit it by going to properties. In the command line text input box, change it from whatever it is to the full path to your qbasic.exe file, like C:WindowsCommandQbasic.exe, and add a space after the .exe part, then some parameters. Like, /RUN filename.bas - Where filename.bas is the full path and filename to the program you saved. If your program uses datafiles, change the Working text box to match where those files are at. If not, leave it blank, or if it's got something, just don't mess with it. Under screen tab, select full screen radio button, and under misc tab, uncheck allow screen saver. Oh yes, go back to the program tab, and make sure "maxmized" is your run window, and the "close after exit" checkbox is checked. Now, before you go into task scheduler, if you don't want to exit from qbasic, instead of END at the end of your program, replace it with SYSTEM - System will drop you back down to dos, and windows will see the 'exit' from qbasic, and shutdown the window. good to go. create the schedule, according to the .PIF file created, and not qbasic.exe, then select When Idle, and set your minutes.

That covers it, I think. If not, I hope you have a general enough idea to replace window's poor choice of screen savers with your work of art. Enjoy the tip.

PS Could I have some feedback on this? If you think it's useful or not? I spent a long time trying to find it, and a simple thanks would let me know my efforts were not in vain.

AdamC

«1

Comments

  • That's a little bit too complicated !
    You can build a screensaver much easier:

    Build some program in Qbasic thats 'saving the screen' - Some nice graphical effects for example. Compile the program and rename the .exe into .scr

    That's it !

  • Oh really, Mr thinks he's so smart. If my method is so damned complicated, how come it works and yours doesn't?

    I would take time to explain to you why it won't work, but you'd probably just make an ass out of yourself again.

    If you think it's complicated, then you must not be able to read that well, because all the instructions are there on the page, in plain english.

  • : Oh really, Mr thinks he's so smart. If my method is so damned complicated, how come it works and yours doesn't?
    :
    : I would take time to explain to you why it won't work, but you'd probably just make an ass out of yourself again.
    :
    : If you think it's complicated, then you must not be able to read that well, because all the instructions are there on the page, in plain english.
    :
    Adam is right. I know because I tried to rename an .exe to .srn(or whatever) to see if it would work as a screen saver. It did not!
    However I did try Adams method. Guess what? It worked slicker than snot! I even liked adams neat little program.





  • You have made my day. If you'd like some more things to try, research the DRAW command, and play around with it some. Now, for making your own colors, try this code:

    OUT &H3C8, colornumbertochange
    OUT &H3C9, redcolor, in 0-63 range
    OUT &H3C9, greencolor, in 0-63 range
    OUT &H3C9, bluecolor, in 0-63 range

    Do that for each color. Make sure you include red, green, and blue. Why 0-63? Don't know. but, that's the max color values that qbasic can handle. 0-63 is a 6 bit number. If you enter 64, qbasic will see it as 0. Unless your entire palette consists of 0-63, you'd think you're screwed, right? WRONG!

    So, what about numbers in the range of 0-255? 8 bit numbers? My knowledge is yours, learn this well.

    x+1
    x/4
    x+1
    x=abs(int(x))

    Where x is your color. Observe! *waves hands*

    IF x = 255
    x+1 = 256
    x/4 = 64
    x-1 = 63

    Hrmm, 63 is the limit! HOLY HELL! IT WORKS! muhahahahah!

    That works with any number (from 0-255, mind you). Now, you may think that you don't do it for 0-63, but you'd be wrong. All remappings from 8 bit down to 6 bit should be used. Now, see the abs(int(x)) there as your last line? Here's why:
    If x=0,
    x+1 = 1
    x/4 = .25
    x-1 = -.25

    I'm not sure, but a negative number is seen as the highest on the scale, so 0,0,0 for an rgb value would be 63,63,63 to the computer. The abs(int(x)) ensures that even negative values are seen as positive values, and .25 would round down to 0. WOOHOO!

    Enjoy the code, and you have my thanks for your thanks. Knowing one person got use out of it pleases me much. Now, I won't leave you without an example program. This is a duplication of the Ultima VII: The Black Gate's loading screen.

    Requires VGA adapter.

    SCREEN 13
    'If you want, change this string to something you'd like. The possibilities
    'for the draw command are quite numerous. Now, on with our program. :)
    'Enjoy. -AdamC
    pattern$ = "r2l1u1d2"
    FOR a = 0 TO 255
    OUT &H3C8, a
    r = a + 1
    r = r / 4
    r = r - 1
    r = INT(ABS(r))
    OUT &H3C9, r
    OUT &H3C9, 0
    OUT &H3C9, 0
    'Grayscale, kinda a neat effect.
    'OUT &H3C9, r
    'OUT &H3C9, r
    'OUT &H3C9, r
    'Blue, this looks pretty nice as well.
    'OUT &H3C9, 0
    'OUT &H3C9, 0
    'OUT &H3C9, r
    '
    'I used r for the variable, but if you want to mix colors, it goes red,
    'green, blue, in that order. Just use r for each of them (for smooth color changing)
    'or different variables if you'd like. For some wacky colors, make one variable
    'a random one, then run the bit mapping code (the x=x+1...) on it, and change
    'the palette.
    NEXT a
    DO
    kbd$ = INKEY$
    IF kbd$ <> "" THEN EXIT DO 'Standard little keypress=exit.
    'if you want to, you can add in a few extra lines (and subs) to include mouse
    'movement = exit, but keypress works just fine.
    'If it's still up, www.qbasic.com has the code to activate and use the mouse.
    xcoord = INT(RND * 321)
    ycoord = INT(RND * 201)
    designcolor = INT(RND * 256)
    'Random numbers count from 0-x, not 1-x, so if +1 on your max range, then the
    'number that you really want to be max should get picked. like int(rnd*1)
    'would always yield 0, but int(rnd*2) will give 1 or 0. neat, eh?
    DRAW "BM" + LTRIM$(RTRIM$(STR$(xcoord))) + "," + LTRIM$(RTRIM$(STR$(ycoord))) + "c" + LTRIM$(RTRIM$(STR$(designcolor))) + pattern$
    'BM=BLANK MOVE. prevents design mutilation, or enhancement, depends on your
    'view. Also a long string, be sure to get all of it.
    LOOP
    SCREEN 0
    END 'or SYSTEM if using QBasic 1.x
    'And, that's it.
    'On the last two OUT statements, I used 0, meaning only red would be covered.
    'If you want something like blue, make the first one, 0, the second one 0,
    'and the third one that isn't a 0.
    '
    'The coolest thing about pattern$ is that it's your shape. You can change it
    'from plus signs, to something like a bug, or whatever your mind can imagine.

    -AdamC

    Ahh, can you tell i love to type? lol. I'm really going to post now. :)

  • I wouldn't post those stuff here, if it doesn't works !
    AND IT WORKS ! There's no difference between an executable and a screensaver-file. I don't know why you guys aren't able to rename a .exe (or whatever) into .scr

  • Let's see. We've got two people, me and the other guy, saying my method works, and two people saying your method doesn't work. On the other hand, we've got you saying your method works, and mine doesn't work.

    Fine. Your method works. There, you happy?

    I posted it as a little information because I've been asked several times in the past if it could be done.

    The only way that I can think of a qbasic exe could be used as a screen saver is with some version of basic that compiles into a WIN16/32 executable, and utilizes a graphics API such as DirectX or OpenGL. I was going to let this go, but no, you wanted to post again. Fine, you want some proof? Here:

    Win32 Exe Screen Saver:
    Number of Imported Modules = 7
    Import Module 005: OPENGL32.dll <-- OpenGL, a GFX API.

    Now, a DOS exe:
    Number of Imported Modules = 0 (decimal)
    Look there, no modules.
    No import modules, NO SCREENSAVER

    Disassemble your supposed working .exe file. Does it import any modules? D3d.dll, Opengl32.dll, etc? If so, then it's probably a win16/32 executable, and that's why it works.

    The methods I was talking about were for DOS compilers. Aka Qbasic 1.0, 1.1, 4.0, 4.5, and 7.0 - PURE QBASIC, not some hybrid version.



    Kick, scream, b*tch, and moan all you want about how I'm wrong and you are right, I don't care. I'm done trying to explain this to you.

  • Hehehe...

    Are you afraid of telling wrong stuff ? Maybe you should call the doc - cuz' I never ever said that you were wrong with your method. Ok, script-kiddy ?!

  • This method works for other dos languages as well. I tried it with some MoonRock programs, and a C program. It worked beautifully.

    To make this work you do not have to disable your screensaver either. Just set the time to something less than what you have your screensaver set to.

    MAKE SURE THAT YOU HAVE UNCHECKED THAT ALLOW SCERRNSAVER BUTTON!

    If you want your screen saver back just open the task scheduler and delete your "fake screen saver". DON'T DELETE ANYTHING ELSE!

    : I got it to work just the other day. This works, so give it a shot. To do it, you will need Windows 98, or a similiar MS operating system that has something called "Task Scheduler" installed. I don't know if Win95 has it, and Win98 is the only OS that I have, so it might not work on other OSes.
    :
    : First, a sample program.
    :
    : RANDOMIZE TIMER
    : SCREEN 13
    : shape$ = "r2d2l2u2"
    : DO
    : xpos = INT(RND * 319)
    : ypos = INT(RND * 199)
    : clr = INT(RND * 256)
    : kbd$ = INKEY$
    : IF kbd$ <> "" THEN EXIT DO
    : DRAW "bm" + LTRIM$(RTRIM$(STR$(xpos))) + "," + LTRIM$(RTRIM$(STR$(ypos))) + "c" + LTRIM$(RTRIM$(STR$(clr))) + shape$
    : LOOP
    : SCREEN 0
    : END
    :
    : Simply put, that will draw random little squares in various colors all over the screen. Now, how to make this into a screen saver? Well, it doesn't require you to have qbasic 4.5, or even a compilier, just plain old qbasic (or the 4.5/7 vers will work).
    :
    : I'm going to show you how to transform this into a screen saver by using just qbasic, or using a compiled version of your source code.
    :
    : First, compiled version:
    : Build program, compile to .exe, make sure "Stand Alone" is selected. Take note of the .exe file's location. Exit out of qbasic, and goto the .exe file. I'm assuming the saver that you've made is some sort of graphical saver, so i'm going to use the opts that I used for the example prog above. Right click on the .exe file, then select properties.
    : in the program tab, select maximized from the RUN drop down box, and check the box marked 'closed on exit.' Now, if your saver uses some kind of data files, fill in the working directory to match where these data files are located. If not, you can leave it blank. Go onto the screen tab, click the radio button "full screen", and on the misc tab, uncheck the "Allow Screensaver" checkbox (we don't want your work of art getting bumped out of the picture!). There, basic settings done. if you're a tweak monkey, keep going until it suits your needs. After all is said and done, click the OK button to save the .pif file.
    : Now, we start up task scheduler. Double click on "Add Scheduled Task". Click Next. The program will examine your start menu for programs that are on your computer. Unless you are really wierd about your file system, your .exe file won't be on that list. Click browse, then select the .pif file we just made in the step above, NOT the .exe file. That selected, click open, then click the 'daily' radio button. (We'll change this in a minute.) Click next, then next again, these settings don't matter. you should now be at a success screen, stating 'you have successfully scheduled the following task:' . There? Good. Check the "Open advanced properties" checkbox, then finish.
    : Now, we are in the advanced properties for this task. Click the schedule tab, then under the "Schedule Task:" dropbox, select "When Idle" (it's at the bottom of the list). Here's your screen saver delay in that next box, the arrowed one. default is 10 minutes. change to suit your needs. Click OK. If all went well, x minutes after your computer being idle, your qbasic program will kick in, and you will have a glorious screen saver that you made, without all that complicated WinAPI garbage. LONG LIVE QB BABY! YEAH!
    :
    : Second, nothing but qbasic 1.0/1.1.
    : Build your file as normal, but this time, right click your qbasic.exe file, then select properties. Click OK. Another PIF file created. Edit it by going to properties. In the command line text input box, change it from whatever it is to the full path to your qbasic.exe file, like C:WindowsCommandQbasic.exe, and add a space after the .exe part, then some parameters. Like, /RUN filename.bas - Where filename.bas is the full path and filename to the program you saved. If your program uses datafiles, change the Working text box to match where those files are at. If not, leave it blank, or if it's got something, just don't mess with it. Under screen tab, select full screen radio button, and under misc tab, uncheck allow screen saver. Oh yes, go back to the program tab, and make sure "maxmized" is your run window, and the "close after exit" checkbox is checked. Now, before you go into task scheduler, if you don't want to exit from qbasic, instead of END at the end of your program, replace it with SYSTEM - System will drop you back down to dos, and windows will see the 'exit' from qbasic, and shutdown the window. good to go. create the schedule, according to the .PIF file created, and not qbasic.exe, then select When Idle, and set your minutes.
    :
    : That covers it, I think. If not, I hope you have a general enough idea to replace window's poor choice of screen savers with your work of art. Enjoy the tip.
    :
    : PS Could I have some feedback on this? If you think it's useful or not? I spent a long time trying to find it, and a simple thanks would let me know my efforts were not in vain.
    :
    : AdamC
    :


  • Hey AdamC,

    Here's one for you. This is an effect that I came across when I was learning BASIC back in the 80's. I have never come across it again, but I remember how to do it. I call it the "Labyrinth Effect". It's totally random, simple, and kind of shocking. It will make a cool "QB screensaver."

    Here's the code:

    DIM fslash%(16)
    DIM bslash%(16)
    SCREEN 7
    RANDOMIZE TIMER
    p% = 0
    DO
    RESTORE
    r% = INT(RND * 15) + 1
    FOR h% = 1 TO 2
    FOR i% = 0 TO 3
    FOR j% = 0 TO 3
    READ z%
    PSET (j%, i%), z% * r%
    NEXT j%
    NEXT i%
    IF h% = 1 THEN
    GET (0, 0)-(3, 3), fslash%
    ELSE
    GET (0, 0)-(3, 3), bslash%
    END IF
    CLS
    NEXT h%
    FOR i% = 0 TO 79
    FOR j% = 0 TO 49
    r% = INT(RND * 2)
    IF r% = 0 THEN
    PUT (i% * 4, j% * 4), fslash%
    ELSE
    PUT (i% * 4, j% * 4), bslash%
    END IF
    NEXT j%
    NEXT i%
    'Do some tweaking with this FOR-NEXT loop below
    'to get the speed right.
    FOR i& = 1 TO 2000
    IF INKEY$ <> "" THEN EXIT DO
    NEXT i&
    CLS
    LOOP
    END
    DATA 0,0,0,1
    DATA 0,0,1,0
    DATA 0,1,0,0
    DATA 1,0,0,0
    '
    DATA 1,0,0,0
    DATA 0,1,0,0
    DATA 0,0,1,0
    DATA 0,0,0,1
    '***END OF CODE***

    Try it! I think you'll like it!



  • Works great! For your information, runs fine in Windows NT (thats what I'm using). You click Start->Run and then type in "tasks" and the Task Manager pops up, for anyone else trying to figure it out.

    How about writing a QB program which automatically installs a screen saver? (ie. automatically creates the '.job' task file & '.pif' windows shortcut).

    : I got it to work just the other day. This works, so give it a shot. To do it, you will need Windows 98, or a similiar MS operating system that has something called "Task Scheduler" installed. I don't know if Win95 has it, and Win98 is the only OS that I have, so it might not work on other OSes.
    :
    : First, a sample program.
    :
    : RANDOMIZE TIMER
    : SCREEN 13
    : shape$ = "r2d2l2u2"
    : DO
    : xpos = INT(RND * 319)
    : ypos = INT(RND * 199)
    : clr = INT(RND * 256)
    : kbd$ = INKEY$
    : IF kbd$ <> "" THEN EXIT DO
    : DRAW "bm" + LTRIM$(RTRIM$(STR$(xpos))) + "," + LTRIM$(RTRIM$(STR$(ypos))) + "c" + LTRIM$(RTRIM$(STR$(clr))) + shape$
    : LOOP
    : SCREEN 0
    : END
    :
    : Simply put, that will draw random little squares in various colors all over the screen. Now, how to make this into a screen saver? Well, it doesn't require you to have qbasic 4.5, or even a compilier, just plain old qbasic (or the 4.5/7 vers will work).
    :
    : I'm going to show you how to transform this into a screen saver by using just qbasic, or using a compiled version of your source code.
    :
    : First, compiled version:
    : Build program, compile to .exe, make sure "Stand Alone" is selected. Take note of the .exe file's location. Exit out of qbasic, and goto the .exe file. I'm assuming the saver that you've made is some sort of graphical saver, so i'm going to use the opts that I used for the example prog above. Right click on the .exe file, then select properties.
    : in the program tab, select maximized from the RUN drop down box, and check the box marked 'closed on exit.' Now, if your saver uses some kind of data files, fill in the working directory to match where these data files are located. If not, you can leave it blank. Go onto the screen tab, click the radio button "full screen", and on the misc tab, uncheck the "Allow Screensaver" checkbox (we don't want your work of art getting bumped out of the picture!). There, basic settings done. if you're a tweak monkey, keep going until it suits your needs. After all is said and done, click the OK button to save the .pif file.
    : Now, we start up task scheduler. Double click on "Add Scheduled Task". Click Next. The program will examine your start menu for programs that are on your computer. Unless you are really wierd about your file system, your .exe file won't be on that list. Click browse, then select the .pif file we just made in the step above, NOT the .exe file. That selected, click open, then click the 'daily' radio button. (We'll change this in a minute.) Click next, then next again, these settings don't matter. you should now be at a success screen, stating 'you have successfully scheduled the following task:' . There? Good. Check the "Open advanced properties" checkbox, then finish.
    : Now, we are in the advanced properties for this task. Click the schedule tab, then under the "Schedule Task:" dropbox, select "When Idle" (it's at the bottom of the list). Here's your screen saver delay in that next box, the arrowed one. default is 10 minutes. change to suit your needs. Click OK. If all went well, x minutes after your computer being idle, your qbasic program will kick in, and you will have a glorious screen saver that you made, without all that complicated WinAPI garbage. LONG LIVE QB BABY! YEAH!
    :
    : Second, nothing but qbasic 1.0/1.1.
    : Build your file as normal, but this time, right click your qbasic.exe file, then select properties. Click OK. Another PIF file created. Edit it by going to properties. In the command line text input box, change it from whatever it is to the full path to your qbasic.exe file, like C:WindowsCommandQbasic.exe, and add a space after the .exe part, then some parameters. Like, /RUN filename.bas - Where filename.bas is the full path and filename to the program you saved. If your program uses datafiles, change the Working text box to match where those files are at. If not, leave it blank, or if it's got something, just don't mess with it. Under screen tab, select full screen radio button, and under misc tab, uncheck allow screen saver. Oh yes, go back to the program tab, and make sure "maxmized" is your run window, and the "close after exit" checkbox is checked. Now, before you go into task scheduler, if you don't want to exit from qbasic, instead of END at the end of your program, replace it with SYSTEM - System will drop you back down to dos, and windows will see the 'exit' from qbasic, and shutdown the window. good to go. create the schedule, according to the .PIF file created, and not qbasic.exe, then select When Idle, and set your minutes.
    :
    : That covers it, I think. If not, I hope you have a general enough idea to replace window's poor choice of screen savers with your work of art. Enjoy the tip.
    :
    : PS Could I have some feedback on this? If you think it's useful or not? I spent a long time trying to find it, and a simple thanks would let me know my efforts were not in vain.
    :
    : AdamC
    :


  • Well, yes it's possible to do that. It would involve learning the structure of the .job file and the .pif (i already know that one), but it could be done. If I do get it to work, i promise I'll post.

  • THAT SCREEN SAVER WAS REALLY COOL ARE THERE ANYOTHERES OUT THERE OTHER THEN THE SQUARES ONE



    JIMBO

  • How exactly do you edit binary (non-plain text ASCII) files in QB? I never managed to work that out - do you have any programs that demonstrate how to do this? And how do you read a file past an EOF character? Thanks in advance!

  • : THAT SCREEN SAVER WAS REALLY COOL ARE THERE ANYOTHERES OUT THERE OTHER THEN THE SQUARES ONE
    :
    :
    :
    : JIMBO
    :
    I have posted this once before, but I like this effect so much that I think you ought to try it.

    '***Begin code***
    DIM fslash%(16)
    DIM bslash%(16)
    SCREEN 7
    RANDOMIZE TIMER
    p% = 0
    DO
    RESTORE
    r% = INT(RND * 15) + 1
    FOR h% = 1 TO 2
    FOR i% = 0 TO 3
    FOR j% = 0 TO 3
    READ z%
    PSET (j%, i%), z% * r%
    NEXT j%
    NEXT i%
    IF h% = 1 THEN
    GET (0, 0)-(3, 3), fslash%
    ELSE
    GET (0, 0)-(3, 3), bslash%
    END IF
    CLS
    NEXT h%
    FOR i% = 0 TO 79
    FOR j% = 0 TO 49
    r% = INT(RND * 2)
    IF r% = 0 THEN
    PUT (i% * 4, j% * 4), fslash%
    ELSE
    PUT (i% * 4, j% * 4), bslash%
    END IF
    NEXT j%
    NEXT i%
    'Do some tweaking with this FOR-NEXT loop below
    'to get the speed right.
    FOR i& = 1 TO 2000
    IF INKEY$ <> "" THEN EXIT DO
    NEXT i&
    CLS
    LOOP
    END
    DATA 0,0,0,1
    DATA 0,0,1,0
    DATA 0,1,0,0
    DATA 1,0,0,0
    '
    DATA 1,0,0,0
    DATA 0,1,0,0
    DATA 0,0,1,0
    DATA 0,0,0,1
    '***END OF CODE***

    Try it! I think you'll like it!




  • Try this one, it will shoot fireworks across your screen, which fall to the ground and bounce. For slower computers, speed up the program by lowering the Speed value and reducing the FlareCount%. Let me know if it works!



    FlareCount% = 20 ' The number of fragments that separate when
    ' the firework explodes.
    Gravity = 9.8 ' Strength of gravity (9.8 = earth).
    Speed = 8 ' You may need to adjust this according to
    ' speed of your computer - a lower number will
    ' make the program run faster.

    RANDOMIZE TIMER
    SCREEN 13: CLS
    DO
    COLOR INT(RND * 15) + 1
    REDIM SHARED FlareX(FlareCount%), FlareY(FlareCount%)
    REDIM SHARED FlareX.Vel(FlareCount%), FlareY.Vel(FlareCount%)
    FlareX(1) = INT(RND * 320)
    FlareY(1) = 200
    FlareX.Vel(1) = 2 * ((FlareX(1) - 160) / 160)
    FlareY.Vel(1) = 3.5 + (RND * 2.5)
    FOR SetFlares% = 2 TO FlareCount%
    FlareX(SetFlares%) = FlareX(1): FlareY(SetFlares%) = FlareY(1)
    FlareX.Vel(SetFlares%) = FlareX.Vel(1): FlareY.Vel(SetFlares%) = FlareY.Vel(1)
    NEXT SetFlares%
    ExplosionStage% = 0
    DO
    IF FlareY.Vel(1) < -.5 AND ExplosionStage% = 0 THEN ExplosionStage% = 1
    FOR DrawFlares% = 1 TO FlareCount%
    PSET (FlareX(DrawFlares%), FlareY(DrawFlares%))
    NEXT DrawFlares%
    FOR DelayLoop = 1 TO 1000 * Speed
    KeyPress$ = INKEY$
    IF KeyPress$ <> "" THEN ExitRequest% = -1
    NEXT DelayLoop
    FOR ClearFlares% = 1 TO FlareCount%
    PSET (FlareX(ClearFlares%), FlareY(ClearFlares%)), 0
    NEXT ClearFlares%
    IF ExplosionStage% = 1 THEN
    FOR Scatter% = 1 TO FlareCount%
    FlareX.Vel(Scatter%) = 2.5 * (RND - .5)
    FlareY.Vel(Scatter%) = RND * 1.5
    NEXT Scatter%
    ExplosionStage% = 2
    END IF
    DeadFlares% = 0
    FOR ResetProjectile% = 1 TO FlareCount%
    FlareX(ResetProjectile%) = FlareX(ResetProjectile%) - FlareX.Vel(ResetProjectile%)
    FlareY(ResetProjectile%) = FlareY(ResetProjectile%) - FlareY.Vel(ResetProjectile%)
    IF FlareY(ResetProjectile%) > 200 THEN
    FlareY(ResetProjectile%) = 200
    FlareY.Vel(ResetProjectile%) = (-FlareY.Vel(ResetProjectile%) / 2)
    END IF
    IF FlareY(ResetProjectile%) > 190 AND ABS(FlareY.Vel(ResetProjectile%)) <= .05 THEN
    DeadFlares% = DeadFlares% + 1
    END IF
    NEXT ResetProjectile%
    FOR GravityEffect% = 1 TO FlareCount%
    FlareY.Vel(GravityEffect%) = FlareY.Vel(GravityEffect%) - (Gravity / 98)
    NEXT GravityEffect%
    LOOP UNTIL ExitRequest% OR DeadFlares% = FlareCount%
    LOOP UNTIL ExitRequest%


    : THAT SCREEN SAVER WAS REALLY COOL ARE THERE ANYOTHERES OUT THERE OTHER THEN THE SQUARES ONE
    :
    :
    :
    : JIMBO
    :


Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories