We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Okay, I have posted previous questions that are similar, but I am still having trouble with my program. I am trying to print out a char, have it put to a random position, then slowly move back to the origin. In the code below, I have a char 'M', and I want it drawn to a random spot. But what I want is it to draw to the random spot then head back to the origin (200,200). I just cant seem to understand how I can do this! Its really driving me crazy. All the examples I have been shown are very helpful but are just to complex. I am looking for just a very bare-bones example. Would this be hard to accomplish due to the way I am printing it out? Please help!
char m = 'M';
float xPos, yPos;
PFont f;
float r1 = random(400);
float r2 = random(400);
void setup(){
background(255);
size(400,400);
xPos = 200;
yPos = 200;
f = createFont("Arial", 30, false);
}
void draw(){
background(0);
fill(255);
textFont(f);
text(m, r1, r2);
}
Answers
I figured it out, very easy actually. I apologize for asking this question so much. For any of you who stumbled upon this, use this.