Game Performance Question

patryk's Avatar

patryk

12 Jul, 2011 01:57 PM

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?

  1. 1 Posted by Michal Wroblews... on 12 Jul, 2011 08:39 PM

    Michal Wroblewski's Avatar

    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ł

  2. 2 Posted by patryk on 13 Jul, 2011 10:11 PM

    patryk's Avatar

    Hi, Michal

    That sounds interesting, I will give it a go, thanks a lot :)

    Patryk

  3. Ondina D.F. closed this discussion on 01 Nov, 2011 02:31 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac