Weekly Qbasic and Qb64 Lesson Topics
January 22, 2018, 04:04:36 pm
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Want to see a specific Tutorial? ASK!
 
   Home   Help Search Arcade Links Staff List Login Register  

Pages: 1 ... 8 9 [10]
 91 
 on: April 04, 2012, 11:28:27 pm 
Started by Draugr - Last post by GarrisonRicketson
I made a example, with a game, SMGBGE, written by Terrie Richie, it is to large to post the entire .bas here, so I have put it on drop box, http://dl.dropbox.com/u/15387474/SMGBUG-qb64splash.bas.zip This is only a .bas file , you will need to compile it with qb64. It displays the "spalsh image" (qb64 logo) about 3 seconds, then it starts the game, ..with no chdir, or separate programs,
 You may want to check it out.
 And this is a example of just the qb64 logo , as a "splash" image, embedded it the .bas.
http://dl.dropbox.com/u/15387474/qb64splash.bas.zip

 92 
 on: April 04, 2012, 07:46:33 am 
Started by Draugr - Last post by GarrisonRicketson

Here is the basic idea of what I'm looking to achieve. The latter part I have working via a standard batch file, but the splash screen aspect isn't possible in a simple batch screen so I'm hoping QB64 might be able to do this.

Example:

run start.exe
Splash screen shows for 4 seconds then the exe performs the following code
cd game
dragons.exe

The program Dragons then launches.
On the CD GAME, or changeing Directorys, you should read up on this,..
Shell and changeing directorys
http://qb64.net/wiki/index.php?title=Special%3ASearch&search=Shell+CD&go=Go
--------------------
Quote
CHDIR
* '''A QB64 [[SHELL]] statement cannot currently use "CD " or "CHDIR " + path$ to change the directory using DOS.''' * [[SHELL]], [[FILES]]
3 KB (453 words) - 01:39, 26 January 2012
-------------------------
http://qb64.net/wiki/index.php?title=CHDIR
-----------------------
 All though you can change directories,  from what I have seen, often it leads to problems, and dose not work very well. ( just changeing to run a bat file, should not be a problem)
from Garry

 93 
 on: April 04, 2012, 07:16:34 am 
Started by Draugr - Last post by GarrisonRicketson
 This is some simpler code, demonstrating the same , but no image,
Code:
DO ' main program loop
    PRINT " This could be the splash image"
    '///Print would need to be rplaced with the code to load the image, not print
    PRINT "this and that"
    _DELAY 5     '// sleep 3 (or what ever value you chose) could also be used
    CLS

    DEF SEG = 0 ' set to PEEK and POKE TIMER Ticks
    POKE 550, 0 ' zero Timer tick
    'DO
    ' loop code
    PRINT "one more"
LOOP UNTIL PEEK(550) >= 0
DEF SEG ' reset segment to default

'CLS
PRINT "new program"
SLEEP
 
It was mentioned, that sleep might be a better choice, http://www.qb64.net/forum/index.php?topic=5797.msg59751#msg59751 
from Garry

 94 
 on: April 04, 2012, 12:18:29 am 
Started by Draugr - Last post by GarrisonRicketson
Ok I did modify, the "Mask" image, code, it now only displays for about 5 seconds,
Code:
'==============================================================================
_TITLE "***MASK 8X16 FUJI  ***" 'by Quark 7/11
DEFDBL A-Z
SCREEN _NEWIMAGE(808, 616, 256)
DIM SHARED rows, cols
maskrows = 37: maskcols = 100
DIM SHARED mask(maskrows, maskcols) AS STRING
DIM SHARED brush AS STRING
DIM drawbrush AS STRING: drawbrush$ = CHR$(219)
DIM maskbrush AS STRING: maskbrush$ = CHR$(177)
DIM drawcolor, maskcolor, commentcolor AS INTEGER
drawcolor = 0: maskcolor = 11: commentcolor = 15
rows = INT(_HEIGHT / 8 - 1): cols = INT(_WIDTH / 5 - 1)
RANDOMIZE (TIMER)
'------------------------------------------------------------------------------
FOR r = 1 TO maskrows: READ t$
    FOR c = 1 TO maskcols
        mask(r, c) = MID$(t$, c, 1)
NEXT: NEXT

DO
    FOR r = 1 TO maskrows
        FOR c = 1 TO maskcols

            SELECT CASE mask(r, c)
                CASE "A"
                    COLOR 0: IF Chance%(1, 10) THEN COLOR 8
                CASE "B"
                    COLOR 1: IF Chance%(1, 10) THEN COLOR 9
                CASE "C"
                    COLOR 2: IF Chance%(1, 10) THEN COLOR 10
                CASE "D"
                    COLOR 3: IF Chance%(1, 10) THEN COLOR 11
                CASE "E"
                    COLOR 4: IF Chance%(1, 10) THEN COLOR 6
                CASE "F"
                    COLOR 5: IF Chance%(1, 10) THEN COLOR 13
                CASE "G"
                    COLOR 6: IF Chance%(1, 10) THEN COLOR 4
                CASE "H"
                    COLOR 7: IF Chance%(1, 10) THEN COLOR 15
                CASE "I"
                    COLOR 8: IF Chance%(1, 10) THEN COLOR 7
                CASE "J"
                    COLOR 9: IF Chance%(1, 10) THEN COLOR 3
                CASE "K"
                    COLOR 10: IF Chance%(1, 10) THEN COLOR 2
                CASE "L"
                    COLOR 11: IF Chance%(1, 10) THEN COLOR 3
                CASE "M"
                    COLOR 12: IF Chance%(1, 10) THEN COLOR 4
                CASE "N"
                    COLOR 13: IF Chance%(1, 10) THEN COLOR 5
                CASE "O"
                    COLOR 14: IF Chance%(1, 10) THEN COLOR 15
                CASE "P"
                    COLOR 15: IF Chance%(1, 10) THEN COLOR 7
                CASE ELSE
                    COLOR ASC(mask(r, c)) - 65
            END SELECT

            LOCATE r, c: PRINT "■";
    NEXT: NEXT

    _DELAY 5  '// I changed the delay to 5 and added this below,


    CLS

    DEF SEG = 0 ' set to PEEK and POKE TIMER Ticks
    POKE 550, 0 ' zero Timer tick
    ' loop code
    PRINT "one more"
LOOP UNTIL PEEK(550) >= 0
DEF SEG ' reset segment to default
'//the rest of the code is the same, no modification.

SLEEP: END
'==============================================================================
FUNCTION RndRange% (lo AS INTEGER, hi AS INTEGER)
DIM r AS INTEGER
r = hi - lo + 1
RndRange% = INT(RND(1) * (hi - lo + 1) + lo)
END FUNCTION
'------------------------------------------------------------------------------
FUNCTION Chance% (lo AS INTEGER, hi AS INTEGER)
'returns 1 if chance is successful, 0 otherwise
IF lo >= hi THEN Chance% = -1
Chance% = INT(RND * hi) < lo
END FUNCTION
'------------------------------------------------------------------------------
DATA "ABBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
DATA "ABBBBHBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBHHBBHPHPPHBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBA"
DATA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JJPPLLLBBBBJJJJA"
DATA "AJJJJJJFFJFFFJPPAPPBPPPPPPPPBPPPPBBBBABAAAAAAAJJJLLLLJLLPPPPPJPJPPAJJJAJJJJJJJJFFLJJJJJJPPPHPHPPJJJA"
DATA "ABBJBJBBBBBBBJJJJJFFAAJJJJJAAAAAAPPPPPPBPBBBBLAAAAABAAAAAAABAAAABBBJJJJFJJBJBJBJBBJBJBBBBJJJJJJBBBBA"
DATA "AJPPPJJPJPJPPPPPPPPJPPAPAAFFBFJBBABBABBAABBBBJJJJJJJAAAAAAAJAJBJBJJBBBBJBJBJBBBJBJBBJBBBJBBBBJBJJJJA"
DATA "AJJJJJJJJJJPJJJJJJBBBJBJBBAAJJJJJJJJJJAAAAFABFFJBJJBBJBFJBJBAAAAAJAJAAAAAAAAJJJJJJJJJJJJJJJJJJJJJJJA"
DATA "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"

 

 95 
 on: April 03, 2012, 11:12:37 pm 
Started by Draugr - Last post by GarrisonRicketson
I wanted to know if something like this is possible in QB64 and will a single compiled exe be able to work in 32 and/or 64 bit versions of Windows or will separate 32 and 64 bit images be required?

Here is the basic idea of what I'm looking to achieve. The latter part I have working via a standard batch file, but the splash screen aspect isn't possible in a simple batch screen so I'm hoping QB64 might be able to do this.

Example:

run start.exe
Splash screen shows for 4 seconds then the exe performs the following code
cd game
dragons.exe

The program Dragons then launches.

I know its probably fairly simple and even though I'm not a QB guru I know I could figure out how to do the latter part, but the whole splash screen aspect is where I'd be lost. Also, if this is possible, is it also possible to hide the actual image within the executable so that the end user could not simply go into the folders for the program and access the splash_image.jpg file? I'd love it if it could be somehow merged internally within the compiled exe file.

I appreciate any advice or help.

Thanks
John


On the """ will a single compiled exe be able to work in 32 and/or 64 bit versions of Windows or will separate 32 and 64 bit images be required?""" Apparently YES, it will work, on a either one.

 96 
 on: April 03, 2012, 10:50:23 pm 
Started by Draugr - Last post by GarrisonRicketson
This is another example of a image , without any .jpg or image file out side of the program,
More details can be gotten in this thread:
"Mask" image,and makeing a mask image 
 This is the code ( written by Quark )for this image:
Code:
'==============================================================================
_TITLE "***MASK 8X16 FUJI  ***" 'by Quark 7/11
DEFDBL A-Z
SCREEN _NEWIMAGE(808, 616, 256)
DIM SHARED rows, cols
maskrows = 37: maskcols = 100
DIM SHARED mask(maskrows, maskcols) AS STRING
DIM SHARED brush AS STRING
DIM drawbrush AS STRING: drawbrush$ = CHR$(219)
DIM maskbrush AS STRING: maskbrush$ = CHR$(177)
DIM drawcolor, maskcolor, commentcolor AS INTEGER
drawcolor = 0: maskcolor = 11: commentcolor = 15
rows = INT(_HEIGHT / 8 - 1): cols = INT(_WIDTH / 5 - 1)
RANDOMIZE (TIMER)
'------------------------------------------------------------------------------
FOR r = 1 TO maskrows: READ t$
    FOR c = 1 TO maskcols
        mask(r, c) = MID$(t$, c, 1)
NEXT: NEXT

DO
    FOR r = 1 TO maskrows
        FOR c = 1 TO maskcols

            SELECT CASE mask(r, c)
                CASE "A"
                    COLOR 0: IF Chance%(1, 10) THEN COLOR 8
                CASE "B"
                    COLOR 1: IF Chance%(1, 10) THEN COLOR 9
                CASE "C"
                    COLOR 2: IF Chance%(1, 10) THEN COLOR 10
                CASE "D"
                    COLOR 3: IF Chance%(1, 10) THEN COLOR 11
                CASE "E"
                    COLOR 4: IF Chance%(1, 10) THEN COLOR 6
                CASE "F"
                    COLOR 5: IF Chance%(1, 10) THEN COLOR 13
                CASE "G"
                    COLOR 6: IF Chance%(1, 10) THEN COLOR 4
                CASE "H"
                    COLOR 7: IF Chance%(1, 10) THEN COLOR 15
                CASE "I"
                    COLOR 8: IF Chance%(1, 10) THEN COLOR 7
                CASE "J"
                    COLOR 9: IF Chance%(1, 10) THEN COLOR 3
                CASE "K"
                    COLOR 10: IF Chance%(1, 10) THEN COLOR 2
                CASE "L"
                    COLOR 11: IF Chance%(1, 10) THEN COLOR 3
                CASE "M"
                    COLOR 12: IF Chance%(1, 10) THEN COLOR 4
                CASE "N"
                    COLOR 13: IF Chance%(1, 10) THEN COLOR 5
                CASE "O"
                    COLOR 14: IF Chance%(1, 10) THEN COLOR 15
                CASE "P"
                    COLOR 15: IF Chance%(1, 10) THEN COLOR 7
                CASE ELSE
                    COLOR ASC(mask(r, c)) - 65
            END SELECT

            LOCATE r, c: PRINT "■";
    NEXT: NEXT
    _DELAY (.15)
