3
\$\begingroup\$

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?

\$\endgroup\$
2
  • \$\begingroup\$ 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. \$\endgroup\$ Jul 13, 2011 at 15:52
  • \$\begingroup\$ @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. \$\endgroup\$ Jul 13, 2011 at 20:24

1 Answer 1

1
\$\begingroup\$

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.

\$\endgroup\$
3
  • \$\begingroup\$ 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).:) \$\endgroup\$
    – drpelz
    Jul 14, 2011 at 1:53
  • \$\begingroup\$ @drpelz So your sprites are images from a spritesheet? Rotating them using TweenLite won't look pretty though, as the sprite will get pixelated. \$\endgroup\$
    – bummzack
    Jul 14, 2011 at 13:01
  • \$\begingroup\$ 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:)). \$\endgroup\$
    – drpelz
    Jul 14, 2011 at 16:13

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .