[FMX] Common question: AttachMovie

I tried looking for it in the forums because I was sure other people already asked about this, and they did, but none of them got an answer suitable for my situation…

I got a shootout game, when I kill a monster I want it to duplicate until a certain variable reaches a certain number but I keep having problems with it.

Any suggestions?

*Originally posted by FLATLINE *
**I got a shootout game, when I kill a monster I want it to duplicate until a certain variable reaches a certain number but I keep having problems with it.

Any suggestions? **

duplicate it that number of times? is this duplicate as in duplicateMovieClip or as in attachMovie? … shoudnt it go away after you shoot it?

OK look, I got a monster on stage, it has all the animations and ****, it can shoot, it can die and it can move. What I want is that after I kill it (after it plays the death animation), the monster will be duplicated, ie another one will show up. Prefferably the first monster shouldn’t dissapear but I don’t know if that’s even possible.

I don’t know if I should use duplicateMovie or attachMovie because I don’t really know how to use any of them right…

if you only have one monster on the screen at a time… or even if you are using more and you just want to replace a dead one continuously, you dont have to remove it and replace it at all. Just use the same one over again.

normal:
-playing moving/shooting frames

death:
-playing dying sequence
-last frame of death is empty frame

^on that empty frame (where its no longer visible on the screen), move the monster to a new location and make him appear as a new one telling it to go back to its ‘normal’ state.

But I DON’T want the monster to dissappear, how can I do that?? :q:

Bump! This is important!

Explain exactly what you want to do, I’m not sure I understand what’s supposed to happen when the monster dies :-\

I just want a “respawn” point. That when I kill a monster, another one will show up and when I kill the second monster, a third one will show up, and so on until a certain variable reaches a certain number. The problem is, that I don’t want the dead bodies to dissappear.

Well, at the end of the dying sequence, assuming that you gave a linkage name to your monster (“monster” for instance :)) put something like this:

mc=_root.attachMovie("monster",1000);
mc._y=500;
mc.onEnterFrame=monsterBehaviour;

Does it make sense?

pom :skull:

Well the 1000 level there Ilyas, that will overwrite the other dead bodies, so shouldn’t it be i++ instead?

Since he wants the dead bodies to stay there dead, you would have to put it on a new level.

Yep, you’re right :trout:

:beam:

Thanks Pom! Now I know how to use attachMovie!! :beam:
However I just did what I didn’t think about doing before: I looked in the tutorials on Kirupa.com, and I found that duplicate movie tutorial, and it helped me a lot, and now I can duplicate as much monsters as I want without the dead bodies disappearing! GOD I LOVE THIS SITE!!! :geek:

However now I got ANOTHER problem: The depths of the monsters. I opened a seperate thread for that.