4 Replies Latest reply on Nov 21, 2011 8:19 AM by Ned Murphy

    Memory game help

    ShaunSmith1337
      This person created this game:
      http://www.emanueleferonato.com/2008/05/02/creation-of-a-matching-game-with-flash-and-as3/

       

      i was wondering if i wanted to match two different colours, how could i do this? for example, instead of matching two reds, if i wanted to match a red and green, how is this done?
      Any info would be great, thanks!

        • 1. Re: Memory game help
          kglad Adobe Community Professional & MVP

          using an if-statement.

          • 2. Re: Memory game help
            Ned Murphy Adobe Community Professional & MVP

            The first thing you should realize is that the design uses AS3 code, and you are asking in the AS2 forum.  So if you plan to use AS2, you should find a different tutorial.

             

            As far as making it match green to red, you would have to first understand how this design works so that you can think thru how to redesign it to work that way.  As is, this design assigns two tiles to match based on assigning numbers to them from an array of numeric pairs, and those numbers are used to tell the tile which color frame they belong to. So the current design won't fit your desires very well since the numbers relate to frame numbers and the colors in those frames

             

            To try to use this as a starting point following a similar design approach, one possible approach is to build two separate types of tiles where frame one of one tile-type is red and frame 1 of the other tile-type is green, and so on for the rest of the frames.  THen you need to work out how to get an equal number of each type of tile assigned to a unique number value from and array that only has single values instead of pairs.

             

            In any case, as already mentioned, it is most important that you understand how the current design works before you try to think about how to change it.

            1 person found this helpful
            • 3. Re: Memory game help
              ShaunSmith1337 Level 1

              Hi, sorry about posting it in the wrong section, i did not realise, i am pretty new to all this and AS3 is what i am going to use.

               

              I can see what your saying and thats what ive been trying to do but i don't think my apporach is working. When you say create two titles and match them together how can this be done? Is this done by creating a new layer of tiles and linking them together?

               

              Thank you

              • 4. Re: Memory game help
                Ned Murphy Adobe Community Professional & MVP

                As I said, you need to gain an understanding of how the version you have works.  So study the tutorial thorughly. It is matching soley based on a number assigned to each tile. Tiles with the same number assigned to them will match.  Those numbers just happen to correspond to a frame that has a particular color square in it.

                 

                If you have very little experience with Actionscript, this is likely to be a little too advanced for you to grasp.  In any case, if you intend to continue with this as an AS3 design, you should post any further questions in the correct forum.