Welcome, Guest |
You have to register before you can post on our site.
|
Latest Threads |
Curious if I am thinking ...
Forum: Help Me!
Last Post: SMcNeill
1 hour ago
» Replies: 16
» Views: 137
|
Glow Bug
Forum: Programs
Last Post: SierraKen
1 hour ago
» Replies: 7
» Views: 105
|
ADPCM compression
Forum: Petr
Last Post: Petr
4 hours ago
» Replies: 0
» Views: 26
|
Who wants to PLAY?
Forum: QBJS, BAM, and Other BASICs
Last Post: dbox
5 hours ago
» Replies: 15
» Views: 209
|
Trojan infection !
Forum: Help Me!
Last Post: SMcNeill
6 hours ago
» Replies: 1
» Views: 36
|
BAM Sample Programs
Forum: QBJS, BAM, and Other BASICs
Last Post: CharlieJV
Today, 02:50 AM
» Replies: 36
» Views: 1,969
|
Audio storage, stereo swi...
Forum: Programs
Last Post: Petr
Yesterday, 09:03 PM
» Replies: 8
» Views: 369
|
_CONSOLEINPUT is blocking
Forum: General Discussion
Last Post: mdijkens
Yesterday, 12:24 PM
» Replies: 7
» Views: 129
|
Most efficient way to bui...
Forum: General Discussion
Last Post: ahenry3068
01-17-2025, 11:36 PM
» Replies: 9
» Views: 137
|
QBJS - ANSI Draw
Forum: QBJS, BAM, and Other BASICs
Last Post: madscijr
01-17-2025, 11:24 PM
» Replies: 4
» Views: 135
|
|
|
Digital Cube |
Posted by: SierraKen - 06-04-2022, 10:28 PM - Forum: Programs
- No Replies
|
|
Was playing with SIN and COS again today and came across a cool color-changing layered cube that changes from strange lines to fuzzy pixels. It's much brighter than this photo shows.
Code: (Select All) Screen _NewImage(800, 600, 32)
_Title "Sierraken's Digital Cube"
Do
_Limit 50
c1 = Rnd * 255
c2 = Rnd * 255
c3 = Rnd * 255
tt = (Rnd * 360)
For t = 0 To tt Step .1
r = (Rnd * 50) - 25
x = (Sin(r) * 100 + r) + 400 + r
y = (Cos(tt) * 100 + r) + 300 + r
Circle (x, y), 1, _RGB32(c1, c2, c3)
Next t
Loop Until InKey$ = Chr$(27)
|
|
|
XONIX |
Posted by: DANILIN - 06-04-2022, 04:35 PM - Forum: Programs
- Replies (8)
|
|
? xonix ? ... XoniX ... !!! XONIX !!!
Code: (Select All) Randomize Timer: b = Int(Rnd * 15 + 7): a = Int(Rnd * 15 + 7) ' xonix.bas
y = Int(Rnd * (b - 3) + 3): x = Int(Rnd * (a - 3) + 3)
'b = 10: a = 20: y = 5: x = 5
If Rnd < .5 Then dx = -1 Else dx = 1
If Rnd < .5 Then dy = -1 Else dy = 1
For i = 1 To a: Print "#";: Next: Print ' area
For j = 1 To b - 2: Print "#";: For k = 1 To a - 2: Print ".";: Next: Print "#": Next
For i = 1 To a: Print "#";: Next
For q = 1 To 100: _Delay .03: Locate y, x: Print " "
If y + dy < 2 Or y + dy > b - 1 Then dy = -dy
y = y + dy
If x + dx < 2 Or x + dx > a - 1 Then dx = -dx
x = x + dx
Locate y, x: Print "@"
Next
qbasic qb64 xonix
gif 45 kB
https://en.wikipedia.org/wiki/Xonix
en.wikipedia.org/wiki/Xonix
|
|
|
A QuickBasic game that supports Oculus ?? |
Posted by: madscijr - 06-03-2022, 09:07 PM - Forum: General Discussion
- No Replies
|
|
I came across this today while browsing around.
A QuickBasic game that supports the Oculus headset??
I haven't tried running it (and I don't have an Oculus!)
but in case anyone is curious...
(It would be rad if QB64 added VR support!)
- Gridfighter 3D - '80s style arcade shooter written in Quickbasic. Also the very first known DOS game that supports Oculus Rift VR headset.
|
|
|
Backgammon: Blot/JanusBlot |
Posted by: BG 7 - 06-03-2022, 09:05 AM - Forum: Programs
- No Replies
|
|
Hi !
Just want to share (again) our freeware backgammon program using QB64 respectively now QB64 Phoenix Edition:
Blot/JanusBlot
Blot is a real "oldtimer" - first appearance in 1984 - with old fashioned retro graphics - but a unique AI
(handcrafted evaluation, no neural net).
Blot/JanusBlot is suitable for novices to experts, on average the play is estimated to be at
an intermediate/advanced level.
As you can see here, Blot/JanusBlot is hosted together with the 1. Backgammon-computer rating list,
please have a look at:
www.mustrum.de/blot.html
The site is in german. If you download Blot respectively JanusBlot (recommended)
there is a short description and documentation in english.
Have fun with Blot/JanusBlot !
Hans-Jürgen
|
|
|
Spring Toy |
Posted by: SierraKen - 06-03-2022, 01:24 AM - Forum: Programs
- Replies (6)
|
|
A few years ago we were making Slinky toys with QB64 and today I was just goofing around with graphics and math and came across this spring that stretches and comes back. Someone probably made this before but I want to show you guys what I did myself. It's non-stop until you end it, back and forth. You can press Esc to end.
Code: (Select All) _Title "Spring Toy"
Screen _NewImage(800, 600, 32)
xx = 200
yy = 200
length = 100
r = 1
c = _RGB32(0, 255, 0)
Do
If more = 0 Then xx = xx - .5: length = length + .5
If more = 0 Then yy = yy - .5: length = length + .5
If more = 1 Then xx = xx + .5: length = length - .5
If more = 1 Then yy = yy + .5: length = length - .5
If xx < 10 Then more = 1
If xx > 200 Then more = 0
For t = 0 To length Step .01
cx = (Sin(t) * xx) + xx + t
cy = (Cos(t) * yy) + yy + t
fillCircle cx, cy, r, c
Next t
_Delay .05
_Display
Cls
Loop Until InKey$ = Chr$(27)
'from Steve Gold standard
Sub fillCircle (CX As Integer, CY As Integer, R As Integer, C As _Unsigned Long)
Dim Radius As Integer, RadiusError As Integer
Dim X As Integer, Y As Integer
Radius = Abs(R): RadiusError = -Radius: X = Radius: Y = 0
If Radius = 0 Then PSet (CX, CY), C: Exit Sub
Line (CX - X, CY)-(CX + X, CY), C, BF
While X > Y
RadiusError = RadiusError + Y * 2 + 1
If RadiusError >= 0 Then
If X <> Y + 1 Then
Line (CX - Y, CY - X)-(CX + Y, CY - X), C, BF
Line (CX - Y, CY + X)-(CX + Y, CY + X), C, BF
End If
X = X - 1
RadiusError = RadiusError - X * 2
End If
Y = Y + 1
Line (CX - X, CY - Y)-(CX + X, CY - Y), C, BF
Line (CX - X, CY + Y)-(CX + X, CY + Y), C, BF
Wend
End Sub
|
|
|
Tesselated hex grid routine |
Posted by: OldMoses - 06-03-2022, 12:42 AM - Forum: Utilities
- Replies (4)
|
|
Back on the old forum I did a program for overlaying square and hex grids over maps & images. The square grid was easy peasy, the hex grid posed a somewhat greater challenge. In revisiting that program, I felt the need to make the hex grid more versatile and modular. Here's a demo of what I came up with.
Code: (Select All) 'Tesselated Hex Grid Demo- OldMoses
SCREEN _NEWIMAGE(1024, 512, 32)
test& = _NEWIMAGE(512, 256, 32)
_DEST test&
CLS , &HFFFF0000
_DEST 0
in% = -1
hsiz = 50
xoff = 0
yoff = 0
DO
DO
k$ = INKEY$
IF k$ <> "" THEN
SELECT CASE LCASE$(k$)
CASE IS = "t" ' "t" tilt grid 90 degrees
t = NOT t
CASE IS = "+" ' "+" increase grid size
hsiz = hsiz + 1
CASE IS = "-" ' "-" decrease grid size
hsiz = hsiz - 1: IF hsiz < 6 THEN hsiz = 6
CASE IS = "e" ' "e" bias grid up
yoff = yoff - 1
CASE IS = "x" ' "x" bias grid down
yoff = yoff + 1
CASE IS = "s" ' "s" bias grid to left
xoff = xoff - 1
CASE IS = "d" ' "d" bias grid to right
xoff = xoff + 1
CASE IS = "q" ' "q" return to system
SYSTEM
END SELECT
in% = -1
END IF
_LIMIT 30
LOOP UNTIL in%
in% = 0
CLS , &HFFB0B0B0
_DEST test&
CLS , &HFFFF0000
_DEST 0
Hex_Grid hsiz * 2, 0, xoff, yoff, t, &HFF000000 ' draw double sized grid on screen
Hex_Grid hsiz, test&, xoff, yoff, NOT t, &HFF000000 ' draw base sized, rotated grid on test insert image
_PUTIMAGE (256, 64), test&, 0
_DISPLAY
LOOP
'Tessellated hex grid drawing subroutine
'siz = distance in pixels between opposite sides
'img = destination image for grid
'h = horizontal offset
'v = vertical offset
'vert = {0} opposite vertices horizontal {-1} opposite vertices vertical
SUB Hex_Grid (siz AS INTEGER, img AS LONG, h AS INTEGER, v AS INTEGER, vert AS _BYTE, cl AS _UNSIGNED LONG)
old& = _DEST
grd& = _NEWIMAGE(_WIDTH(img), _HEIGHT(img), 32) ' temporary grid image
_DEST grd&
'Base geometric algorithm
side_len = siz / SQR(3) ' length of side
side_hlf = _SHR(side_len, 1) ' 1/2 length of side (for slope line offsets)
siz_hlf = _SHR(siz, 1) ' length from center to orthogonal side
a = side_len: b = 0 ' orthogonal line offsets
c = side_hlf: d = -siz_hlf ' left angled line offsets
e = side_hlf: f = siz_hlf ' right angled line offsets
IF vert THEN
offA = side_len + side_hlf + _SHR(side_hlf, 1) ' column spacing (x) when vertical opposite vertices
offB = siz - _SHR(side_hlf, 1) ' row spacing (y) when vertical
SWAP a, b: SWAP c, d: SWAP e, f ' rotate figure end points 90 degrees around (x, y)
ELSE
offA = _SHL(side_len + side_hlf, 1) ' column spacing (x) when horizontal
offB = _SHR(siz, 1) ' row spacing (y) when horizontal
END IF
row = -1
DO
column = -1
y = row * offB + v ' set origin point y
of = -(_SHR(offA, 1)) * (row MOD 2 = 0) ' bias alternating rows by half
DO
x = column * offA + h + of ' set origin point x
LINE (x, y)-(x - a, y - b), cl ' display orthogonal line
LINE (x, y)-(x + c, y + d), cl ' draw angled right/up
LINE (x, y)-(x + e, y + f), cl ' draw angled left/down
column = column + 1 ' move to next column position
LOOP UNTIL (column - 1) * offA > _WIDTH(grd&)
row = row + 1
LOOP UNTIL (row - 1) * offB > _HEIGHT(grd&)
'end base geometric algorithm
_PUTIMAGE , grd&, img ' overlay grid to img
_FREEIMAGE grd&
_DEST old&
END SUB 'Hex_Grid
|
|
|
My old Turtle Graphics Fractals |
Posted by: triggered - 06-02-2022, 03:37 PM - Forum: Programs
- Replies (9)
|
|
I decided to try and implement a graphics method I'm particularly fond of:
Code: (Select All) Screen 12
Dim a$
a$ = "FRRFRRF"
Dim j
For j = 1 To 4
a$ = stReplace$(a$, "F", "FLFRRFLF")
Next j
TurtleGraphics 320 / 2, 240 / 2, 0, 5, a$
End
Sub TurtleGraphics (x0 As Double, y0 As Double, a0 As Double, ssize As Double, path As String)
Dim As Double x, y, angle, stepsize
Dim w As String
Dim t As String
x = x0
y = y0
angle = a0
w = path
stepsize = ssize
PReset (x0, y0)
Do While Len(w)
t = Left$(w, 1)
w = Right$(w, Len(w) - 1)
Select Case t
Case "F"
x = x + stepsize * Cos(angle)
y = y + stepsize * Sin(angle)
Case "L"
angle = angle - 60 * _Pi / 180
Case "R"
angle = angle + 60 * _Pi / 180
End Select
Line -(x, y), 15
Loop
End Sub
Function stReplace$ (a As String, b As String, c As String)
Dim i As Integer
Dim g As String
Dim r As String
For i = 1 To Len(a)
g = Mid$(a, i, 1)
If g = b Then
r = r + c
Else
r = r + g
End If
Next
stReplace = r
End Function
|
|
|
Found a BUG with the QB64 editor compiled with the -O3 option |
Posted by: Coolman - 06-02-2022, 11:29 AM - Forum: General Discussion
- Replies (2)
|
|
i found a bug with the qb64 editor compiled with the -O3 option. here are the steps:
1/ launch QB64
2/ load any program (the bug occurs even without)
3/ Menu / Search / Find the editor is definitely blocked.
no problem with the original version.
if someone can test and confirm under linux or even windows !. qb64 must be compiled with the -O3 option.
|
|
|
|