Hello Forum,
I am in the processing of shifting from Processing to p5Js for my high school class that is now online starting Monday. We love to use print() to learn but I noticed that it causes severe lag for animations (see example with it on and off).
Is there a simple way to prevent this?
Also, are there other functions or strategies that I should be aware of to prevent lagging?
Thank you for your help.
let x = 75;
let speed = 3;
function setup() {
createCanvas(300,300);
}
function draw() {
background(255);
print ("x=",x);
print ("speed=",speed);
if ( (x<0) || (x>300)){
speed = speed * -1;
}
x = x + speed;
fill(0,0,255);
ellipse (x,150,50,50);
}//close draw