Hello,
Trying do make a delta variable to store the time since the precedent frame I made this sketch. It seems to work fine but after about 1 minute my little sprite is stucked ???
… And now, it runs fullscreen ??? with "size(400,400) !?
(On Linux Mint 18 - I tried with Processing for windows with Wine : sprite stucked too !)
int delta, preMilli=0, milli;
int x=10, direction=1;
void setup() {
size(400, 400);
fill(0);
//frameRate(200);
}
void draw() {
milli=millis();
delta=milli-preMilli;
preMilli=milli;
background(255);
text("delta = "+delta, 100, 100);
text("milli = "+milli, 100, 120);
text("x = "+x, 100, 140);
text("framerate = "+frameRate, 100, 160);
ellipse(x, 250, 20, 20);
x+=0.2*delta*direction;
if (x>width-10 || x<10) {
direction*=-1;
}
}