Credits/scrolling text from a *.dat file by Northern Lights21st Oct 2004 19:06
|
---|
Summary This program takes any number of variables and scrolls them for you. Description This program takes any number of variables and scrolls them for you. All you need to do is put at the top of a *.dat file the number of lines in the file and then a blank line(the number of lines includes the line itself and the blank line). Then put your variables in one line at a time. You may include blank lines but they will show up in the program. Name the file credits.dat and you're off! Code ` This code was downloaded from The Game Creators ` It is reproduced here with full permission ` http://www.thegamecreators.com sync on:hide mouse `reads the number of lines and puts it into a string, which then converts*** `to an integer so we can use it in our FOR...NEXT loops.******************** open to read 1,"credits.dat" read string 1,a$: a#=val(a$)+1 `**********************************************************************8 `makes the main string array******************************************* dim string$(a#) `********************************************************************** `reads everything into the string array******************************** for x=1 to a# read string 1,string$(x) next x `********************************************************************** ink rgb(255,255,255),RGB(rnd(200),rnd(200),rnd(200)) `main height variable y=600 do `makes the y variable decrease and clears the screen******************* dec y,2:cls `********************************************************************** `this does the main printing job, it makes the first thing to be printed*** `larger than normal(so you can put in a title like CREDITS or something).** for x=1 to a# if x=2 set text size 42 text 200,y,string$(x) else set cursor 250,y+x*15 print string$(x) endif next x `************************************************************************** `this makes the text go around indefinitely, delete it if you don`t want**** `a continuous loop. If you don't delete it, you will most likely have****** `to modify it depending on how many credits you have.*********************** if y=-1*(a#*20) y=600 ink rgb(255,255,255),RGB(rnd(200),rnd(200),rnd(200)) endif `*************************************************************************** sync loop |