Updating multiple Sprites - AS3 performance best practices

Posted by dani on Stack Overflow See other posts from Stack Overflow or by dani
Published on 2010-05-02T11:26:49Z Indexed on 2010/05/02 11:37 UTC
Read the original article Hit count: 640

Within the container "BubbleContainer" I have multiple "Bubble sprites". Each bubble's graphics object (a circle) is updated on a timer event.

Let's say I have 50 Bubble sprites and each circle's radius should be updated with a mathematical formula. How do I organize this logic?

  1. How do I update all Bubble sprites within the BubbleContainer? (should I call a bubble.update() function or make a temporary reference to the graphics object?)

  2. Where do I put the Math logic? (as static functions?)

© Stack Overflow or respective owner

Related posts about actionscript-3

Related posts about Performance