LOOP UNTIL INKEY$ = CHR$(27)
SLEEP: END
'==============================================================================
FUNCTION RndRange% (lo AS INTEGER, hi AS INTEGER)
DIM r AS INTEGER
r = hi - lo + 1
RndRange% = INT(RND(1) * (hi - lo + 1) + lo)
END FUNCTION
'------------------------------------------------------------------------------
FUNCTION Chance% (lo AS INTEGER, hi AS INTEGER)
'returns 1 if chance is successful, 0 otherwise
IF lo >= hi THEN Chance% = -1
Chance% = INT(RND * hi) < lo
END FUNCTION
'------------------------------------------------------------------------------
DATA "ABBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
DATA "ABBBBHBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBHHBBHPHPPHBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBA"
DATA "ABBBBHHPHPHPPPHHPBHPPBBHPHBBBBBBBBBBBBBBBBBHHPHHPHBBBBBBBBPHHHPHBHHHHBBBHBBAAPPPABBBBBBBBBBHHPPHPBBA"
DATA "ABBBBBBBBBBHHPHBPHHBBHBBBBBBBBBBBBBBHHPPPHBBBBBBBBBBBBBBBHHHPPBPHHHBHHHHBBAPPPPPPABBHPHBHHHPHPHBBBBA"
DATA "ABJJBBBBBBBBBBBBBBBBBJBJJJJJBBBJBJJBBBBBJJBJBBBBBJJBBBBJJJBBBBBBBBDBBBBBIAPPJPPJPPPABBBBBB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JBJBBBJBJBBJBBBJBBBBJBJJJJA"
DATA "AJJJJJJJJJJPJJJJJJBBBJBJBBAAJJJJJJJJJJAAAAFABFFJBJJBBJBFJBJBAAAAAJAJAAAAAAAAJJJJJJJJJJJJJJJJJJJJJJJA"
DATA "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"

 
  Obviously a simpler image, would be less code and simpler,  I am going to work on adding code, that makes the image only appear for a few second.

 97 
 on: April 03, 2012, 10:02:26 pm 
Started by Draugr - Last post by GarrisonRicketson
This is a example of using a data file for the image. In this case it is a small bunny, that moves back and forth across the screen, the code can be copied and pasted, into note pad, or most any text editor, or directly in to the qb64 IDE and saved as the .bas , once compiled into a executable, the source (.bas) is not visbable, in the executable,  ...I am assumeing you know how to do that,..if not I will need to explain from scratch, starting with some real simple things, ..
Code:
'moving the bunny back and forth:
limitfps% = 32
bunnymaxsp% = 100 * limitfps% '*pixels/sec
bunnydirection% = 1
bunnyspeed% = bunnymaxsp% / limitfps%
BunnyWidth% = 16
BunnyHeight% = 16
SCREEN 13
OUT &H3C8, 0
OUT &H3C9, 0
OUT &H3C9, 48

_FULLSCREEN
CLS

