A Flash Developer Resource Site

Page 1 of 2 12 LastLast
Results 1 to 20 of 24

Thread: How do you bring in a new move/level when you beat the first?

  1. #1
    Senior Member
    Join Date
    Feb 2005
    Posts
    177

    How do you bring in a new movie/level when you beat the first?

    ok, i made a game where you are a ship defending earth from some asteroids. Your ship has a shield generator that allows the ship to hit the astroids and save earth from being pelted by them.

    In my move 25, there is 4 asteroids. After all are defeated how can i bring in my movie 26? I need to be able to bring the move in once all asteroids are destroyed(i used a script that makes the asteroids hide after colliding with the ship). I created this movie through the first one, so its on my elements list, i just need to know how to bring it in once all asteroids are destroyed, so this would make it look like your on level 2.

    thanks for all those who answer
    Last edited by sonic04; 02-14-2005 at 06:09 PM.

  2. #2
    Senior Member lopez1_de's Avatar
    Join Date
    Oct 2001
    Location
    Germany
    Posts
    299
    you must cascade it more into several movies like this:

    mainmovie
    |------> ship
    |------> score
    |------> level1
    | |------> astroids (4)
    | |------> earth
    |
    |------> level2
    | |------> astroids (20)
    | |------> earth
    | |------> big mothership
    | |------> aliens
    |
    |------> level3 ... ...

    then only show the movie (level1,level2) the player is in.

    but better way is to do it with instances of a movie with the .clone() command. this requires more skills but you have less movie size.
    visit my homepage -> ejected.de

  3. #3
    Senior Member
    Join Date
    Feb 2005
    Posts
    177

    ok

    i know, but how do i BRING IN level 2?

  4. #4
    Senior Member lopez1_de's Avatar
    Join Date
    Oct 2001
    Location
    Germany
    Posts
    299
    element("level1").hide();
    element("level2").show();

    this is very basic. better is to fade it up or something.
    visit my homepage -> ejected.de

  5. #5
    Senior Member
    Join Date
    Feb 2005
    Posts
    177

    hmmm

    hmmm ok, but one last question, how can i determine when element level one will hide, for i want it to hide once all asteroids are destroyed, do u have any idea how i could do that lol

  6. #6
    Senior Member
    Join Date
    Feb 2005
    Posts
    177
    maybe im not explaining this enough, ok my "level one" is my main move (movie 25). For level two, would i like create an animation element or, make a slide show, that would have my level two? if so how could i bring it in?

  7. #7
    Senior Member lopez1_de's Avatar
    Join Date
    Oct 2001
    Location
    Germany
    Posts
    299
    mhhh

    don't really know how you build this game. but normally you should have a variable with the number of astroids:
    astroids=20;
    Every time a astroid is hit you increase the variable by 1.
    astroids--;

    then you have a script which runs in the background:
    if (astroids==0) {
    level++;
    message="Congratulation! You defend our planet!";
    if (level==1) {
    element("level1").show();
    } else if (level==2) {
    element("level1").hide();
    element("level2").show();
    } else if (level==3) {
    element("level2").hide();
    element("level3").show();
    }
    }


    something like this...
    visit my homepage -> ejected.de

  8. #8
    Senior Member lopez1_de's Avatar
    Join Date
    Oct 2001
    Location
    Germany
    Posts
    299
    Originally posted by sonic04
    maybe im not explaining this enough, ok my "level one" is my main move (movie 25). For level two, would i like create an animation element or, make a slide show, that would have my level two? if so how could i bring it in?

    don't make the first level the main movie!
    try to build it like I described above..
    a child movie for each level.
    visit my homepage -> ejected.de

  9. #9
    Senior Member
    Join Date
    Feb 2005
    Posts
    177
    o ok i guess i was thinking something different that obviously cant work lol.

    Sorry to take up so much of your time, but i need to know one more thing.

    You said the varriable was asteroid, well right now i have 4 different paint elements that make up my 4 different asteroids. O jeeze this is confusing. Should i just make one asteroid paint element then clone it for my nexd levels? im not sure how to do this, but would i just make a script saying:

    asteroid=element("paint 94")

    then do your script:

    astroids=20;
    if (astroids==0) {
    level++;
    message="Congratulation! You defend our planet!";
    if (level==1) {
    element("level1").show();
    } else if (level==2) {
    element("level1").hide();
    element("level2").show();
    } else if (level==3) {
    element("level2").hide();
    element("level3").show();
    }
    }


    But by putting astroids=20, does that really clone it, or how would i clone it?

  10. #10
    Senior Member lopez1_de's Avatar
    Join Date
    Oct 2001
    Location
    Germany
    Posts
    299
    I'll make you a litte clone example...one moment plz
    visit my homepage -> ejected.de

  11. #11
    Senior Member lopez1_de's Avatar
    Join Date
    Oct 2001
    Location
    Germany
    Posts
    299
    here...


    note: you only can clone movies!!!
    Attached Files Attached Files
    visit my homepage -> ejected.de

  12. #12
    Senior Member
    Join Date
    Feb 2005
    Posts
    177
    o jeeze, lol i hope this doesnt bring up a different problem, i opened your file, but it says its some unknown format when i go to the 3dfa screen. Ive never used someone elses work before for im kinda new to this software, so is there anything i have to do to the file before i can use it?

  13. #13
    Senior Member lopez1_de's Avatar
    Join Date
    Oct 2001
    Location
    Germany
    Posts
    299
    ehm, which version of 3dfa you use?

    this example was made with 3dfa v4 Release 5

    version 3 is a toy, version 4 is a tool made by devil (wow is it hot)
    3dfa v4 seems to be much more difficult, but give it a try. it is so powerfull.
    visit my homepage -> ejected.de

  14. #14
    Senior Member
    Join Date
    Feb 2005
    Posts
    177
    3dfa v 4 realese 5 is the one i use, im trying to find a way to view the file, it says unknown location because the location of the file is from your computer so ill try changing it to mine i guess

  15. #15
    Senior Member lopez1_de's Avatar
    Join Date
    Oct 2001
    Location
    Germany
    Posts
    299
    ok. then don't double click it!!! (3dfa bug)

    open 3dfa, click load and select the file. or use drag and drop and drop the file into 3dfa window
    visit my homepage -> ejected.de

  16. #16
    Senior Member
    Join Date
    Feb 2005
    Posts
    177

    thanks

    ok thanks, i got to go, but thanks for the file and thanks for taking the time to help.

    thanks

  17. #17
    Senior Member
    Join Date
    Feb 2005
    Posts
    177
    i got your file but there seems to be a problem with this part of the script:

    astroids[i].createMovie();

    it says:
    createMovie() is not a method of Null on line 10 astroids[i].createMovie()

    What should i do to fix it
    Last edited by sonic04; 02-14-2005 at 08:52 PM.

  18. #18
    Senior Member lopez1_de's Avatar
    Join Date
    Oct 2001
    Location
    Germany
    Posts
    299
    It must be:

    astroids[i] = root.createMovie();
    visit my homepage -> ejected.de

  19. #19
    Senior Member
    Join Date
    Feb 2005
    Posts
    177

    ok

    ok thanks, one more question.

    first of all when i pressed play nothing was on the screen, but in your
    //create empty astroids movies and clone astroid movie
    comment in the script, what did u mean by that?

    thanks

  20. #20
    Senior Member lopez1_de's Avatar
    Join Date
    Oct 2001
    Location
    Germany
    Posts
    299
    it means that if you want to clone a movie you first must create an empty movie with .createMovie();

    and don't forget: NEVER use 3dfa preview!

    the example don't work for you? :0
    visit my homepage -> ejected.de

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center