Posts: 87
Threads: 8
Joined: May 2022
Reputation:
3
06-04-2022, 04:35 PM
(This post was last modified: 09-24-2024, 01:45 AM by DANILIN.)
? 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
Write name of program in 1st line to copy & paste & save filename.bas
Insert program pictures: press print-screen-shot button
Open paint & Paste & Save as PNG
Add picture file to program topic
Russia looks world from future. Big data is peace data.
I never recommend anything & always write only about myself
Posts: 28
Threads: 1
Joined: May 2022
What in the world is this?
Posts: 87
Threads: 8
Joined: May 2022
Reputation:
3
06-04-2022, 05:33 PM
(This post was last modified: 06-04-2022, 07:09 PM by DANILIN.)
I have long dreamed of creating a sketch
about a flying balloon from scratch
and created it in an hour
I suppose locals could have composed
much shorter than my program in past
Program create a random area
and in a random place ball starts and flies
There was an idea to apply "screen(y-1, x+1) =35"
however a non-optimal program would become longer
My program is universal:
creating an array of coordinates
there will be a lot of flying balls
Write name of program in 1st line to copy & paste & save filename.bas
Insert program pictures: press print-screen-shot button
Open paint & Paste & Save as PNG
Add picture file to program topic
Russia looks world from future. Big data is peace data.
I never recommend anything & always write only about myself
Posts: 731
Threads: 103
Joined: Apr 2022
Reputation:
14
Wasn't Xonix the company who made those "double ender" cartridges for the Atari 2600 back in the '80s?
Posts: 87
Threads: 8
Joined: May 2022
Reputation:
3
06-04-2022, 06:07 PM
(This post was last modified: 06-07-2022, 04:21 AM by DANILIN.)
I'm a fan of ZX spectrum 48k
https://rosettacode.org/wiki/Category:ZX_Spectrum_Basic
rosettacode.org/wiki/Category:ZX_Spectrum_Basic
behind post is better:
_Font 17 ' biger
...
Color 0, RND*15
...
Color RND*15, 0
Write name of program in 1st line to copy & paste & save filename.bas
Insert program pictures: press print-screen-shot button
Open paint & Paste & Save as PNG
Add picture file to program topic
Russia looks world from future. Big data is peace data.
I never recommend anything & always write only about myself
Posts: 87
Threads: 8
Joined: May 2022
Reputation:
3
06-07-2022, 07:55 PM
(This post was last modified: 09-24-2024, 02:12 AM by DANILIN.)
Xonix Multi Balls
Animation 66 kB
Code: (Select All)
Randomize Timer: b = Int(Rnd * 10 + 15): a = Int(Rnd * 10 + 15): ' xonix135.bas
N = Int(Rnd * 5 + 3): Dim dx(N), dy(N), y(N), x(N), q$(N), c(N): _Font 17
For e = 1 To N: q$(e) = Mid$(Str$(e), 2, 1): Next ' XONIX fly color collision
For i = 1 To N
If Rnd < .5 Then dx(i) = -1 Else dx(i) = 1
If Rnd < .5 Then dy(i) = -1 Else dy(i) = 1
y(i) = Int(Rnd * (b - 3) + 3): x(i) = Int(Rnd * (a - 3) + 3)
d(i) = Int(Rnd * 4) + 1: c(i) = Int(Rnd * 5 + 1)
Next
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 1000: _Delay .08
For i = 1 To N: Locate y(i), x(i): Print " "
If y(i) + dy(i) < 2 Or y(i) + dy(i) > b - 1 Then dy(i) = -dy(i)
y(i) = y(i) + dy(i)
If x(i) + dx(i) < 2 Or x(i) + dx(i) > a - 1 Then dx(i) = -dx(i)
x(i) = x(i) + dx(i)
For k = 1 To N - 1: For m = k + 1 To N
If y(k) = y(m) And x(k) = x(m) Then c(k) = Int(Rnd*5+1): c(m) = Int(Rnd*5+1)
Next: Next
Locate y(i), x(i): Color c(i): Print q$(i)
Next: Next
If balls are collision: both balls change colors
Write name of program in 1st line to copy & paste & save filename.bas
Insert program pictures: press print-screen-shot button
Open paint & Paste & Save as PNG
Add picture file to program topic
Russia looks world from future. Big data is peace data.
I never recommend anything & always write only about myself
Posts: 87
Threads: 8
Joined: May 2022
Reputation:
3
09-13-2024, 07:08 PM
(This post was last modified: 09-16-2024, 01:32 AM by DANILIN.)
This XONIX theme is developing silently
and there is a smooth implementation of C#
133 KB
but principles of XONIX decide ... maze
DAV: MazeBall - A tilt-like maze puzzle game
https://qb64phoenix.com/forum/showthread...0#pid28390
Write name of program in 1st line to copy & paste & save filename.bas
Insert program pictures: press print-screen-shot button
Open paint & Paste & Save as PNG
Add picture file to program topic
Russia looks world from future. Big data is peace data.
I never recommend anything & always write only about myself