' Bitmap for the sprite
DATA 0,0,0,0,0,15,0,0,0,0,15,0,0,0,0,0,0
DATA 0,0,0,0,0,15,15,0,0,15,15,0,0,0,0,0,0
DATA 0,0,0,0,0,0,15,0,0,0,15,0,0,0,0,0,0
DATA 0,0,0,0,0,0,0,15,15,15,0,0,0,0,0,0,0
DATA 0,0,0,0,0,0,0,15,15,15,0,0,0,0,0,0,0
DATA 0,0,0,0,0,0,15,0,15,0,15,0,0,0,0,0,0
DATA 0,0,0,0,0,0,15,15,15,15,15,0,0,0,0,0,0
DATA 0,0,0,0,0,0,0,15,15,15,15,0,0,0,0,0,0
DATA 0,0,0,0,0,0,0,0,15,15,15,0,0,0,0,0,0,0
DATA 0,0,0,0,0,0,0,15,15,15,15,15,0,0,0,0,0
DATA 0,0,0,0,0,0,15,15,15,15,15,15,0,0,0,0,0
DATA 0,0,0,0,0,15,0,15,15,15,15,0,15,0,0,0,0
DATA 0,0,0,0,0,0,0,0,15,15,15,15,0,0,0,0,0
DATA 0,0,0,0,0,0,15,15,0,0,0,0,15,15,0,0,0
DATA 0,0,0,15,15,15,0,0,0,0,0,0,15,15,15,0
DATA 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
DATA 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0

' An array to hold the sprite
DIM Bunny%(BunnyWidth%, BunnyHeight%)

' Read the sprite in from DATA to the array
FOR Y = 0 TO BunnyHeight%
    FOR X = 0 TO BunnyWidth%
        READ Bunny%(X, Y)
    NEXT X
