21 Replies Latest reply on Mar 27, 2011 11:58 PM by Reeece

    Movieclip/enemy spawning + coding transfer

    Reeece

      Hey, basically I am creating a zombie survival game, and I have a couple problems with my code to spawn enemies, and I think that some of it may be because the script to move the zombie and make it attack is on the movieclip and not inside of it, and i am not sure why but i also have some problems with my spawning code as I can get the zombies to spawn, but they just hang around at the top left of the screen and spawn in a big group in one spot, as well as the occassional zombie popping up momentarily before disappearing again in random spots.

       

      I have included an interval which is sucessfully working, but the zombies dont move they are just stuck at the top of the screen althoguh they do spawn every 2 seconds as the code says they are still not working properly, any help would be appreciated.

      This is my code so far:

      i = 0;
      Zombies = [];

      spawnZombie = function(){
      _root.attachMovie("Zombie", "Zombie"+i, _root.getNextHighestDepth());
      _root["Zombie"+i]._x = random(Stage.width);
      _root["Zombie"+i]._y = random(Stage.height);
      Zombies.push("Zombie"+i);

      _root["Zombie"+i].onEnterFrame = function(){
        this._y += 3;
        if(this._y > Stage.height){
         for(e = 0; e < _root.Zombies.length; e++){
          if(_root.Zombies[e] == this._name){
           _root.Zombies.splice(e, 1);
          }
         }

         this.removeMovieClip();
        }
      }
        i++;
      }
      Zombie_interval = setInterval(spawnZombie, 2000);

        • 1. Re: Movieclip/enemy spawning + coding transfer
          Ned Murphy Adobe Community Professional & MVP

          That code appears to work fine if I place it in the timeline of an empty file and create a library object with a linkage of Zombie.  The objects are planted randomly around the stage and gradually move down off the stage and get removed.  There may be some other code causing your zombies to herd themselves into a corner.

          1 person found this helpful
          • 2. Re: Movieclip/enemy spawning + coding transfer
            Reeece Level 1

            sorry my internet has been down all day, thanks for confirming that the code works, it may be the zombies movement which follows anothr movie clip - the main character and thats the main thing in my mind which might be the main or most likely cause.

            the code is as follows:

            onClipEvent (enterFrame) {
              if(this._currentframe < 50){
               if(_root.Zombie._x > _root.Character._x){
                _root.Zombie._x -= 0.75;
            }
            if(_root.Zombie._x < _root.Character._x){
            _root.Zombie._x += 0.75;
            }
            if(_root.Zombie._y > _root.Character._y){
              _root.Zombie._y -= 0.75;
            }
            if(_root.Zombie._y < _root.Character._y){
            _root.Zombie._y += 0.75;
            }}}

            onClipEvent (enterFrame) {
            o = _root.Zombie._y-_root.Character._y;
            a = _root.Zombie._x-_root.Character._x;
            if (_root.Zombie._x<_root.Character._x) {
            _root.Zombie._rotation = -(90- (Math.atan(o/a)/(Math.PI/180)));
            } else {
            _root.Zombie._rotation = (90+(Math.atan(o/a)/(Math.PI/180)));
            }
            }

             

            this code moves the zombie towards the main character movieclip and rotates it towards it, but this code worked perfectly fine before, but as soon as they are put together they both stop working now, this code is put on the movieclip and not inside it, although I think it needs to be inside the movieclip so that the actions work for each newly spawned movieclip/zombie, again sorry for the late reply. thanks for the help

             

            EDIT: Hey, I was playing around with the code again, and I dont know what i changed, it is more or less the same as it was before, now they spawn correctly but they do not move, they animate (feet move) to represent movement, but they dont walk towards/follow my character, any tips?

            • 3. Re: Movieclip/enemy spawning + coding transfer
              Ned Murphy Adobe Community Professional & MVP

              I can only see that code working if you have one zombie and its instance name is Zombie.  You should do yourself a favor and avoid putting code "on" objects.  Keep it all in a timeline where it is easy to find and easier to manage targeting/controlling objects.

               

              I am not clear on what you are trying to accomplish having two sets of codes commanding two different travel plans (one down and out, the other towards the character), but you should have all your movement control for each zombie in one place... the code you started off this posting with might be a good place to build it into.

              1 person found this helpful
              • 4. Re: Movieclip/enemy spawning + coding transfer
                Reeece Level 1

                Yeah sorry, I just did it step by step and figure it out along the way, they work seperately so ill have to try merge them or get a different code working all on the main timeline instead, i just thought it would work for all zombies if i put the code inside of the zombie movieclip so it spawns copies of that movieclip with them all with the same code, i justfigured it would be esaier and more likely to work, ok ill have another mess around and look around for somthing which could work, if they work seperately they should be able to work together in some way, thanks.

                • 5. Re: Movieclip/enemy spawning + coding transfer
                  Reeece Level 1

                  Right ok, i have all of my current code working perfectly fine, although I am still having trouble with the spawning. I now have it so everything in my game works properly, i just need the spawning code to work properly, and at the moment it doesnt look very accurate as it is as if the code isnt even there, no sign of spawning or anything like that. the current spawning code i have is as follows:

                  i = 0;
                  Zombies = [];

                  spawnZombie = function(){
                  _root.attachMovie("Zombie", "Zombie"+i, _root.getNextHighestDepth());
                  _root["Zombie"+i]._x = random(Stage.width);
                  _root["Zombie"+i]._y = random(Stage.height);
                  Zombie.push("Zombie"+i);
                  }
                  _root["Zombie"+i].onEnterFrame = function(){
                     for(e = 0; e < _root.Zombies.length; e++){
                      if(_root["Zombie"+e] == this._name){
                       _root.Zombie.splice(e, 1);
                  }}
                  this.removeMovieClip(); 
                  }
                  i++;

                  Zombie_interval = setInterval(spawnZombie, 2000);

                  it is the "_root.getNextHighestDepth()" and the 2nd part of code "onEnterFrame = Function()" i dont fully understand, I havnt used the next highest depth code before so im not 100% sure what it does/is exactly, and im not 100% on what the splice feature does, although I am thinking it is somthing to do with removing the zombies from the array/package "Zombie"+i package although again, im not positive what each part means seperately as i havnt used splice before either so im a bit clueless towards fixing that part although I am trying its difficult to tell because im quite unfamiliar with that part of code. I was wondering if you could point me in the right direction or maybe identify any known errors/problems which you can see in the code at the moment. Thanks a lot

                  • 6. Re: Movieclip/enemy spawning + coding transfer
                    Ned Murphy Adobe Community Professional & MVP

                    You don't want what you have in the enterFrame function and the rest of the code is confused/ing as well.  enterFrame is essentially a means of having a function constantly process at the frame rate of the file.  What you are doing with it is having each spawned Zombie checking all of the zombies and removing them if they have the name of the zombie that you spawned... essentially removing them before they have a chance to exist I would guess.  The splice command is removing them from the Zombie array, and the next line removes the zombie from existence.

                     

                    What you could do is have just one enterFrame function that works for all of the zombies to manage their movement.  Create it such that it loops thru the Zombie array and adjusts the positions as needed for each zombie...

                     

                    this.onEnterFrame = function(){

                       for(i=0; i<Zombies.length; i++){

                           // move the zombie using your movement logic/code

                           if(the zombie moved where it needs to be removed){

                               // remove it from the array and from existence

                           }

                       }

                    }

                     

                    The enterFrame will do the dirty work of managing them, so focus on coding what I described it should do.  All you need to do with your spawning function is just that... spawn zombies and add them to the Zombie array.

                     

                    spawnZombie = function(){
                       _root.attachMovie("Zombie", "Zombie"+i, _root.getNextHighestDepth());
                       _root["Zombie"+i]._x = random(Stage.width);
                       _root["Zombie"+i]._y = random(Stage.height);
                       Zombie.push("Zombie"+i);
                    }

                     

                    Zombie_interval = setInterval(spawnZombie, 2000);

                    • 7. Re: Movieclip/enemy spawning + coding transfer
                      Reeece Level 1

                      yeah I have been messing around with the code a lot trying to get the spawning working, so ill give your code a go and let you know how it went, i was really getting tierd of it not working for so long hope it works thanks =]

                      • 8. Re: Movieclip/enemy spawning + coding transfer
                        Reeece Level 1

                        hmm, ok so the

                               if(the zombie moved where it needs to be removed){

                                   // remove it from the array and from existence

                        code generally means that it needs to be removed upon reaching the character? although the zombie is removed on click which i have inside the zombie movieclip so that it is clicked and then dies, the code i have for essentially killing the zombie is:
                        on(release){
                        if(this._currentframe < 80){
                        this.gotoAndPlay('ZombieDead');
                        _root.SCORE+=1;
                        }}

                        (frame 80 is the death animation so this fixes an earlier problem so that it dies properly - that is irrelevent but its just ot clarify

                        so do you mean once it is dead remove it from the array because the code you explained describes it being linked to movement, I just want to make it clear so i dont get it mixed up and spending forever on it just to know i am doing it wrong

                         

                        so I am a bit puzzled, should i move all of the movement into the provided code so it is linked to each zombie in the array and so that they all share the same properties and actions or could i do it seperately. although i know doing it with the code you provided is probably the better option im not confident in how to include all of my code and change it to fit in with each other... sorry to drag on but so far this is what it looks like just combining them, i know it doesnt match as it doesnt work having a mouse event on the actions layer, but im not positive how to convert it to fit in with the other code, I know i'm dragging on but i just want to be thorough so that it all works well and smoothly

                        sorry to cause so much bother and assistance/time.

                         

                        so what your saying is what i want is to link all the functions to the array with the first code, and then "_root.Zombie.splice(e, 1); }} this.removeMovieClip(); }" code to remove them from the array and from existance upon death. sorry to be such a hassle once again, i dont know how i make my replies so long o.o Thanks for all your time though again : )

                        • 9. Re: Movieclip/enemy spawning + coding transfer
                          Ned Murphy Adobe Community Professional & MVP

                          You are going to have to spend time understanding what you are trying to do, and sometimes that involves doing it wrong such that you ultimately figure out how to do it right.  THat's pretty much how I learned things with Flash.  Try to logically determine what you need and create code that does it.

                           

                          I am suggesting you let the onEnterFrame function manage movement of all of the zombies as just one single function on the timeline.  It will go thru the for loop that I show and adjust the position of each zombie based on whatever criteria you define for how they move.

                           

                          If something other than moving around causes a zombie to be removed, such as clicking it, then you should probably have your removal code in a separate function so that both the position dependent removal and the clicking dependent removal can share that same function.

                           

                          As already mentioned, you should avoid using 'on'...anything code on objects. Keep your code on the timeline.  That on(release) code can be added to your spawning code... (you cannot dynamically add 'on'... code onto an object, and it has to be added manually when it is placed on the stage)

                           

                          spawnZombie = function(){
                             _root.attachMovie("Zombie", "Zombie"+i, _root.getNextHighestDepth());
                             _root["Zombie"+i]._x = random(Stage.width);
                             _root["Zombie"+i]._y = random(Stage.height);

                           

                             _root["Zombie"+i].onRelease = function(){

                                 if(this._currentframe < 80){
                                     this.gotoAndPlay('ZombieDead');
                                     _root.SCORE+=1;
                                 }

                             }

                            
                             Zombie.push("Zombie"+i);
                          }

                          • 10. Re: Movieclip/enemy spawning + coding transfer
                            Reeece Level 1

                            I was just about to post another reply, so ill just post it anyway so that its clearer and so I could maybe get some rough confirmation.

                            basically put the movement code into the provided code, which i assume gives actions to the whole array instead of just the one zombie. so somthing like this should provide the move function for all zombies:

                            this.onEnterFrame = function(){

                               for(i=0; i<Zombie.length; i++){
                               
                              if(Zombie._currentframe < 50){
                               if(_root.Zombie._x > _root.Character._x){
                                _root.Zombie._x -= 0.75;
                            }
                            if(_root.Zombie._x < _root.Character._x){
                            _root.Zombie._x += 0.75;
                            }
                            if(_root.Zombie._y > _root.Character._y){
                              _root.Zombie._y -= 0.75;
                            }
                            if(_root.Zombie._y < _root.Character._y){
                            _root.Zombie._y += 0.75;
                            }}

                            o = _root.Zombie._y-_root.Character._y;
                            a = _root.Zombie._x-_root.Character._x;
                            if (_root.Zombie._x<_root.Character._x) {
                            _root.Zombie._rotation = -(90- (Math.atan(o/a)/(Math.PI/180)));
                            } else {
                            _root.Zombie._rotation = (90+(Math.atan(o/a)/(Math.PI/180)));
                            }}}

                            Then the second one I need to link the array so that all the zombies die when you click them, when that happens I need to remove them from the array and from existence using splice and "this.removeMovieClip();" I know what i need to do im just having trouble converting it to work as a different format ( on a layer instead of on/attached to the movieclip. so i need to somehow create a code so that I can remove the movieclip by clicking it and not by moving, although  only know how to do this with "on" codes/function e.g release and mousedown.

                            so far im thinking along the lines of making a code to kill the zombie to send it to frame 80 - the death animation and then maybe another to remove it from the array and existence and remove it from the loop by a currentframe = 90){ code or similar followed by a splice/removemovieclip.

                             

                             

                             

                            (Optional Read)

                            although I would much prefer learning this over a longer period of time i have a deadline to complete it by, and I would of liked to be much more ambitious with the game but i had to think more realistic on getting it done in time, and its becoming a close call for completing it, although I am going to continue working on the game after the deadline is met and the game is finished for college and then carry on for peronsal studies and an extended flash knowledge, I am learning now and its just getting a bit stressful being rushed to try as many codes as possible as fast as possible to get it done on time instead of learning by just keeping at it, I have kept at it from the start of all my code problems but this code in particular is the hardest i have come across and its quite difficult to get my head round sometimes especially when being rushed to complete it by a deadline. I understand that i have to learn from sticking at it, and im sure id get it cracked eventually, but i dont have enough time for gradually understanding it which is why im asking for support here, I just want my game playable and finished for now so i can continue adding more features later on and polishing the game, I set the project to challenge myself instead of going for somthnig simple and basic, I wanted to create somthing I could further evolve, somthing which would challenge me and somthing i could learn the most from, and this project has certainly met its expectation for that. so thanks for the help, ill justh have to keep at it, even if it means staying up till 6am again to get it working. Thanks for understanding

                            • 11. Re: Movieclip/enemy spawning + coding transfer
                              Ned Murphy Adobe Community Professional & MVP

                              Within your for loop you need to target the individual zombies in the array.  You should try to be consistent in the way you target things... either use _root for all reference to zombies or don't... though not using it is better practice if it is not needed... if that code is in the same timeline as the Character and the Zombie array, you don;t need the _root reference...

                               

                              this.onEnterFrame = function(){

                               

                                 for(i=0; i<Zombie.length; i++){

                               

                                    if(Zombie[i]._currentframe < 50){


                                        if(Zombie[i]._x > Character._x){
                                            Zombie[i]._x -= 0.75;
                                        }

                                        etc...

                              • 12. Re: Movieclip/enemy spawning + coding transfer
                                Reeece Level 1

                                Ok thanks a lot ill give it a go : ) got a good feeling about this code : )  thanks  for the help again, I really appreciate it

                                 

                                Ok so I have changed the movement so that none of it has any _root. codes in, but i havnt changed the spawn code yet because im not positive which bits need roots yet, I just wanted to test the movement alone, so if i had a bit of _root. commands on a different function in the frame would that interfere with the other codes aor the rest of the script?

                                heres what I have so far :

                                 

                                this.onEnterFrame = function(){

                                   for(i=0; i<Zombie.length; i++){ 
                                     if(Zombie[i]._currentframe < 50){
                                  if(Zombie[i]._x > Character._x){
                                              Zombie[i]._x -= 0.75;
                                }
                                if(Zombie[i]._x < Character._x){
                                Zombie[i]._x += 0.75;
                                }
                                if(Zombie[i]._y > Character._y){
                                  Zombie[i]._y -= 0.75;
                                }
                                if(Zombie[i]._y < Character._y){
                                Zombie[i]._y += 0.75;
                                }}
                                o = Zombie[i]._y- Character._y;
                                a = Zombie[i]._x- Character._x;
                                if (Zombie[i]._x< Character._x) {
                                Zombie[i]._rotation = -(90- (Math.atan(o/a)/(Math.PI/180)));
                                } else {
                                Zombie[i]._rotation = (90+(Math.atan(o/a)/(Math.PI/180)));
                                }
                                if (this.hitTest(Character._x, Character._y, true)) {
                                  this.gotoAndPlay(50)
                                }}

                                 

                                thats movement of the zombie, rotation to face the character and a hit test so that the zombie does damage to the character.

                                am I missing anything or is it just the other root commands which are interfering? : )

                                 

                                Message was edited by: Reeece

                                • 13. Re: Movieclip/enemy spawning + coding transfer
                                  Ned Murphy Adobe Community Professional & MVP

                                  If the intention is toi hitTest the zombie against the Character, "this" is not the zombie.  Also, be sure that you are storing the zombies in your array and not just the name (String) like you have been showing so far.

                                  • 14. Re: Movieclip/enemy spawning + coding transfer
                                    Reeece Level 1

                                    Edit: ah my internet must of cut out or somthing I didnt get an email and it didnt show any new replies when i refreshed it a couple of times no problem, ill try it in the morning cheers

                                     

                                    Ok well ive tried all sorts, but still no luck, I cant get the zombie moving or any of them spawning, although at

                                    least the new code isnt in conflict with the old code which was working before too, so with the new code hopefully i can find a working combination and the right code to get it working, ill try again in the morning, it would be a shame if i dont get it done in time because its the last main thing i want to do for my game but, either way. ive tried my hardest to get it all working, it would be a shame to fall short but anyway, thanks for the help Ned, if you have any more ideas or advice, i'd love to give them a go.  ill check the forum and try fix the code tomorrow morning, again thanks a lot for your help and your time, it is greatly appreciated

                                    • 15. Re: Movieclip/enemy spawning + coding transfer
                                      Reeece Level 1

                                      "If the intention is toi hitTest the zombie against the Character, "this" is not the zombie"

                                      yeah I have been playing around with the code without success but it might of come in conflict with the other code so maybe didnt work so thanks for clearing that up.

                                       

                                      "Also, be sure that you are storing the zombies in your array and not just the name (String) like you have been showing so far."

                                      and what do you mean? include them in the code or like change the in the library and create duplicates like i have seen in other tutorials.

                                       

                                      so far all of my spawning code i have in the current version/document of my game ( as i have different variables of the game with different codes which could potentially work and some with different progress (5 in total))

                                       

                                       

                                       

                                      spawnZombie = function(){
                                         attachMovie("Zombie", "Zombie"+i, _root.getNextHighestDepth());
                                         Zombie[i]._x = random(Stage.width);
                                         Zombie[i]._y = random(Stage.height);
                                         Zombie.push("Zombie"+i);

                                       

                                      Zombie_interval = setInterval(spawnZombie, 2000);

                                       

                                      hmm I did think i had more code, it must of been mixed up in the documents or just a variable of the code you provided and helped me with, ill look around the documents in the morning.

                                       

                                      what type of code would i be looking for too I have a fari bit of different codes for spawning, so which type of code would be compatible and what it roughly what would it look like, that would be very helpful indeed.

                                       

                                      No rush. thanks a lot cya later

                                       

                                       

                                       

                                       

                                       

                                       

                                      • 16. Re: Movieclip/enemy spawning + coding transfer
                                        Ned Murphy Adobe Community Professional & MVP

                                        I could give you a complete working solution if I wanted to, but I have this thing about students/assignments and respect for education that prohibits me from doing the work for them (same goes for most folks I try to help, but students usually just get advice from me, not code).  There are some around here that don't draw that line, but so far you've drawn the short straw and got me. 

                                         

                                        Except for a couple possible tweaks, I've already given you most of what you need...  What you see below is about as far as I'll stretch my limits. It willd be good if you can reason your way thru concluding this yourself.

                                         

                                        var j=0;

                                        var Zombie = [];

                                         

                                        spawnZombie = function(){
                                           _root.attachMovie("Zombie", "Zombie"+j, _root.getNextHighestDepth());
                                           _root["Zombie"+j]._x = random(Stage.width);
                                           _root["Zombie"+j]._y = random(Stage.height);
                                           Zombie.push(_root["Zombie"+j]);  // storing the actual zombie, not its name

                                           j++

                                        }

                                         

                                         

                                        The movement function is using the array as if the array holds the actual instances, not just their names, so it's important to have your spawning code provide what the movement code is using.  Otherwise you would have to modify the movement code to use the names instead.

                                        • 17. Re: Movieclip/enemy spawning + coding transfer
                                          Reeece Level 1

                                          Thanks Ned, I understand your terms with students and most other people but students especially, I would of only asked if I needed to, and its just taken me so long to get the spawning code working fully, I just wanted to get this last thing working, there have been tutorials etc. on the spawning but they dont seem to fit in with my game very well so, again, this was really my last resort and hope for advice and a little nudge in the right direction, so thank you I really appreciate it. : )

                                          • 18. Re: Movieclip/enemy spawning + coding transfer
                                            Reeece Level 1

                                            Hey Ned, I was hoping you could help me out again, for hopefully the final time, I have done as much as I possibly can to try get this code working properly, in my latest version, the zomibes/ movieclips work individually with spawning and attacking (using hit tests etc.) although i have got them moving before with the spawns right it tried to progress with that code and it did not suceed, although i went back and put everything the way it was when it worked, it stopped working, I cant get it back using the code which worked the first time for some reason so I was hoping you could provide me with some reliable working code so that i can progress with my game for peronsal studies so i can educate myself and see how far i can go with the game out of college, I was hoping you could get the code working, as I have tried for so long and despite my efforts I have seen no signs of it working any time soon, so I was really hoping that you could fix it for me, its not for college, I just want to progress with my game for personal studies instead of being stuck on the same part, possibly the most challenging part, and as I said before, I would like to carry on working past this code to see how good I could make the game and how far it would go.

                                            so far this is the code im using for spawning/movement

                                             

                                            onEnterFrame = function()
                                            {
                                              if (_root["Zombie" + i]._currentframe < 50)
                                               if (_root["Zombie" + i]._x > Character._x)
                                               {
                                                _root["Zombie" + i]._x -= 0.75;
                                               }
                                               if (_root["Zombie" + i]._x < Character._x)
                                               {
                                                _root["Zombie" + i]._x += 0.75;
                                               }
                                               if (_root["Zombie" + i]._y > Character._y)
                                               {
                                                _root["Zombie" + i]._y -= 0.75;
                                               }
                                               if (_root["Zombie" + i]._y < Character._y)
                                               {
                                                _root["Zombie" + i]._y += 0.75;
                                               }
                                            //Follow/Chase Character
                                            o = _root["Zombie" + i]._y - Character._y;
                                            a = _root["Zombie" + i]._x - Character._x;
                                            if (_root["Zombie" + i]._x < Character._x)
                                            {
                                              _root["Zombie" + i]._rotation = -(90 - (Math.atan(o / a) / (Math.PI / 180)));
                                            }
                                            else
                                            {
                                              _root["Zombie" + i]._rotation = (90 + (Math.atan(o / a) / (Math.PI / 180)));
                                            }
                                            }

                                            //Face the character so it works with the movement and looks like the zombie is actaully chasing the character

                                             

                                            var i = 0;
                                            var Zombie = [];
                                            spawnZombie = function ()
                                            {
                                            _root.attachMovie("Zombie","Zombie" + i,_root.getNextHighestDepth());
                                            _root["Zombie" + i]._x = random(Stage.width);
                                            _root["Zombie" + i]._y = random(Stage.height);
                                            Zombie.push("Zombie" + i);
                                            };

                                            onEnterFrame = function()
                                            {
                                            for (e = 0; e < _root.Zombies.length; e++)
                                            {
                                              if (_root.Zombies[e] == this._name)
                                              {
                                               _root.Zombies.splice(e,1);
                                              }
                                              this.removeMovieClip();
                                            }
                                            i++;
                                            }

                                            Zombie_interval = setInterval(spawnZombie, 3000);

                                             

                                            // spawning of the zombies works fine, but if theres an alternative which would match/work with the movement, that would be more than acceptable

                                             

                                             

                                            I dont think my knowledge of flash/actionscript can get me much further success with this code, so I am really hoping you could provide me a solution/working code, I honestly have tried my hardest to get it working, but as my tutor/teacher said, it is more on the level of 2nd year univsersity standard, and the work is for college, so I am happy that my ambitions have got me this far, but my limited knowledge of AS2 at this time cant help my past it, so I am hoping yours could, then I could learn more about the code as well as learning from the code you could possibly, hopefully provide for me, I would really like to keep learning from this game especially by progressing past this point of the game --- I have used alternative code, so that the zombies spawn in waves instead of just keep spawning randomly, so there is a limited time on the game at the moment, this is why I am seeking working code which means I can carry on with the game and improve it to an even higher standard, thanks.

                                            • 19. Re: Movieclip/enemy spawning + coding transfer
                                              Reeece Level 1

                                              Ok I have made a bit of progress and got to a bit more advanced stage, a bit like before although it is not as good as I have had it before, I have got one zombie spawning, moving properly with rotation as well, although it doesnt attack when it reaches me and it keeps spawning randomly over and over again, just the same one, so this is just copying the same zombie and spawning the same moveclip over and over, although I do not know how to get more than just that one zombie to come on as I have programmed an array, it doesnt appear to be working as it should be doing, so this is the first time I have got to this stage with the new code apart from the multiple zombies where they spawn right and move properly as althoguh dont damage  and there was a couple errors with them, I cant remember that fully, I have also had the rotation working before but without the movement and the damage was working, I have yet to get the whole thing working at once, theres always somthing wrong, so maybe instead of just the whole code I could compensate for just some advice maybe please, I am sure this will help me learn the coding better anyway, althoguh I will learn with the right code, it will just help the problem solving and error fixing part of actionscript etc. if it is possible, just a bit of advice or working code would be even more appreciated seeing as how you have helped me along the way with this code, ill try not to drag on, thanks

                                               

                                              EDIT: ah, I missed it this time, they are just spawning in the top left corner of the screen again, right on the edge of the stage, they just pile up and spawn in the same place, although the first spawn works fine, and when i kill it then im just stuck with all the zombies which are stuck in the corner, any thoughts? 

                                              • 20. Re: Movieclip/enemy spawning + coding transfer
                                                Ned Murphy Adobe Community Professional & MVP

                                                "ill try not to drag on, thanks"... that's funny... really... do you talk the way you write? (that is not intended in a mean way)  I think I noticed this with your earlier postings but avoided mentioning it... that first fairly lengthy paragraph of your latest post is one long run-on sentence.  And it seems just about any other long paragraph of late is the same.

                                                 

                                                As for my helping you further by handing you a solution... I already went over that. Get your instructor or classsmates to join in the fun and try to work it out together.

                                                 

                                                The only way you'll be able to " improve it to an even higher standard" will be to first understand how to make it work at its current standard.

                                                • 21. Re: Movieclip/enemy spawning + coding transfer
                                                  Reeece Level 1

                                                  No it isnt, I am just trying to be somewhat formal and polite, and yes I tend to get carried away, but thats because I really want this to work, because i am passionate with my work, and not getting it working is really stressing me out, my teacher generally cant be bothered putting in the hours to research the code to find a solution, so again, your my most convicing and choice to be honest, as you have helped me try to figure out a solution, I understand mostly how it works, its probably just little errors, but im not sure what its supposed to look like as i havnt coded anything on the subject of spawning etc.id just like to learn more by doing other coding which i can practice instead of being stuck on this one part, which i really have been trying to solver for easily over a week just on the new part of code you have been suggesting... (and a bit of a rushed reply)