Hi SierraKen
please read this second my feedback only if you want go further to the development of your creature otherwise go on another topic.
And thanks to let me read and try your code.
I can pass you some tips that at its time I got from Qb64 masters...
1. smoother keyboard input with new QB64 function than Inkey$
see a mod of your program
'Thank you to B+ and other guys from the QB64.org forum for their code examples to make this program!
'2019-08-12 TDB mod introducing _keyhit and _Keyclear to a smoother response to keyboard
_TITLE "Warp Speed - Use Up and Down Arrow Key for speed and Right and Left Arrows to view sides and Space Bar to center." DIM x
(800), y
(800), dx
(800), dy
(800), sz
(800), c
(800)
'Set the default speed, amount of stars, and then make the first stars.
speed = .001
amount = 200
xx = 0
_LIMIT 30 ' <---- it seems enough in respect of 1000 ' a$ = INKEY$
u = 0 ' a tricky way to reset the variable of input
IF u
= 19200 THEN xx
= xx
- 50 IF u
= 19712 THEN xx
= xx
+ 50 ' IF a$ = CHR$(27) THEN END
' IF a$ = CHR$(0) + CHR$(77) THEN xx = xx + 50
' IF a$ = CHR$(0) + CHR$(75) THEN xx = xx - 50
' IF a$ = " " THEN xx = 0
'Detect the arrow keys to make it go faster or slower.
IF u
= 18432 THEN speed
= speed
+ .001: warp
= warp
+ 1 IF u
= 20480 THEN speed
= speed
- .001: warp
= warp
- 1 REM _KEYCLEAR '<---- you can get the same effect REMming u = 0 and activating this statement here
'IF a$ = CHR$(0) + CHR$(72) THEN speed = speed + .001: warp = warp + 1
'IF a$ = CHR$(0) + CHR$(80) THEN speed = speed - .001: warp = warp - 1
IF speed
< .001 THEN speed
= .001 IF speed
> .01 THEN speed
= .01
'Move the stars.
x(stars) = x(stars) + dx(stars) * speed
y(stars) = y(stars) + dy(stars) * speed
'Get a new star if one goes off the screen.
IF x
(stars
) < -6400 OR x
(stars
) > 6400 OR y
(stars
) < -400 OR y
(stars
) > 400 THEN GOSUB make:
'Draw the stars, c(stars) is the choice of color.
IF sz
(stars
) > 2 THEN sz
(stars
) = 2
'If the size of the star is less than 1, skip paint.
'Paint the stars.
nopaint:
'This stops flickering.
'Erase the stars for motion but keep a transparent black for the trails.
make:
'Get a random X number using 2 decimal points - RND and .5 and times it by the width of the screen.
'Get a random Y number using 2 decimal points - RND and .5 and times it by the height of the screen.
'Get a random star size between .25 and 2.
sz
(stars
) = (RND * 2) + .25
'Get a random number between 1 and 100 to pick 1 of 3 different star colors in the main loop.
'Get any random number between 5 and 10, used for both X and Y, to use in the star movement in the main loop.
dx(stars) = x(stars) * v
dy(stars) = y(stars) * v
2. less flickering or blinking of screen (also with Inkey$ if you move fast to right or to left you got the stars jumping on the screen)
2.1 an alternative (long?) way to manage output to screen with 2 panel for images
2.2 an adjust of _limit value
2.3 an adjust of how to move in the select direction the stars (50 is high, 20 seems better)
'Thank you to B+ and other guys from the QB64.org forum for their code examples to make this program!
'2019-08-12 TDB mod introducing _keyhit and _Keyclear to a smoother response to keyboard
'2019-08-12 TDB mod introducing the 2 panel tecnique for animation to avoid flickering and loose of images
_TITLE "Warp Speed - Use Up and Down Arrow Key for speed and Right and Left Arrows to view sides and Space Bar to center." DIM x
(800), y
(800), dx
(800), dy
(800), sz
(800), c
(800)
' another way to avoid flickering is to use 2 panel 1st for screen output and 2nd for drawing
' so you draw on 2nd and copy to 1st to show
'Set the default speed, amount of stars, and then make the first stars.
speed = .001
amount = 200
xx = 0
_LIMIT 30 ' <---- it seems enough in respect of 1000 ' a$ = INKEY$
u = 0 ' a tricky way to reset the variable of input
IF u
= 19200 THEN xx
= xx
- 20 ' left key IF u
= 19712 THEN xx
= xx
+ 20 ' right key ' IF a$ = CHR$(27) THEN END
' IF a$ = CHR$(0) + CHR$(77) THEN xx = xx + 50
' IF a$ = CHR$(0) + CHR$(75) THEN xx = xx - 50
' IF a$ = " " THEN xx = 0
'Detect the arrow keys to make it go faster or slower.
IF u
= 18432 THEN speed
= speed
+ .001: warp
= warp
+ 1 ' up key IF u
= 20480 THEN speed
= speed
- .001: warp
= warp
- 1 ' down key REM _KEYCLEAR '<---- you can get the same effect REMming u = 0 and activating this statement here
'IF a$ = CHR$(0) + CHR$(72) THEN speed = speed + .001: warp = warp + 1
'IF a$ = CHR$(0) + CHR$(80) THEN speed = speed - .001: warp = warp - 1
'Why do you write on the screen 200 times the same text?
' I move the PRINT instruction in the area of output to screen one time out of for..next
IF speed
< .001 THEN speed
= .001 IF speed
> .01 THEN speed
= .01
'Move the stars.
x(stars) = x(stars) + dx(stars) * speed
y(stars) = y(stars) + dy(stars) * speed
'Get a new star if one goes off the screen.
IF x
(stars
) < -6400 OR x
(stars
) > 6400 OR y
(stars
) < -400 OR y
(stars
) > 400 THEN GOSUB make:
'Draw the stars, c(stars) is the choice of color.
IF sz
(stars
) > 2 THEN sz
(stars
) = 2
'If the size of the star is less than 1, skip paint.
'Paint the stars.
nopaint:
' here print one time info in text format on the screen
'This stops flickering.
' _DISPLAY <--- the quick method
'Erase the stars for motion but keep a transparent black for the trails.
' LINE (0, 0)-(_WIDTH, _HEIGHT), _RGBA32(0, 0, 0, 30), BF
make:
'Get a random X number using 2 decimal points - RND and .5 and times it by the width of the screen.
'Get a random Y number using 2 decimal points - RND and .5 and times it by the height of the screen.
'Get a random star size between .25 and 2.
sz
(stars
) = (RND * 2) + .25
'Get a random number between 1 and 100 to pick 1 of 3 different star colors in the main loop.
'Get any random number between 5 and 10, used for both X and Y, to use in the star movement in the main loop.
dx(stars) = x(stars) * v
dy(stars) = y(stars) * v
and two glitches...
1 moving to the leftest position or the rightest position you get stars moving in the opposite extreme direction
2 moving fastly to left or to right from initial position you get some various movements of stars
Thanks to read