Welcome, Guest
You have to register before you can post on our site.

Username/Email:
  

Password
  





Search Forums

(Advanced Search)

Forum Statistics
» Members: 308
» Latest member: Donaldvem
» Forum threads: 1,741
» Forum posts: 17,901

Full Statistics

Latest Threads
The QB64 IDE shell
Forum: Utilities
Last Post: JasonPag
09-16-2024, 05:37 PM
» Replies: 9
» Views: 762
Importance regarding Ches...
Forum: Utilities
Last Post: JasonPag
09-01-2024, 06:34 PM
» Replies: 0
» Views: 31
Chess and Analysis and En...
Forum: Utilities
Last Post: JasonPag
08-28-2024, 02:37 PM
» Replies: 0
» Views: 32
DAY 009:_PutImage
Forum: Keyword of the Day!
Last Post: grymmjack
09-02-2023, 02:57 PM
» Replies: 54
» Views: 2,034
Fall Banner Contest?
Forum: Site Suggestions
Last Post: grymmjack
08-31-2023, 11:50 PM
» Replies: 36
» Views: 1,261
ColorPicker - Function th...
Forum: Dav
Last Post: Dav
08-31-2023, 11:04 PM
» Replies: 3
» Views: 315
Goals(1) = New Tile()
Forum: Works in Progress
Last Post: RhoSigma
08-31-2023, 09:45 PM
» Replies: 3
» Views: 127
micro(A)v11
Forum: QBJS, BAM, and Other BASICs
Last Post: bplus
08-31-2023, 09:14 PM
» Replies: 90
» Views: 3,589
Updating The Single Most ...
Forum: QBJS, BAM, and Other BASICs
Last Post: bplus
08-31-2023, 09:13 PM
» Replies: 7
» Views: 254
QBJS Image Question
Forum: QBJS, BAM, and Other BASICs
Last Post: bplus
08-31-2023, 05:49 PM
» Replies: 5
» Views: 155

 
  String to Array
Posted by: AtomicSlaughter - 02-13-2023, 10:31 AM - Forum: Utilities - Replies (1)

A Handy piece of code that will split a string into an array.

Code: (Select All)
Sub StringSplitter (ST As String, AR() As String, DL As String)
    Dim Delim(Len(DL)) As String
    For i = 1 To Len(DL)
        Delim(i) = Mid$(DL, i, 1)
    Next
    c = 1
    Do
        For i = 1 To UBound(Delim)
            If Mid$(ST, c, 1) = Delim(i) Then
                ReDim _Preserve AR(UBound(AR) + 1)
                c = c + 1
                Exit For
            End If
        Next i
        AR(UBound(AR)) = AR(UBound(AR)) + Mid$(ST, c, 1)
        c = c + 1
    Loop Until c > Len(ST)
End Sub

Print this item

  Using RhoSigma's Notepad++ Config
Posted by: TerryRitchie - 02-13-2023, 04:17 AM - Forum: General Discussion - Replies (2)

In another discussion RhoSigma reminded us that he built a QB64 config for NotePad++:

https://staging.qb64phoenix.com/showthre...epad%2B%2B

I'm working on a library that has at present well over 5000 lines of code and growing. I decided to give RhoSigma's Notepad++ config a whirl and it's great!

I broke my library up into modules (.BM files) and $INCLUDE them in the main module. I loaded each .BM extension file into separate NotePad++ tabs and use the main library code in the QB64 IDE. This is working out really well.

When I make a change in one of the NotePad++ .BM files and introduce an error, after switching back to the IDE the IDE still informs me in which .BM file the error occurred and in which line number. I jump back over to NotePad++, click the appropriate tab, scroll down to the line number and make the corrections/changes.

I highly recommend giving this a try. It has completely changed my programming flow in a very positive way. I have a two monitor setup but this could easily work on a single monitor setup as well.

I'm not using NotePad++ as a replacement for the IDE. I still love the QB64PE IDE but RhoSigma's config for NotePad++ makes an excellent IDE enhancement tool.

This config had to have taken a great deal of time and patience to develop and I would like to thank RhoSigma for doing this.

Print this item

Bug FBCWIN - Wormer
Posted by: mnrvovrfc - 02-13-2023, 01:41 AM - Forum: QBJS, BAM, and Other BASICs - No Replies

