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,033
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

 
  QB64 Wiki(pedia)
Posted by: Richard - 05-07-2022, 05:56 PM - Forum: General Discussion - Replies (4)

I found this somewhat interesting (already knew most of the stuff)....

   

   


found the links confusing.


Question - who actually edited the Wiki(pedia)?

Print this item

  _PutImage for Image reflection
Posted by: bplus - 05-07-2022, 04:49 PM - Forum: Help Me! - No Replies

A quick proof of concept for reflecting an image using _PutImage

Code: (Select All)
_Title "Reflection of an image" ' b+ 2022-05-07
Screen _NewImage(200, 300, 32)
_ScreenMove 400, 200
img& = _LoadImage("qb64.png")
_PutImage (0, 0)-(199, 199), img&, 0
_PutImage (0, 200)-(199, 299), img&, 0, (0, _Height(img&) - 1)-(_Width(img&) - 1, 0)
Line (0, 199)-(199, 200), &HFF000066, BF
Sleep



Attached Files Thumbnail(s)
   

.zip   Reflection by flip image.zip (Size: 3.33 KB / Downloads: 39)
Print this item

  Let's take this input for a spin
Posted by: doppler - 05-07-2022, 02:57 PM - Forum: Programs - No Replies

Code: (Select All)
_Title "Spining Input test"

'
' spin$ Just spins. It can be anything you like
' special graphics like growing periods. Even the entire character set.
' If character set suggest very high limit number, see below
'
spin$ = "|/-\" ' spin pattern.
cr$ = Chr$(13) ' end of input
esc$ = Chr$(27) ' end of program life as we know it

Print "Hit <esc> key or <enter> will exit program someway"
Print

'
' the following print statement can be anywhere on the screen EXCEPT
' at a position where input would flow over right edge of execution box.
' Why ? Because I am lazy and didn't want to handle exception at this time.
'
Print "input spin test ?  ";

Do ' outer do
    spin = 0 ' got to start somwhere

    Do ' inner do
        _Limit 10 ' limit the spin rate Higher faster, lower slower
        x$ = InKey$ ' scan a key
        If x$ = esc$ Then System ' Emergency exit "use the escape clause of contract"
        If x$ = cr$ Then BackOff1: Print " ": End ' the normal way to end input, this would be a goto
        If x$ <> "" Then Exit Do ' got a hit exit inner do
        BackOff1 'locate on top of the spin
        Print Mid$(spin$, spin Mod (Len(spin$)) + 1, 1); 'Print your selected spin character from spin$
        spin = spin + 1 ' just a running count
    Loop

    BackOff1 ' Over write spin character with x$
    Print x$; ' At this point you can build input from x$ (re: t$=t$+x$)
    Locate CsrLin, Pos(0) + 1
Loop ' Return to outer do

End ' Abnormal end, never suppose to get here

Sub BackOff1
    Locate CsrLin, Pos(0) - 1
End Sub

@pete As I named the sub I was thinking of you. re: truck mud flaps, not all have a naked lady sitting on the beach for a pattern.

Take as you like anything of this code.  Free to use or abuse.  Just test code and needs to be tweaked to your flavor.  (add all the salt and pepper you desire)

Print this item

  Comparison QB64 compiled with gcc optimizations and without
Posted by: Coolman - 05-07-2022, 09:07 AM - Forum: General Discussion - Replies (77)

I have started to test the version of qb64 compiled with the option -Ofast and the original version. resultas :

simple code using pset.

2.3x seconds : program compiled with qb64 -Ofast
3.5x seconds : program compiled with original qb64

Interesting results. Quite an important gain.

Code: (Select All)
x% = 1280: y% = 768
Screen _NewImage(x%, y%, 32)
_Delay 0.2
_ScreenMove _Middle
start = Timer(.001)
For b% = 1 To 100
    For i% = 1 To x%
        For n% = 1 To y%
            PSet (i%, n%), _RGB(Rnd * 255, 0, 0)
        Next n%
    Next i%
Next b%
Print Timer(.001) - start; "seconds"

the _ScreenMove _Middle command is supposed to center the window but if I don't put _Delay 0.2 before, sometimes it doesn't work. strange.

