Step 2: Blit the Characters

This event differs from the blitting event in the last tutorial. If you remember correctly, last time we used an alterable value named CurrentPosition to keep track of which character we were currently blitting. This time, since each character is created on a different loop, we can simply refer to the Loop Index. Note that the first loop has a loop index of 0.

Another difference is that we are retrieving the current character in the same expression that searches CharSheet. Instead of retrieving it, storing it in an alterable string, and then retrieving it again when we search CharSheet as we did in the previous tutorial. This way is quicker, only a little hard to follow.

Please, create the following event: By default, Blit Line is equal to 1. This value is copied to the Line ID value of each Character object as we create it. Later, at each line break, we will add 1 to Blit Line. This way each Character object will have a record of which line it was created on.

The force animation frame expression is very similiar to the expression we used in the previous tutorial, but just to make sure you're still following, we'll run through it.

To isolate the current character, we use the Mid$ function, which requires the following 3 parameters.

Parameter Description In our case...
String The string from which characters are returned. Text("Blitter")
Start Specifies the starting position. Loopindex("Blit")
Length Specifies the number of characters to return. 1

So, Mid$(string, start, length) becomes Mid$(Text( "Blitter" ), Loopindex( "Blit" ), 1)

Then we use the Find function to retrieve the numeric position of the CurrentCharacter within the CharSheet. It also requires 3 parameters:

Parameter Description In our case...
String The larger string you are searching. CharSheet("Blitter")
Query The smaller string you are searching for. Mid$(Text( "Blitter" ), Loopindex( "Blit" ), 1)
Start Specifies the starting position. 0

Find(string, query, start) becomes Find(CharSheet( "Blitter" ), Mid$(Text( "Blitter" ), LoopIndex("Blit"), 1), 0)

We will also store this same value in the ID alterable value of each Character object. Once again, remember the order of actions is important. The action which moves the Blitter object must be after the action which forces the animation, otherwise the Blitter will not be moved to the correct spot.
5