Have at it. It's "Wormer", a clone of "Nibbles" or "Snake" or something else. IT'S IN FREEBASIC. Sorry I don't have the motivation to port it to QB64 but it should be easy enough for someone else. Smile

Code: (Select All)
'by mnrvovrfc May-2014
#Include "fbmessage.bi"
#Include "util.bi"
#Include "truecolr256.bi"
#Include "file.bi"

Enum namesprites
wormhead = 1
wormbody = 5
wormvanish = 7
wallsolid = 9
wormfood = 13
wormnumeral = 17
wormletters = 27
wormportal = 49
wormevil
wormheart = 54
lastsprite = 55
End Enum

Enum nameicon
noicon = 0
iconwall
iconworm
iconfood
iconshrink
iconportal
End Enum

Type charpgtype
    As Integer x, y, xi, yi, s, c
End Type

Const thewallcolor = RGB(255, 255, 255), theshrinkcolor = RGB(255, 0, 0), theportalcolor = RGB(0, 255, 0)
Const thewormcolor = RGB(0, 0, 255)

Declare Sub PrintFancyMessage(which As Integer)
Declare Sub DrawWalls()
Declare Sub Drawcharpg()
Declare Function CheckIcon(x As Integer, y As Integer, actual As Integer = 0) As nameicon
Declare Sub SetIcon(x As Integer, y As Integer, valu As nameicon)
Declare Sub Centertext(ro As Integer, tx As string)

Dim Shared As nameicon icon(1 To 53, 1 To 40)
Dim Shared As Any Ptr spr(1 To lastsprite)
Dim Shared As charpgtype cw(1 To 100), cj(1 To 10), mv(1 To 16)
Dim As Any Ptr s1, s2
Dim As String curp, bmpfile, nameprog
Dim As Integer i, j, u, x, y, z, resu

nameprog = "Wormer (Nibbles)"
curp = ExePath() + "\"
bmpfile = curp + "wormer.bmp"
If FileExists(bmpfile) = 0 Then
    fb_message(nameprog, "File not found:" + Chr(13) + bmpfile, MB_ICONERROR)
    End 1
EndIf

Randomize
ScreenRes 640, 480, 32
WindowTitle nameprog
s1 = ImageCreate(96, 96)
s2 = ImageCreate(53, 40)
resu = BLoad(bmpfile, s1)
z = 1
For j = 0 To 7
    For i = 0 To 7
        spr(z) = ImageCreate(12, 12)
        Get s1, (i * 12, j * 12)-Step(11, 11), spr(z)
        z += 1
    Next
Next

Dim Shared As Integer thiswall, lengthworm
Dim As Integer died, done, wormspeed, score, bonus, lvl, numworm, hits
Dim As Integer whead, refreshwall, numfood, startother, portalrestore, maxmove, fl
Dim As Integer onfreelife
Dim As String ke, lvlbmpfile

Color smalt, khaki
Cls
lvl = 1: fl = 0
Centertext(12, "Wormer -- A Crude Version of Nibbles")
Centertext(15, "Press [ESC] at any time to quit.")
Centertext(18, "Some levels have portals.")
Centertext(21, "Others have patrolling robots.")
Centertext(24, "The worm dies if it strikes a part of itself,")
Centertext(25, "a wall or one of the robots.")
Centertext(28, "Use your arrow keys for movement.")
Centertext(31, "If your score is at least 4,")
Centertext(32, "Press [ENTER] during game play to view it briefly.")
Centertext(38, "Use [UP] and [DOWN] arrow keys to change level, [ENTER] to select.")
Centertext(40, "What level do you want to begin play?")
Centertext(42, "Level = 1")
Do
    ke = InKey()
    If Len(ke) > 1 Then
        ke = Right(ke, 1)
        Select Case ke
            Case "H"
                If lvl < 36 Then lvl += 1: fl = 1
            Case "P"
                If lvl > 1 Then lvl -= 1: fl = 1
        End Select
    EndIf
    If fl = 1 Then
        fl = 0
        Centertext(42, "  Level = " + Str(lvl) + "  ")
    EndIf
    Sleep(100, 1)
Loop Until (ke = Chr(13)) Or (ke = Chr(27))
If ke = Chr(27) Then GoTo pend

