I’m not too good in explaining things extensively, so please pay attention to every word I say.
OK here’s the deal:
I’m making a shootout game. In the game there’re many monsters that respawn upon dying. There’s also the gun which follows the mouse’s x value, and a wall which is animated when the player “hides”. The problem is to integrate all those 3 components together:
When I duplicate the monsters, their depth is getting bigger everytime, and therefore they appear as if on top of the gun and the wall, but that’s not what I want. I want the gun and wall always be “the closest” to the player, so they will be above the monsters. I tried using SwapDepth to change the gun and wall depths to be 1 or 2 above the current monster depth every time, but for some reason Flash just DUPLICATES the gun and wall, and everything looks ****ed up.
well it looked fine to me… but in cases like that where you want to make sure that certain things are always below other things, then what you need (or rather could) do is to attach the objects which are supposed to be lower, within a single movieclip and have that movieclip below everything they need to be below. You can just make it an empty movieclip and put it (or create it) at point 0,0 so cooridinates within match the main movie.
wicked_outside_world.attachMovie(“bug”, “bug” + i, i++);
…etc.
and the bugs will always be below the wall and gun no matter how many are attached and no matter what depth because they are all kept within the wicked_outside_world clip