NEXT Y
bunnystart# = TIMER(.001)
bunnydirection% = 1
BunnyStartx% = 0
dothisstuff% = 1
DO
    DO
    LOOP UNTIL _MOUSEINPUT = 0
    SELECT CASE INKEY$
        CASE CHR$(27)
            dothisstuff% = 0
    END SELECT
    IF dothisstuff% THEN
        CLS
        '* your mouse and key handling here
        IF bunnypositionx% >= _WIDTH(0) - BunnyWidth% THEN '* BunnyWidth% is width of bunny image
            bunnydirection% = -bunnydirection%
            BunnyStartx% = bunnypositionx% - 1
            bunnystart# = TIMER(.001)
        ELSEIF bunnypositionx% < 0 THEN
            bunnydirection% = -bunnydirection%
            BunnyStartx% = bunnypositionx% + 1
            bunnystart# = TIMER(.001)
        END IF
        bunnypositionx% = BunnyStartx% + bunnydirection% * bunnyspeed% * (TIMER(.001) - bunnystart#)
        PUT2 Bunny%(), BunnyWidth%, BunnyHeight%, bunnypositionx%, 170
        _DISPLAY
        _LIMIT limitfps%
    ELSE
        EXIT DO
    END IF
LOOP

SUB PUT2 (Sprite() AS INTEGER, XSize AS INTEGER, YSize AS INTEGER, X AS INTEGER, Y AS INTEGER)
' Draw the sprite from the array onto the screen
FOR YP = 0 TO YSize - 1
    FOR XP = 0 TO XSize - 1
        PSET (X + XP, Y + YP), Sprite(XP, YP)
    NEXT XP
NEXT YP
END SUB

 

 After you paste this code into the qb64 editor (IDE), select Run, when it runs it automaticly creates the executable,  to save it select the SAVE AS (filename.bas)  usually the executable will also have the same name (filename.exe), however on mine, (qb64 for Linux), sometimes, the executable, still comes out  "untitled", so you may want to check that if you don't see the filename you choose, look for a "untitled.exe", try running it, if it is the correct program, the one you just compiled, re-name it to whatever name you want.

 98 
 on: April 03, 2012, 09:30:36 pm 
Started by Draugr - Last post by GarrisonRicketson
On the 32 and 64 bit , I am not sure, I can get back on that later.  On the "splash" image,
 that is very much possible,  a image can be converted into data file, that is then included in the "program",  When a lot of images are used, this is not very practical, but with just one "spalsh" image, that loads for a few seconds,  it would be ok.
 Every thing you are thinking about here, can be done, I am sure,
 How ever I can see, by the example you wrote,  you will need to learn some about the qb64 commands,..
 There is a example, of useing a data file to load a image, here on the forum, but it has been so long, I need to look for it,  and also a qb64 program, that can convert images to data, I believe it is limited to BMP,
Converts a .BMP to DRAW see this thread     
 When a executable is compiled, there are some DLL files that must be include with the program,  for windows, my thoughts, are that would be all you would need to do, include the DLL s, form the 32 bit ver, for the 32 bit, and I am sure the DLL files for the 64 bit, are different, so you  would need to include those, I can check on that. 
 or it might be faster and easier for you to, post the same question, on http://www.qb64.net You will need to register, to login and post just as you did here.
  Using a data file within the program, once the program is compiled, into a .exe , no one would be able to "copy" or get the image,out of the program,  one could make a "screen shot", maybe, but if it is a "splash" image, they probabley wouldn't have time.
 I do not use windows, I use Linux, so on some of this,I can not help much.
from Garry
Edited: NEW EDIT
   I made a example, with a game, SMGBGE, written by Terrie Richie, it is to large to post the entire .bas here, so I have put it on drop box, http://dl.dropbox.com/u/15387474/SMGBUG-qb64splash.bas.zip This is only a .bas file , you will need to compile it with qb64. It displays the "spalsh image" (qb64 logo) about 3 seconds, then it starts the game, ..with no chdir, or separate programs,
 You may want to check it out.
from Garry

 99 
 on: April 03, 2012, 09:04:00 pm 
Started by Draugr - Last post by GarrisonRicketson
The best resource available, is the wiki:
 qb64 wiki
 There is a periodicly updated, down loadable version, qb654 off line wiki
There is a tutorial section, that also could be copied and printed, if you want it on paper,..or like wise you could just keep as a refference, text file, on your computer.
qb64 Tutorials
 There are some you tube videos, that come up in a google search, but I don't know if they are any good, or downloadable.
 Recently there was some news of a book that has been published, but it is a hoax, the book consists of all the material, in the QB64 wiki,  the same as I have shown in these links, the authors, simpley copied all the material, printed 188 pages, and published as a book. It would be totally silly to purchase this "book", when you can do the same for free, just copy the material, and print it on your printer. If you don't have a printer, you could  make a CD of the off line wiki, and or any parts of the wiki, you are interested, then take the CD some where to have it printed.

 The other thing about he "book", is the authors never got any permission, or support from the author of QB64,  Galleon, http://www.QB64.net, nor "Clippy" Ted Weiesnburger, the author if the wiki, where these scuzz butts, "pirated" the material , for the book.
  hope this helps,..
from Garry

 100 
 on: April 02, 2012, 03:43:08 pm 
Started by Draugr - Last post by Draugr
Hi everyone.

I wanted to ask if there was a QB64 training book, or something along the lines of a computer based training dvd/video series? I used to program in BASIC and Turbo Pascal about 20 years ago and I've been wanting to get back into programming as a hobby again. Over the years I tinkered with and enjoyed QB, so I did some searching and came to this site.

I'd love to be able to purchase a printed book that teaches the A to Z's of QB64 or to purchase something like those CBT Nugget training series DVDs for QB64. I know the DVD/video idea probably won't happen anytime soon, but I thought it can't hurt to ask.

Please let me know if there is a training book, or even e reference book for QB64. I like having a printed book to reference, or to read when I'm away from the computer. Also, when I'm coding I hate having to get distracted and surf the web for answers. Having the book by my side is quicker and works best for me at least.

Thanks
John

Pages: 1 ... 8 9 [10]
Powered by EzPortal
Bookmark this site! | Upgrade This Forum
SMF For Free - Create your own Forum

Buy traffic for your forum/website
traffic-masters
Powered by SMF | SMF © 2016, Simple Machines