Centertext(47, "At what speed to you want to play?")
Centertext(49, "(1) = slow, (2) = fast, (3) = quick")
Do: ke = InKey(): Loop Until ke = ""
Do
    ke = InKey()
    If (ke = "1") Or (ke = "2") Or (ke = "3") Then Exit Do
    Sleep(100, 1)
Loop Until (ke = Chr(13)) Or (ke = Chr(27))
If ke = Chr(27) Then GoTo pend
If ke = Chr(13) Then ke = "1"
wormspeed = (52 - Asc(ke)) * 50

done = 0
numworm = 6
score = 0: bonus = 0
thiswall = Rand(wallsolid, wormfood - 1)
hits = 0
If lvl > 15 Then onfreelife = 1 Else onfreelife = 0

Do          ''until done, main program loop
Color , 0
Cls
refreshwall = 1
lengthworm = 4
died = 0
portalrestore = 0

Erase cw, cj

lvlbmpfile = curp + "wormer" + PadZero(lvl, 2) + ".BMP"
If FileExists(lvlbmpfile) = 0 Then
    fb_message(nameprog, "BMP file not found for level " + Str(lvl) + "!", MB_ICONERROR)
    End 4
EndIf
resu = BLoad(lvlbmpfile, s2)
u = 0
For i = 1 To 53
    For j = 1 To 40
        If u > 0 Then u += 1
        z = Point(i - 1, j - 1, s2)
        Select Case z
            Case thewallcolor
                icon(i, j) = iconwall
            Case theshrinkcolor
                icon(i, j) = iconshrink
            Case theportalcolor
                icon(i, j) = iconportal
            Case thewormcolor
                If u = 0 Then
                    u = 1
                    cw(1).x = i * 12 - 12: cw(1).y = j * 12 - 12
                ElseIf u = 2 Then
                    cw(1).xi = 0: cw(1).yi = 12
                    whead = wormhead + 3
                Else
                    cw(1).xi = 12: cw(1).yi = 0
                    whead = wormhead
                EndIf
                icon(i, j) = noicon
            Case Else
                icon(i, j) = noicon
        End Select
    Next
Next
With cw(1)
    .s = whead
    x = .x
    y = .y
End With
Select Case lvl
    Case 1, 2, 3, 4
        numfood = 2
        startother = 0
    Case 5, 6, 7, 9, 11 To 14, 16  
        numfood = 3
        startother = 0
    Case 8, 10
        numfood = 3
        startother = 9
    Case 15
        numfood = 3
        startother = 8
    Case 17
        numfood = 4
        startother = 7
    Case 18 To 22
        numfood = 4
        startother = 0
    Case 23, 24
        numfood = 5
        startother = 0
    Case 25
        numfood = 5
        startother = 7
    Case 26
        numfood = 5
        startother = 9
    Case 27 To 29
        numfood = 6
        startother = 0
    Case 30, 33
        numfood = 4
        startother = 10
    Case 31, 32, 34
        numfood = 3
        startother = 9
    Case 35, 36
        numfood = 2
        startother = 0
End Select

#Include "wormer.bi"

For j = 2 To lengthworm
    cw(j).x = x
    cw(j).y = y
    cw(j).s = whead
    x -= cw(1).xi
    y -= cw(1).yi
Next
z = 0
For i = 1 To numfood
    With cj(i)
        .x = 0: .y = 0: .s = 0      ''position (x, y) and food type
        .xi = 0     ''number of steps to remain on screen (.c greater than zero)
        .yi = 0     ''not used
        .c = z      ''total number of steps (if negative, food not activated yet)
    End With
    If i > 1 Then z -= Random1(20) * 10
Next
cj(1).c = z
If (lvl >= 8) And (startother > 0) Then
    z = startother
    For j = 1 To 40
        For i = 1 To 53
            If icon(i, j) = iconportal Then
                With cj(z)
                    .x = i * 12 - 12
                    .y = j * 12 - 12
                    If lvl < 30 Then
                        .s = wormportal
                    Else
                        icon(i, j) = noicon
                        .s = wormevil   ''sprite indicate it's a bad guy
                        .c = 0          ''pointer into mv()
                        .xi = 100       ''current step to take
                        .yi = 0         ''animation flag
                    EndIf
                End With
                z += 1
            EndIf
        Next
    Next
    If lvl = 32 Then
        Swap cj(9), cj(10)
    EndIf
EndIf

PrintFancyMessage(2)
Do
    ke = InKey()
Loop Until (ke = "") Or (ke = Chr(27))
If ke = Chr(27) Then done = 1: Exit Do

Do
    ke = InKey()
    If Len(ke) = 2 Then
        ke = Right(ke, 1)
        Select Case ke
            Case "k"
                done = 1
                Exit Do
            Case "H"
                If cw(1).yi = 0 Then cw(1).xi = 0: cw(1).yi = -12: whead = 2
            Case "K"
                If cw(1).xi = 0 Then cw(1).yi = 0: cw(1).xi = -12: whead = 3
            Case "M"
                If cw(1).xi = 0 Then cw(1).yi = 0: cw(1).xi = 12: whead = 1
            Case "P"
                If cw(1).yi = 0 Then cw(1).xi = 0: cw(1).yi = 12: whead = 4
        End Select
    Else
        Select Case ke
            Case Chr(13)
                If score > 3 Then
                    PrintFancyMessage(score)
                    refreshwall = 1
                EndIf
            Case Chr(27)
                done = 1
                Exit Do
        End Select
    EndIf
    With cw(lengthworm)
        Line(.x, .y)-Step(11, 11), 0, BF
        SetIcon(.x, .y, noicon)
    End With
    If (cw(1).s = 1) Or (cw(1).s = 3) Then
        cw(1).s = wormbody + 1
    Else
        cw(1).s = wormbody
    EndIf
    For j = lengthworm - 1 To 1 Step -1
        i = j + 1
        cw(i) = cw(j)
    Next
    With cw(1)
        .x += .xi
        .y += .yi
        If .s <> whead Then .s = whead
        If .x < 0 Then .x = 624
        If .x > 624 Then .x = 0
        If .y < 0 Then .y = 468
        If .y > 468 Then .y = 0
        z = CheckIcon(.x, .y)
        If (z = iconwall) Or (z = iconworm) Then died = 1
        If z = iconportal Then
            For j = startother To 10
                If (cj(j).x = .x) And (cj(j).y = .y) Then Exit For
            Next
            If j <= 10 Then
                If startother = 9 Then
                    If j = 9 Then i = 10 Else i = 9
                Else
                    Do
                        i = Rand(startother, 10)
                    Loop While i = j
                EndIf
                .x = cj(i).x
                .y = cj(i).y
                portalrestore = lengthworm + 2
            EndIf
        ElseIf z = iconshrink Then
            If lengthworm > 4 Then
                bonus = bonus \ 2
                u = Random1(2) * 4
                Do While (u > 0) And (lengthworm > 4)
                    With cw(lengthworm)
                        SetIcon(.x, .y, noicon)
                        Line(.x, .y)-Step(11, 11), 0, BF
                        lengthworm -= 1
                        u -= 1
                    End With
                Loop
            EndIf
        Else
            SetIcon(.x, .y, iconworm)
        EndIf
    End With
    For i = 1 To numfood
        If cj(i).s > 0 Then
            With cj(i)
                .c += 1
                If .c > .xi Then
                    .c = Random1(20) * -10
                    .s = 0
                    SetIcon(.x, .y, noicon)
                    Line(.x, .y)-Step(11, 11), 0, BF
                ElseIf (.x = cw(1).x) And (.y = cw(1).y) Then
                    If .s = wormheart Then
                        numworm += 1
                        bonus += 1
                    Else
                        x = .s - wormfood + 1
                        If bonus = 0 Then bonus = 1 Else bonus += (x \ 4)
                        score += bonus
                        hits += 1
                        If lengthworm <= 100 Then
                            x *= 4
                            Do While x > 0
                                If portalrestore > 0 Then portalrestore += 1
                                lengthworm += 1
                                x -= 1
                                cw(lengthworm) = cw(lengthworm - 1)
                            Loop
                        EndIf
                    EndIf
                    .c = Random1(20) * -10
                    .s = 0
                    SetIcon(.x, .y, noicon)
                EndIf
            End With
        Else
            With cj(i)
                .c += 1
                If .c > 0 Then
                    If (i = 1) And (onfreelife > 0) Then
                        onfreelife = 0
                        .s = wormheart
                        .xi = 100
                    Else
                        y = Random1(20)
                        .s = wormfood
                        .xi = 200
                        Select Case y
                            Case 1
                                .s += 3
                                .xi = 100
                            Case 2, 3
                                .s += 2
                                .xi = 100
                            Case 4, 5, 6
                                .s += 1
                                .xi = 100
                        End Select
                    EndIf
                    Do
                        .x = Random1(51) + 1
                        .y = Random1(38) + 1
                    Loop Until CheckIcon(.x, .y, 1) = noicon
                    icon(.x, .y) = iconfood
                    .x = .x * 12 - 12
                    .y = .y * 12 - 12
                EndIf
            End With
        EndIf
    Next
    If (lvl >= 30) And (lvl < 35) Then
        For i = startother To 10
            With cj(i)
                If .c = 0 Then u = 100 Else u = mv(.c).c
                .xi += 1
                If .xi > u Then
                    .xi = 0
                    Do
                        .c += 1
                        If .c > maxmove Then .c = 1
                    Loop Until mv(.c).s = i
                EndIf
                Line(.x, .y)-Step(11, 11), 0, BF
                .x = .x + mv(.c).xi
                .y = .y + mv(.c).yi
                If .y < 0 Then .y = 468
                If .y > 468 Then .y = 0
                If .x < 0 Then .x = 624
                If .x > 624 Then .x = 0
                .yi = Not .yi
                If CheckIcon(.x, .y) = iconworm Then died = 1
            End With
        Next
    ElseIf portalrestore > 0 Then    
        portalrestore -= 1
        If portalrestore < 1 Then
            For j = startother To 10
                With cj(j)
                    SetIcon(.x, .y, iconportal)
                End With
            Next
        EndIf
    EndIf
    ''------------------------------------------------
    If refreshwall > 0 Then
        refreshwall = 0
        DrawWalls()
    EndIf
    Drawcharpg()
    Sleep(wormspeed, 1)
Loop Until (died > 0) Or (hits > 10) Or (done > 0)

If done > 0 Then
    ''[ESC] was pressed, quit main program loop
ElseIf died > 0 Then
    For j = wormvanish To wallsolid
        With cw(1)
            Line(.x, .y)-Step(11, 11), 0, BF
            If j < wallsolid Then Put(.x, .y), spr(j), Trans
        End With
        Sleep(100, 1)
    Next
    PrintFancyMessage(3)
    numworm -= 1
    If numworm < 1 Then
        Do
            PrintFancyMessage(1)
            ke = InKey()
            If ke = Chr(27) Then done = 1: Exit Do
            PrintFancyMessage(score)
            ke = InKey()
            If ke = Chr(27) Then done = 1
        Loop Until done > 0
    Else
        Color RGB(128, 255, 192)
        Locate 28, 28: Print "Please press any key...";
        Do: ke = InKey(): Loop Until ke = ""    
        Sleep
        If bonus > 1 Then bonus -= 1
    EndIf
ElseIf hits > 10 Then
    lvl += 1
    If lvl > 36 Then
        Color smalt, khaki
        Cls
        Centertext(12, "There are no more levels.")
        Centertext(18, "You won the game, congratulations!")
        Centertext(24, "Score: " + Str(score))
        Centertext(32, "Press [ESC] to quit the program.")
        Do: ke = InKey(): Loop Until ke = Chr(27)
        done = 1
    EndIf
    thiswall = Rand(wallsolid, wormfood - 1)
    hits = 0
    If lvl > 15 Then onfreelife = 1 Else onfreelife = 0
EndIf

Loop Until done > 0     ''end of main program loop

pend:
For z = 1 To lastsprite
    ImageDestroy(spr(z))
Next
ImageDestroy(s2)
ImageDestroy(s1)
End

Sub PrintFancyMessage(which As Integer)
    Dim As UByte Ptr ndx
    Dim As String * 10 mesg
    Dim As String ke
    Dim As Integer j, c, x = 264
    
    Select Case which
        Case 1: mesg = Chr(33, 34, 35, 36, 48, 37, 38, 36, 39, 32)      ''Game Over!
        Case 2: mesg = Chr(33, 36, 27, 48, 28, 36, 34, 29, 40, 32)      ''Get Ready!
        Case 3: mesg = Chr(41, 42, 30, 48, 43, 44, 36, 29, 32, 48)      ''You Died!
        Case Else                                                       ''Score:0000
            mesg = Chr(45, 46, 42, 39, 36, 47)
            ke = Str(which)
            If which < 1000 Then mesg &= "0"
            If which < 100 Then mesg &= "0"
            If which < 10 Then mesg &= "0"
            For j = 1 To Len(ke)
                c = Asc(ke, j) - 32
                If c < 17 Then c += 10
                mesg &= Chr(c)
            Next
    End Select
    Line(264, 216)-Step(120, 11), 0, BF
    ndx = StrPtr(mesg)
    For j = 0 To 9
        Put(x, 216), spr(ndx[j]), Trans
        x += 12
    Next
    Sleep(3000, 1)
    Line(264, 216)-Step(120, 11), 0, BF
