Scrolling text display

BlitzPlus Forums/BlitzPlus Tutorials/Scrolling text display

Cactus1124(Posted 2014) [#1]
I made a scrolling text display that you you can use in text adventures. I decided to upload this since some people might be interested. Also, I've never tried using forum code, so you might see the word "code" around my existing code. If not, then mission accomplished!

Just replace the letters/text with whatever you want.

;Scrolling text display
.Start
Write "K"
Delay 20
Write "n"
Delay 20
Write "i"
Delay 20
Write "f"
Delay 20
Write "e"
Delay 20
Write " "
Write "P"
Delay 20
Write "a"
Delay 20
Write "r"
Delay 20
Write "t"
Delay 20
Write "y"
Print ""
choice$ = Input("Type any key on the keyboard to replay the scrolling text :")
If choice$ = ("") Then
Goto Start

Else
Goto Start

EndIf

Repeat Forever


Cactus1124(Posted 2014) [#2]
I messed up D: Oh well, try to put all the code together, and it will work.


Midimaster(Posted 2014) [#3]
Hi Cactus, that's not the best way. You alway should try to encapsule functionality into a universal function, which can be used for any text:

Repeat
	TextScroll ("Knife Party",1)
	TextScroll ("Type any key on the keyboard to replay the scrolling text",0)
	choice$ = Input()
Until Choice<>""

Function TextScroll(T$,WithPrint%)
	For i%=1  To Len(t$)
		Write Mid(T,i,1)
		Delay 50
	Next 
	If WithPrint=1	Print "" 
End Function