A Flash Developer Resource Site

Results 1 to 6 of 6

Thread: Simple Question from a Newbie

  1. #1
    Junior Member
    Join Date
    Dec 2001
    Posts
    14

    Smile

    I've modified an old "invaders" game for a project I'm trying to do. But, I want the winner to really feel like they won with music - new graphics, etc...

    If I redirect to an UPLOAD MOVIE - I suppose I can accomplish that; but, I was wondering if there is some way to attach a internal MC or something rather than having two or three separate files calling each other.

    If I want to change the "badguy" after the first one lost to the "goodguy" - does that also have to be done from a separate movie file?

    I am trying very hard to understand.

    Any help is very much appreciated.

  2. #2
    Senior Member
    Join Date
    Feb 2001
    Posts
    314
    One way that a "You Won" sequence is often done is to add a separate scene onto the end of the movie. You can do anything you want in that scene, and you can pretty much assemble it exactly as you would do a separate movie.

    Choose "Insert" from the top menu and then "Scene" and Flash will bring up a new timeline just like you had created a new movie.

    Then, to go to that scene, you use this:

    gotoAndPlay ("Scene 2", 1);

    That'll send the movie to frame 1 of scene 2.

  3. #3
    Junior Member
    Join Date
    Dec 2001
    Posts
    14

    Like Duhhhh - A Scene

    I feel so dumb! Of course another scene...

    I guess I got to caught up in developing a movie with only one scene using MCs I got lost in all the jumble...

    Thanks...

    John

  4. #4
    Junior Member
    Join Date
    Dec 2001
    Posts
    14
    Maybe I am just way out of my league here; but, it seems so simple - but, obviously REALLY hard for me.

    Why does the hitTest work on the second 'if' statement but, not my own first - the redirect to scene 2 if my bullet hit the target?

    Another question, why does == seem to mean 'does not equal' and <> seem to mean does equal?





    onClipEvent (load) {
    bulletMove = 18;
    // this attaches the heart to JDCARTOON
    this._y = _root.JDCARTOON._y-30;
    this._x = _root.JDCARTOON._x;
    _root.fired += 1;
    }
    // Shoot The Heart
    onClipEvent (enterFrame) {
    if (this.name<>"bullet") {
    this._y -= bulletMove;
    if (this._y<5) {
    this.removeMovieClip();
    }

    if (this.hitTest(_root.alien)){
    gotoAndPlay ("Scene 2", 1);
    }

    if (this.hitTest(_root.alien)) {
    _root.gameends("You Win!");
    }
    }
    }

  5. #5
    Who needs pants? hooligan2001's Avatar
    Join Date
    Apr 2001
    Location
    Somewhere
    Posts
    1,976
    change this

    if (this.hitTest(_root.alien)) {
    _root.gameends("You Win!");
    }


    to this

    if(hitTest(_root.alien)) {

    _root.gameends.gotoAndPlay("you Win!");

    }
    [Edited by hooligan2001 on 12-17-2001 at 04:18 AM]

  6. #6
    Junior Member
    Join Date
    Dec 2001
    Posts
    14

    DIDN'T WORK

    Why is always true that the little things take the most time to do (right).

    onClipEvent (load) {
    bulletMove = 18;
    // this attaches the heart to JDCARTOON
    this._y = _root.JDCARTOON._y-30;
    this._x = _root.JDCARTOON._x;
    _root.fired += 1;
    }
    // Shoot The Heart
    onClipEvent (enterFrame) {
    if (this.name<>"bullet") {
    this._y -= bulletMove;
    if (this._y<5) {
    this.removeMovieClip();
    }
    if (hitTest(_root.alien)) {
    _root.gameends.gotoAndPlay("Scene 2", 1);
    }
    }
    }

    THIS DID NOT WORK EITHER... I PUT A STOP() ON TOP LEVEL AND CHANGED THE SCRIPT AS SUGGESTED. MY BULLET WENT RIGHT THROUGH THE BADGUY AND NOTHING HAPPENED (UNTIL HE NAILED ME!) THEN THE GAME ENDS AS ORIGINALLY WRITTEN.

    help...


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