Skip to main content
July 29, 2013
Answered

Mixing blitting and MovieClip animations

  • July 29, 2013
  • 1 reply
  • 660 views

I have a 2d isometric game in which a user can walk around a house.

The house is made up of multiple 1x1 wall tiles, floor tiles etc. For performance reasons I would like to use blitting to draw all the non-animated parts of the house (the floor, walls, furniture etc).

My game also has animations though. For example, the player movement animation or a ticking clock on the wall. These I have animated in Flash Pro and exported them as .swfs to use in my game.

I cannot simply draw the house using blitting (copyPixels()) and then add the animated movie clips to the display tree ontop of the bitmap. This is because some of the animations (e.g walking animation) will in some cases need to be drawn underneath certain parts of the house. I need to be able to 'insert' the movie clip half way through drawing the house. Is there any easy way to do this?

I can't really blit the animated movie clips either as some of them have very many frames (although a lot of the frames are just copies of eachother) and If I were to cache all the frames my memory use will be too high.

This topic has been closed for replies.
Correct answer kglad

different parts of the house can be blitted to different depths.

1 reply

kglad
Community Expert
kgladCommunity ExpertCorrect answer
Community Expert
July 29, 2013

different parts of the house can be blitted to different depths.

July 29, 2013

Do you mean something like this?

this.addChild(blittedBitmap1);

this.addChild(movieClip1);

this.addChild(blittedBitmap2);

this.addChild(movieClip2);

this.addChild(blittedBitmap3);

and so on

kglad
Community Expert
Community Expert
July 29, 2013

yes.