7 Replies Latest reply on Mar 14, 2011 12:12 AM by flydream27

    Matching titles to text game

    Nickname_is_none Level 1
      I'm trying to create a pairs game BUT my main problem is that the two cards are not the same, so I can't have a library of images in the cast. I want to be able to match a paragraph of text to a title.

      Basically I want:
      1) 16 blank cards (8 Titles and 8 Paragraphs)
      2) Pick 1st card - it displays the content
      3) Pick 2nd card - it displays the content
      4) If Pick 1 and Pick 2 are a match then say "Well done" and leave them turned over, else say "wrong" and turn the two cards back over.

      I'm using globals, but I'm having real difficulty getting the whole thing to work. Can anyone help, or point me in to a good example that I can tailor to my own?

      Thanks.

        • 1. Re: Matching titles to text game
          Level 7
          Look Ma, no globals!

          http://bellsouthpwp2.net/d/g/dgcraddock/matchGame.zip

          Any questions, please feel free to ask.


          Nickname is none wrote:
          > I'm trying to create a pairs game BUT my main problem is that the two cards are
          > not the same, so I can't have a library of images in the cast. I want to be
          > able to match a paragraph of text to a title.
          >
          > Basically I want:
          > 1) 16 blank cards (8 Titles and 8 Paragraphs)
          > 2) Pick 1st card - it displays the content
          > 3) Pick 2nd card - it displays the content
          > 4) If Pick 1 and Pick 2 are a match then say "Well done" and leave them turned
          > over, else say "wrong" and turn the two cards back over.
          >
          > I'm using globals, but I'm having real difficulty getting the whole thing to
          > work. Can anyone help, or point me in to a good example that I can tailor to my
          > own?
          >
          > Thanks.
          >
          >
          >
          • 2. Re: Matching titles to text game
            Nickname_is_none Level 1
            Thanks for your reply.

            How could I change that so that I was matching a card to a different member rather than matching it to it's own cast member?

            (So using your example, A would match with E, B -> F, C ->G and D->H, rather than A->A, B->B etc)
            • 3. Re: Matching titles to text game
              Level 7
              The matching is not really done on the images A-> A, B->B, etc. The
              matching is really taking place via the cards.

              Each card is assigned a property called pPairNumber via the
              getPropertyDescriptionList function in the behavior. The value of this
              property can be seen (and changed if desired) by selecting a card and
              double clicking the behavior on the behavior tab of the property inspector.

              So in the example, there are two cards with a pPairNumber of 1, two with
              a pPairNumber of 2, ...two with a pPairNumber of 8. This is what
              determines if two cards match. You should click on every card and see
              the value of pPairNumber so that you will understand this key point.

              The card behavior simply changes the visible property of the sprite in
              the next sprite channel, so that the card appears to have something on
              it when it is face up. In my example these are bitmaps members with
              letters. What is in the sprite channel following a card plays no part in
              determining if a match was made.

              So you can exchange those with any cast member you want. For example,
              lets say you have two cast text members called Title1 and Paragraph1.
              Click on of the A's on the score or stage, then click Title1 in the cast
              window, then press Ctrl+E. This will swap the cast member for that
              sprite. Click the other A on the score or stage, then click Paragraph1
              in the cast window, then press Ctrl+E. This will swap the cast member
              for that sprite.

              Repeat for each Title/Paragraph pair, then you can delete the letters I
              made from the cast, as they will no longer be utilized.

              Nickname is none wrote:
              > Thanks for your reply.
              >
              > How could I change that so that I was matching a card to a different member
              > rather than matching it to it's own cast member?
              >
              > (So using your example, A would match with E, B -> F, C ->G and D->H, rather
              > than A->A, B->B etc)
              >
              • 4. Re: Matching titles to text game
                Nickname_is_none Level 1
                Ahhhhhhhh, I see. I think that's probably a much more logical way of doing it thanks. I've had a play and added extra cards and it works a treat.

                Thanks again.
                • 5. Re: Matching titles to text game
                  James Newton, ACP Level 3
                  Here's another example of a Memory game, with downloadable source.
                  • 6. Re: Matching titles to text game
                    Level 7
                    You peaked my interest, so cranked out another solution. This one uses
                    only one sprite for all of the cards (some basic imaging lingo). The
                    behavior's Parameter dialog provides a number of customization options,
                    like how many rows and columns of cards, the space in between cards, the
                    messages that appear and more. It's probably a lot quicker to set up, or
                    make modifications to after the fact.

                    It could use some rigorous testing to ensure it is bug free, but you or
                    anyone else is welcome to check it out.

                    http://bellsouthpwp2.net/d/g/dgcraddock/matchGame2.zip


                    Nickname is none wrote:
                    > Ahhhhhhhh, I see. I think that's probably a much more logical way of doing it thanks. I've had a play and added extra cards and it works a treat.
                    >
                    > Thanks again.
                    • 7. Re: Matching titles to text game
                      flydream27

                      Example above really help me much in do memory game. But I wish to add random function, which is shuffle card. Can I know which part of script sholud I make changes?

                       

                      Thanks