Credits Example

Here's a program which you can use to add credits to your game. In order to use it, you should understand GRPs, DATA, GOSUBs, and the general process of handling data. The first link provides commented code which helps you alter the credits to suit your own needs. The second link provides the code without comments in case they get in the way. In order to use the credits, you need to do the following:
 * Alter the DATA section so that it's your credits instead of the default
 * Count the number of credits lines and then change the "CREDITLINES" variable near the top from 15 to the number of lines
 * Surround the large "FOR" loop which actually performs the credits with a label and a return so that you can GOSUB into the credits
 * Remove ACLS:CLEAR and PNLTYPE "OFF" if you don't need it.
 * Remove the ACLS:END that appears above PRINTLINE
 * Append this program (after saving it) to the program you wish to have credits.
 * Move the "CREDITLINES=XXX", DIM CREDITS ETC, and the RESTORE chunk up to the beginning of your program (or somewhere near the beginning which will only run once)
 * Whenever you want the credits to show up, just use GOSUB and the label you created to jump into it. Make sure you set up everything you need, like clearing the screen or setting fonts or whatever. Also, after the GOSUB, make sure you clean everything up.

There's a way that doesn't require you to count the number of lines in the credits, but I thought it would be a little complicated to include in a "tutorial" program that's meant to show you the basics of making smooth-scrolling credits. It wasn't intended to delve into the intricacies of reading and counting DATA.

https://db.tt/djeWFKhz

https://db.tt/Oov0uMyS