News:

Welcome to RetroCoders Community

Main Menu

"Howdy Doodie!" SCROLL demo

Started by CharlieJV, Jul 08, 2023, 12:27 AM

Previous topic - Next topic

CharlieJV

Run the program

Code:

SCREEN _NEWIMAGE(800, 160, 0)

MSG$ = "Howdy Doodie !" 
PRINT MSG$
FOR J = 0 TO LEN(MSG$)
LOCATE 2 + J, 1
FOR K = 0 TO 8*LEN(MSG$)
IF POINT(K,J) = 0 THEN PRINT " "; ELSE PRINT "*";
NEXT K
PRINT
NEXT J
locate 1,1 : PRINT SPACE$(70)

this_way = -1

DoScrollIteration:

thiskey$ = inkey$
if thiskey$ <> "" then this_way = - this_way : _KEYCLEAR 
scroll this_way, 0, TRUE
_delay 0.01
GOTO DoScrollIteration

johnno56

May your journey be free of incident.  Live long and prosper.

ZXDunny

That's a fun little thing innit? :)

I've converted to SpecBAS, as you do, with some very minor changes:



I should note that your _KEYCLEAR was great idea, so I added WAIT KEYUP to SpecBAS; it basically just idles until no keys are pressed. Actually that gives me an idea - pass a keycode to check for a specific key? Might be useful.

WAIT KEYUP key_A

could be good.

WINDOW ROLL id,dx,dy is my syntax; you can roll or scroll any window that's open. Your SPACE$(70) is " "*70 in SpecBAS, and of course I use PRINT AT instead of LOCATE.

This was a fun few minutes, thanks!

CharlieJV

Quote from: ZXDunny on Jul 08, 2023, 10:19 AMThat's a fun little thing innit? :)

I've converted to SpecBAS, as you do, with some very minor changes:



I should note that your _KEYCLEAR was great idea, so I added WAIT KEYUP to SpecBAS; it basically just idles until no keys are pressed. Actually that gives me an idea - pass a keycode to check for a specific key? Might be useful.

WAIT KEYUP key_A

could be good.

WINDOW ROLL id,dx,dy is my syntax; you can roll or scroll any window that's open. Your SPACE$(70) is " "*70 in SpecBAS, and of course I use PRINT AT instead of LOCATE.

This was a fun few minutes, thanks!

Ooooo, that's good stuff.

It's a lot of fun to create BASIC algorithms to do this stuff, but when I'm on a mission to get something done and don't want to be futzing about with a whole bunch of code, I really like having at hand built-in subroutines/functions that do the job in one statement.

BTW, thanks for the "roll" idea from that other thread.  I wound up rolling that into the SCROLL statement as an optional wrap% parameter:  present and not FALSE, then wrap around the area.  FALSE or not present, then do not wrap.

Just to make the bang worth the buck, the SCROLL syntax diagram:

arg, can't attach to a quick reply.  Diagram in a second...

You cannot view this attachment.

ZXDunny

Man I like the area idea. I may have to steal that if I can work it into my syntax :D

CharlieJV

Quote from: ZXDunny on Jul 08, 2023, 04:07 PMMan I like the area idea. I may have to steal that if I can work it into my syntax :D


Credit where credit is due, BAM's SCROLL is just a slight mod (new wrap parameter, and area optional) of what I found in The BASIC handbook : encyclopedia of the BASIC computer language, page 608