A more robust and flexible way to implement timers is to use MAINCNT. At the beginning of the period you want to measure, set a variable (say, TIME0) to the value of MAINCNT. At any point later in the program, the expression MAINCNT-TIME0 will give the number of 'ticks' (units of 1/60th of a second) between then and 'now', the time at which the expression is evaluated.
Replying to:SquareFingersA more robust and flexible way to implement timers is to use MAINCNT. At the beginning of the period you want to measure, set a variable (say, TIME0) to the value of MAINCNT. At any point later in the program, the expression MAINCNT-TIME0 will give the number of 'ticks' (units of 1/60th of a second) between then and 'now', the time at which the expression is evaluated.
I see. Thanks for the help. I would have never thought of that.
Replying to:SquareFingersA more robust and flexible way to implement timers is to use MAINCNT. At the beginning of the period you want to measure, set a variable (say, TIME0) to the value of MAINCNT. At any point later in the program, the expression MAINCNT-TIME0 will give the number of 'ticks' (units of 1/60th of a second) between then and 'now', the time at which the expression is evaluated.
Another outside the box way is to use SPANIM on a sprites variable #7. You can check it with SPCHK.
This has limitations in how high the counter can go; but runs at a constant 60 fps no matter what.