What's More Efficient? newImageRect or setFillColor?

Hey everyone,

Here’s my question:

I’ve gotten a basic “enemy” on the screen. The enemy is a group that contains a few things:

  1. The actual enemy image
  2. A “tint” image that basically just tints the enemy for 50ms when it gets hit.
  3. A label above it’s head to show the remaining health.

So I’ve currently got 2 display.newRect’s being used to store items 1 & 2 mentioned above.

Would it be more efficient to remove item #2 completely, and then just apply a tint to item #1? I’ve heard that setFillColor is pretty costly in terms of CPU usage, but I don’t know if it’s still worth using it vs making a whole new image every time.

PS. I’ve got around 30 enemies on screen at any time, and there are TONS of enemy hits happening at any given time. It’s not like I’ve only got a couple enemies that are not being hit very often.

Thanks! [import]uid: 51654 topic_id: 16787 reply_id: 316787[/import]

I’m going to go out on a limb and say newImageRect is more efficient because its easier to show/hide pixels than it is to have to do complex math on every pixel across 3 channels, twice. [import]uid: 19626 topic_id: 16787 reply_id: 62854[/import]