End Sub

Sub DrawWalls()
    Dim As Integer i, j
    Cls
    For i = 1 To 53
        For j = 1 To 40
            Select Case icon(i, j)
                Case iconwall
                    Put(i * 12 - 12, j * 12 - 12), spr(thiswall), Trans
            End Select
        Next
    Next
End Sub

Sub Drawcharpg()
    Dim As Integer j, u
    For j = 1 To 10
        If cj(j).s > 0 Then
            With cj(j)
                If (.s >= wormevil) And (.s < wormheart) Then
                    If (.xi < 0) Or (.yi < 0) Then u = .s + (2 - .yi) Else u = .s + (-1 * .yi)
                    Put(.x, .y), spr(u), Trans
                Else
                    Put(.x, .y), spr(.s), Trans
                EndIf
            End With
        EndIf
    Next
    For j = lengthworm To 1 Step -1
        With cw(j)
            If .s > 0 Then
                Put(.x, .y), spr(.s), Trans
            EndIf
        End With
    Next
End Sub

Function CheckIcon(x As Integer, y As Integer, actual As Integer = 0) As nameicon
    Dim As Integer px, py
    If actual > 0 Then
        px = x: py = y
    Else
        px = x \ 12 + 1: py = y \ 12 + 1
    EndIf
    Return icon(px, py)
End Function

Sub SetIcon(x As Integer, y As Integer, valu As nameicon)
    Dim As Integer px, py
    px = x \ 12 + 1: py = y \ 12 + 1
    icon(px, py) = valu
End Sub

Sub Centertext(ro As Integer, tx As string)
    Dim As Integer lx
    lx = Len(tx)
    If lx > 0 Then
        lx = 40 - (lx \ 2)
        Locate ro, lx
        Print tx;
    EndIf
End Sub

Boards could be created but have to follow specific dimensions and pixel colors. Each pixel is a "big" position on the screen, ie. the snake's body part, food, wall etc. The snake could wrap around from one side of the screen to another unless the wall stops it. There are many other things to discover that I'm not going to reveal. Oh well the instructions near the top of the source code give away a lot already but not playing the game would miss it.

This program should compile without problems with Freebasic as GUI program for Windows. It has no sound. For Linux the "fb_message()" would have to be removed, call "exec()" instead to bring about a dialog box from "yad", "zenity" or other such utility.

All BMP files are required except "wormer-empty.bmp", that one exists to help the user create a new one out of it for the game.


.zip   mnrvovrfc-wormer.zip (Size: 18.57 KB / Downloads: 28)

Print this item

Lightbulb Allow source code to run, but not show it
Posted by: mnrvovrfc - 02-11-2023, 11:43 PM - Forum: QBJS, BAM, and Other BASICs - Replies (6)

https://staging.qb64phoenix.com/showthread.php?tid=1462

This thread has me asking entirely out of ignorance: is there a way in "BAM" or "QBJS" to provide source code and run it, without allowing a different user to see the source code, or allowing that user to see a small portion of it?

Print this item

  Heart-drawing programs
Posted by: CharlieJV - 02-11-2023, 09:16 PM - Forum: QBJS, BAM, and Other BASICs - Replies (1)

Port of FreeBasic programs to BASIC Anywhere Machine.  Scroll down to see the source code below the graphic:  Heart and  Heart2

Print this item

Lightbulb Extended message box
Posted by: mnrvovrfc - 02-11-2023, 08:41 PM - Forum: General Discussion - Replies (12)

How difficult would it be to create a "deluxe" edition of the Message Box which supports a large amount of text? What I mean is, an "OK" button, and a text field with scrollbars that could hold reasonably a larger amount of text than an ordinary Message Box. Take for instance the dialog seen in many Windows installers, to display the License Agreement, and usually has two buttons: "I agree" or "I decline".  Just offer the one button to get out of the dialog.