Print this item

Rainbow Spiderbro - an adventure puzzle game!
Posted by: crumpets - 05-07-2022, 08:39 AM - Forum: Programs - No Replies

Earlier this year I finished making a game with QB64 I'm calling Spiderbro. It is a retro inspired adventure puzzle game where you play as a purple spider trying to outsmart its shadowy adversary. Source, binaries and all other data in the zip file attached. If the engine for the game interests you at all, I put info about it on itch.io. I got two other games currently in development with this engine and maybe a new engine in development too, so if you like Spiderbro, there's much more to come and it'll all be much bigger and better Big Grin

I welcome all feedback, lay it on me Smile



Attached Files
.zip   spiderbro.zip (Size: 71.09 MB / Downloads: 46)
Print this item

  Some Noob (to QB64) Questions
Posted by: TarotRedhand - 05-07-2022, 08:29 AM - Forum: Help Me! - Replies (11)

I am in the process of trying to convert my old QB 4.5 code to QB64 and have a number of questions I hope can be answered. I will try to keep this thread focused by limiting the number of my questions in a post. If you decide to answer could you please include code  snippets as I find that to be the easiest way to learn. Anyway here is my first question.

I have a number of small graphics programs that work fine in QB64 but I would like them to utilise more of my 1080 monitors screen. By utilise I mean that I would like to have access to the individual pixels and not just stretch them to fit using _FULLSCREEN. Preferably I would like the graphics to display in a window with the close button like they currently do in the various SCREEN modes. Is this possible? Not a criticism but TBH I am a little surprised that SCREEN hasn't been expanded to include HD 720, HD 1080 or 4K.

Thanks in advance.

TR

Print this item

  Ripple - A reaction/word game
Posted by: PhilOfPerth - 05-07-2022, 05:22 AM - Forum: Programs - No Replies

This game is for one or two players, who try to find words in a constantly-changing grid of letters. Comments & suggestions welcome. It includes a complete dictionary.



Attached Files
.zip   Ripple.zip (Size: 671.86 KB / Downloads: 43)
Print this item

  Alchemy - A word Game
Posted by: PhilOfPerth - 05-07-2022, 04:12 AM - Forum: Programs - Replies (30)

Another small program that I'd like some advice on... I've called it Alchemy, and it's a game in which you try to transform a word into another related word, one letter at a time. It differs from the usual word-swap games in that you can lengthen or shorten the word as you play. I'd welcome any comments or suggestions on it



Attached Files
.zip   Alchemy.zip (Size: 3.6 KB / Downloads: 39)
Print this item

  A list of forums at or near the Portal
Posted by: PhilOfPerth - 05-07-2022, 01:23 AM - Forum: General Discussion - No Replies

I, for one, have trouble re-locating threads I've visited or subscribed to, and I reckon it would be useful to have a list of the major forums (fora?) at the Portal - after all, a portal is supposed to be the main entry-point to a location.

Print this item

  Can I restrict attempted resizing of a screen to an invalid side?
Posted by: hanness - 05-06-2022, 11:19 PM - Forum: General Discussion - Replies (3)

Apologies for so many questions. Unfortunately, there are just some things I cannot seem to figure out on my own :-)

Let's assume a create a screen like this:

 

Code: (Select All)
                oldimage& = handle&
                handle& = _NewImage(Horizontal, Vertical, 256)
                Screen handle&
                _FullScreen _Off
                _FreeImage oldimage&

I allow the user to resize the screen, but I want to restrict them from making the windows smaller than 400 x 400. That part I can do. I simply check the width and height after resizing the screen and if either width or height is less than 400 I change it to 400.

My concern is that while the user is dragging a corner of the screen to resize it, they can drag it to a point where it causes my program to crash while they are still dragging the corner but before I can check it and resize it. See the screenshot below for an example.

Put another way, I can check the size of the screen AFTER they have resized it, but I can't prevent them from dragging the corners to a ridiculously small size that causes a crash. Is there any way to prevent this?


.bmp   Image1.bmp (Size: 172.96 KB / Downloads: 91)

Print this item