Game Performance Question
What is the best approach for handling the ENTER_FRAME / TIMER and rerendering elements?
At the moment I have got this View structure on the stage:
WorldView
- RobotView
- RobotView
- RobotView
- RobotView
I am not sure if this is good idea -> I keep RobotView refrence in RobotModel.
The WorldModel handles the TIMER:
private function onTimer( e:TimerEvent ):void
{
for ( i = 0; i < _robotModelVector.length; i++ ) _robotModelVector[ i ].handleNextFrame();
}
sort();
_frameCount++;
}
Is this way any good?
Comments are currently closed for this discussion. You can start a new one.
2 Posted by Michal Wroblewski on 12 Jul, 2011 08:39 PM
Generally it's good idea to have a signal mapped as signalton that dispatches on contextView's ENTER_FRAME. Signals are much faster than events and you can inject them into every mediator you want and add e.g. public view's handlers to them. That's the most performant idea I have now. The same about TIMER, ofc if you have more than one handlers for that events.
Michał
3 Posted by patryk on 13 Jul, 2011 10:11 PM
Hi, Michal
That sounds interesting, I will give it a go, thanks a lot :)
Patryk
Ondina D.F. closed this discussion on 01 Nov, 2011 02:31 PM.