Unit 3: animation

Create a variable for the x position of the text such as:

var textStart = -200 (off the screen)

Then, when you place the text, place it inside the draw loop using the variable you created as the x position and then increment the variable… the code below would cause it to scroll left to right across the screen.

textSize(20);
text(“Once there was a fisherman …”, textStart, 375);
textStart=textStart+3;

6 Likes