Trying to have text glide up the x axis

My student is trying to get text to move up the y axis in a glide (we have gotten it to repeat up the y axis, but that is not what we want).

var textStart = 300;
if (textStart <= 400); {
text(“tu planeta”, 200, textStart-30); // Draws the text one time

}

Greetings @davisl,


A solution to this problem would be to create a variable (which you’ve already done), but then you need to use some sort of add/subtracting operator (depending if you want it to go down or up).
Then you would put the variable inside the “y” parameter of the text.

Make sure to put it in a draw function too.
Example:

var textStart = 300
function draw () {
  textStart -= 1 //you change this number if you want to make it go faster or slower
  text("tu planeta", 200, textStart);
}

I hope this has helped!

~ Pluto