For a lot of my games and simulations, I want a loop to be initiated on a regular basis, like every 0.1 seconds. It would be nice to have a block that did
repeat every 0.03 seconds
....
I suppose one could get a similar effect with a variable and the timer:
set next_time to timer
forever
....
change next_time by 0.03
wait until timer > next_time
Of course, a properly implemented built-in version of this could report an error (turn red) if the computer was not fast enough to keep up with the requested loop rate. It would also be good not to have to create a variable for each such loop, and to be able to reset the timer, which this workaround doesn't permit.
I'm not sure, but I believe that flash has an implicit
repeat every 0.1 seconds
Offline
kevin_karplus wrote:
It would be nice to have a block that did
repeat every 0.03 seconds
Couldn't you do (supposing its a forever loop)
<repeat until>
<wait(0.3)secs>
<broadcast[ blah
I only said broadcat because its an example but you get the point.
Offline
kevin_karplus wrote:
I'm not sure, but I believe that flash has an implicit
repeat every 0.1 seconds
Flash can execute code at intervals. It would be nice to have some sort of interval block in scratch.
Offline