Help creating simple animation

Thanks for letting me know, it’s very helpful.

Although you could change frameCount at will, it‘s still advised to refrain from doing so. You never know what those internal values might be used for behind the scenes :sweat_smile:

Using global variables may be better, as then you can make a Timer class, and I don’t believe each class has an individual frameCount(multiple timers running at the same time, but not all starting at the same time)

class Timer {
    float w;
    float TimerSize;
    float TimerMaxValue;
    color TimerColor;
    float Timerx,Timery;
    Timer(tempTimerSize,tempTimerColor,tempTimerx,tempTimery,tempTimerMaxValue) {
    TimerSize=tempTimerSize;
    TimerColor=tempTimerColor;
    TimerMaxValue=tempTimerMaxValue;
    Timerx=tempTimerx;
    Timery=tempTimery;
    w=0;}
    
    void display() {
    fill(TimerColor);
    textSize(TimerSize);
    text(w,Timerx,Timery);}
    
    void update() {
    w+=0.0152;
    if(tempTimerMaxValue!=null) {
        if(w>=TimerMaxValue) {    //greater than or equal to because may be 0.01 over/below max value
        w=0;}
        }
    }
}
1 Like