Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I would like to know how can I go about with an approach, that lets the enemies blink after they are hit with a shot/particle?

Is it better to pre-render colored enemies into an array for a better performance or is it just okay coloring them during gameplay?

For example, you can use the colorMatrixFilter- or colorTransform- methods for accomplishing this. Pre-rendering it (mentioned before) and storing the colored enemies inside of an array is an option also.

I ask because I'm not sure how those mentioned methods influence gameplay, especially for action games.

Which method is usually faster / the accepted norm? Are there any approaches I should avoid that will impact the gameplay?

share|improve this question

migrated from Jul 13 '11 at 15:38

This question came from our site for professional and enthusiast programmers.

I think he meant doing the pre-rendering on game load - so there would be one asset that's rendered to two versions. I think this is tactic fairly common in actionscript because displaying pre-rendered vector graphics is faster than drawing vector graphics each frame. – CiscoIPPhone Jul 13 '11 at 15:52
@CiscoIPPhone My bad, I don't know enough about specific AS3 dev, which is why I posted as a comment. Sorry @drpelz if that was confusing. – Jonathan Connell Jul 13 '11 at 20:24
up vote 1 down vote accepted

If you are doing blitting with copyPixels() then you should definitely pre-render it inside flash when the program launches or the level is loading

Instead of changing the enemies color when hit, you should probably make a hit animation for the enemies and just play that animation when hit.

share|improve this answer
Thanks for your answer. But I'm gonna use TweenLite because it's fast and calculate it during gameplay. I can't pre-render it because animations consist about 400 small images stored in a tilesheet and each of it needs to be rotated about 360 degrees if I pre-render the stuff. That would result in a super-array consisting of about 400 * 360 pre-rendered images (144000). That's way tooooooooo much! So I'll stick with TweenLite which is fast and easy to use (I hope so).:) – drpelz Jul 14 '11 at 1:53
@drpelz So your sprites are images from a spritesheet? Rotating them using TweenLite won't look pretty though, as the sprite will get pixelated. – bummzack Jul 14 '11 at 13:01
No, no. They are already rotated by the framework I use. What I need is a fast coloring method. I need this when I shoot and hit an enemy the enemy shall flash for a short period of time. Currently I can't do that inside of the framework I use so TweenLite is a real alternative (well I hope so:)). – drpelz Jul 14 '11 at 16:13

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.