8 Replies Latest reply on Sep 1, 2010 4:58 AM by kapelski

    NEED HELP WITH FLASH GAME!

    kapelski

      Hello Everyone,

       

      I am brand new on the forums here and I need some help!!  I am on a very tight deadline for a flash game project and I can not seem to figure out my problem.

       

      In my game people shoot at 4 different moving images and get points. Simple right? Well one of the images is a question mark that people can shoot and when they do, I need flash to pause the game timer, pop up a new window, display the multiple choice question in the window and wait for the user to answer.

       

      NOTE:  I would also like to be able to customize the size and location of the pop up window!  Also the question asked needs to be random.  I have a list of questions in a word doc.

       

      Then if the question is answered correctly close window award 10 points and continue the game.  If the question is answered incorrectly, say wrong and then display the end game results screen.

       

      Right now I have it to where it opens a pop up in a web browser and askes the question there.  The question is randomly chosen from a file called random.html.  But I do not want the game to operate that way. I want the game to open the pop up within flash.  Can anyone help?  The deadline is a few hours, SORRY FOR THE SHORT NOTICE!

       

      Kapelski

        • 1. Re: NEED HELP WITH FLASH GAME!
          Ned Murphy Adobe Community Professional & MVP

          Just create the pop up as a movieclip that has the controls and other elements to support whatever the question aspect needs and make it visible/invisible as dictated by the game play.

          1 person found this helpful
          • 2. Re: NEED HELP WITH FLASH GAME!
            kapelski Level 1

            If I create the pop up as a movie clip, does that still give me the ability to have the question chosen randomly from an external file like it does now?  Also there are several question mark icons throughout the time of the game, so will that change the question every time you shoot a new question mark?  Also will I be able to set attributes to pause the game and either resume or end game upon answer of question.  I am entirely new to pop ups so they are throwing me way off!

            • 3. Re: NEED HELP WITH FLASH GAME!
              Ned Murphy Adobe Community Professional & MVP

              Whatever you need to do with the movieclip can be done.  You can make it so that the questions are dynamically changed each time it appears... but it's all a matter of designing it to be so.  This is nothing to do with popups... it's a movieclip which you can control the visibility of and what it contains.  HAving it in the Flash file is probably going to be easier to manage than an external popup window as far as the programming/scoring aspect goes.

               

              Create a movieclip that has a textfield for the question and whatever else it needs in the way of user interaction.  Unfortunately, I won't be taking the time to give a detailed approach for designing it.  If you can manage creating a shooting game, creating a movieclip that works as you describe should be a fairly straightforward task for you.

              • 4. Re: NEED HELP WITH FLASH GAME!
                kapelski Level 1

                I thought that I would need to use an external xml file for the questions in order to change them dynamically.  Is that not correct?

                • 5. Re: NEED HELP WITH FLASH GAME!
                  Ned Murphy Adobe Community Professional & MVP

                  If you want to make changing the questions pool that you draw the questions from not require a change to the Flash file, then yes, you could use an external data file such as an xml file.  Otherwise, you could have the questions stored in the Flash file itself in an array and choose them from that instead.  In either case, an array (or two) is where the data would end up being stored and you would manipulate the data from there.

                  1 person found this helpful
                  • 6. Re: NEED HELP WITH FLASH GAME!
                    kapelski Level 1

                    Okay.  You have been very helpfull so far.  I made progress now and I seem to be stuck.  I am trying to incorportate the following code

                     

                    on (press) {
                        gotoAndPlay(5);
                        }

                     

                    INTO this code


                    onClipEvent  (load) {
                    _root.hitq = 0;
                    this._alpha = 0;
                    }
                    onClipEvent (enterFrame) {
                    this._y -= _root.speedq;
                    this._rotation += 7;
                    if (this._y<=-120) {
                    this._alpha = 100;
                    }
                    if (this._y<=-500 && _root.hitq == 0) {
                    gotoAndPlay(2);
                    _root.missed += 1;
                    _root.hitq = 1;
                    }
                    if (_root._currentframe == 3) {
                    _parent.nextFrame();
                    }

                    }

                     

                    What I am trying to accomplish is i need the game to jump to a random frame between 5 and 20.  I think I am doing this correctly can anyone help???  Ned?  Anyone?

                    • 7. Re: NEED HELP WITH FLASH GAME!
                      kapelski Level 1

                      Can anyone help?


                      • 8. I am almost there.......I think
                        kapelski Level 1

                        Okay here is an update.  Maybe I am trying to hard to figure this out but I have been up all night and this is what I have.  The "pop up" window is constantly tracking the question mark icons movements!  Everytime a new one question mark appears to be shot a new question does appear so I believe that part is correct.  Can any one help me seperate the window from the question mark?  That way I can pause the game time when the "pop up" is showing and I can add more buttons to resume game or quit.

                         

                        This is my code for what makes the pop up visible:

                        on  (press) {
                        gotoAndPlay(2);
                        _root.score+=0;
                        q1._alpha = 100;
                        }

                         

                        and this is my code that controls the question mark!

                        onClipEvent  (load) {
                        _root.hitq = 0;
                        this._alpha = 0;
                        q1._alpha = 0;
                        }
                        onClipEvent (enterFrame) {
                        this._y -= _root.speedq;
                        this._rotation += 0;
                        if (this._y<=-120) { 
                        this._alpha = 100;
                        }
                        if (this._y<=-800 && _root.hitq == 0) {
                        gotoAndPlay(2);
                        _root.missed += 1;
                        _root.hitq = 1;
                        }  
                        if (_root._currentframe == 3) {
                        _parent.nextFrame();
                        }

                        }

                         

                        Can anyone tell me why the pop up tracks the question mark and how to fix it so that it is stationary in the middle of the screen.  Also does anyone know how i can pause the game time while the pop up is displayed?  Thanks in advanced to anyone that can lend a hand!!!!!

                         

                        Kapelski