1 Reply Latest reply on Dec 29, 2009 1:23 PM by James Newton, ACP

    matching game - acknowledge when complete?

    yankeeschick

      I created a simple game using this tutorial: http://www.communitymx.com/content/article.cfm?page=1&cid=A5FEE868A7385E7A

       

      It works exactly as described in the tutorial, but I would really like for the game to acknowledge the user when all the matches have been found. Can anyone assist? Is there somewhere within one of the scripts where I could insert some sort of playsound behavior so that a cheering sound (from my cast) plays when all of the matches have been found?

       

      Thanks!

        • 1. Re: matching game - acknowledge when complete?
          James Newton, ACP Level 3

          You need to make two changes.  The first is to add a label to frame 2.  You can call this anything you like.  See below, to understand why this is important.

           

          In the code of the behavior "stay" in the "scripts" cast, change the lines...

           

                  if gTotalmatch = the number of members of castLib "cards" then

                     go next

                   end if

          ... to:

           

                  gTotalmatch = gTotalmatch + 1 -- add this line

                   

                  if gTotalmatch = the number of members of castLib "cards" then

                    go next

                  end if

          The line go next or go #next will move the playback head to frame 2, if you added a label to frame 2.  The line gTotalmatch = gTotalmatch + 1 will count how many matches have been found.