How taxing is time based calculation versus frame by frame? Should I do 32ms, 40ms? Would 10ms slow things down at 100 non-filtered vector instances with movements?
Also, wouldn’t it be more efficient to have one global timer that all classes can listen to, instead of a timer on each player like here? Like, have a “gameworld” class that controls everything.
package {
import flash.display.MovieClip;
import flash.events.TimerEvent;
import flash.utils.Timer;
public class player extends MovieClip {
public function player() {
var timer:Timer = new Timer(32);
timer.addEventListener(TimerEvent.TIMER, onTimer);
timer.start();
}
private function onTimer(event:TimerEvent):void {
//Gameplay calculations here
}
}
}