It would be a good alternative to the "SCREEN 0" to show more stuff that could fit on that screen. The problem could be how large to make the window and the scrollable text holder.

Code: (Select All)
/------------------------------------------------\
| +-----------------------------------+          |
| |This is an example of text.       ^|          |
| |                                  I|  +-----+ |
| |                                  I|  | OK  | |
| |                                  I|  +-----+ |
| |                                  I|          |
| |<================================>V|          |
| +-----------------------------------+          |
\------------------------------------------------/

I have taken the idea from the Purebasic Code Archive, which used WinAPI, and created a version of it with Autohotkey. It should be doable with TinyFileDialog library. Of course, this is something that should be supported on all platforms.

I have also created a scrollable window that works with the mouse but some of you would find it clunky.

Print this item

  The best kind of documentation let's you try your own code, right there
Posted by: CharlieJV - 02-11-2023, 06:58 PM - Forum: QBJS, BAM, and Other BASICs - Replies (2)

Programming Reference: feature to try your own code next to code snippets

Print this item

  Love and War (FPS shooter and builder game in -QB64)
Posted by: MasterGy - 02-11-2023, 12:43 PM - Forum: MasterGy - Replies (12)

Hello !

I finished the game.

Builder mode

It is possible for 1 or more people to create simple structures from blocks at the same time.
The cubes can be textured in 10 different ways. You can also talk to each other while building.
There are 400 cubes available in one room. You can also create a new room.

Extreme mode

The aim of the game is to win the love of the princess. This is only possible if you are wearing the royal crown.
Gameplay : The server places the crown in one of the rooms. We need to get this as soon as possible.
In order to do this, if someone has already taken the crown, they must be shot. If we have it, we need it
to protect ourselves and find the princess as soon as possible.
Navigation (radar and compass) and narration always help us choose the right options.

The game shows the ping value. (server -> client, then client -> server travel time). This is .06s in Hungary.

Good game, I hope many of you will try the final version!

( The YouTube video is in HD, but you still have to wait for processing. )



download:

https://drive.google.com/file/d/1qBYhISj...sp=sharing

Print this item

  UNCREATION - A new text mystery adventure!
Posted by: johannhowitzer - 02-10-2023, 09:47 PM - Forum: Works in Progress - Replies (23)

"Most things are built with a purpose in mind.  If made well, they serve their purpose
until they wear out, and are discarded or replaced.  I've spent my life building things,
sometimes successfully, sometimes I had to give up and start again.  You can't let yourself
be discouraged by failure; after all, in failure we learn the most.

But this time is different.  Some failures can be set aside, others must be atoned for.
I just hope I'm not too late..."

-------------------------------------------

In UNCREATION, you'll use a simple, focused set of text commands to explore intriguing
locations and try to piece together what's happening.  The classic shortcomings of text
adventure games lie in the overwhelming complexity of human language, and the need for
obscure solutions to make progress.  Here, the options available to you are limited
greatly, so the focus can shift onto taking in your environment, and making sense of
information.

Great care has been taken to make sure the places you'll explore will not be overwhelming.
You should not need to make maps of locations unless you personally find it helpful,
there are no mazes.


Download here!


Currently, the prologue and first chapter are completed!  The second chapter is fully designed
and is in the process of being added to the game, and the third chapter is on the drawing
board.

I have done some testing myself, and it all seems to be working correctly!  Please check
this game out, and if so inclined, give me your feedback, let me know if you find any bugs
or problems, and enjoy!

If you're on the fence about trying this, check out the screenshots below before downloading,
to get an idea of what you're in for.  There are no spoilers.



[Image: ss3.png][Image: ss4.png][Image: ss0.png][Image: ss2.png]

Print this item

  instr function in reverse ???
Posted by: doppler - 02-10-2023, 01:51 PM - Forum: General Discussion - Replies (3)

Here is a bit to knock around.

I have a standard routine I use to find the last occurrence of a character in a string. Happens to be "\".  Using a do loop to search out a string is easy.  Looking to make it faster.  Would it be beneficial, to specify the direction of search in instr function?  Forward or reverse order.

I am think more of an enhancement to instr function.  if it's more trouble than it's worth, I will just continue with what I got.

Print this item