A Flash Developer Resource Site

Results 1 to 15 of 15

Thread: [RESOLVED] AS2 Match 3 Game algorithm

  1. #1
    Junior Member
    Join Date
    Dec 2009
    Posts
    26

    resolved [RESOLVED] AS2 Match 3 Game algorithm

    Hello

    I am looking for someone to write a match 3 game algorithm for me.

    I have some code that I took from here: http://www.flashgameu.com/book_source_files_2.html (brilliant resource!)
    which is in AS3 and I have attempted to amend it to AS2

    It more or less works, but frankly it doesn't!

    In summary:
    The game is an 8x8 grid of balls
    Balls are dropped from the top by the player
    Each time that three balls of the same colour are put together they are removed and the balls above drop down to replace them
    The grid of balls needs to be searched recursively checking the grid for newly made groups of three

    I am not (obviously) after the whole game, I can write the dropping bit etc its just the searching and removing code that is baffling me.

    Must be AS2 please

    Anyone interested?
    I am happy to supply the code I have so far - so it might be a debugging job as much as anything.

    thank you

    lizzy

  2. #2
    Prid - Outing Nig 13's Avatar
    Join Date
    Jul 2006
    Location
    Norway
    Posts
    1,864
    I can have a look at the file
    I am back, guys ... and finally 18 :P

    BRING BACK THE OLD DESIGN!! OR AT LEAST FIX THE AS TAGS

  3. #3
    Junior Member
    Join Date
    Dec 2009
    Posts
    26

    Here is a zip file of the code ..

    this is the as file that contains the trouble..
    Attached Files Attached Files

  4. #4
    Prid - Outing Nig 13's Avatar
    Join Date
    Jul 2006
    Location
    Norway
    Posts
    1,864
    would you mind possibly posting the FLA file as well, lol? :P
    It's too much code, gotta test and stuff, lol
    I am back, guys ... and finally 18 :P

    BRING BACK THE OLD DESIGN!! OR AT LEAST FIX THE AS TAGS

  5. #5
    Junior Member
    Join Date
    Dec 2009
    Posts
    26
    too big to post - its 600kb - happy to do it in bits, email or drop box if I have your email?

  6. #6
    Prid - Outing Nig 13's Avatar
    Join Date
    Jul 2006
    Location
    Norway
    Posts
    1,864
    just upload it on TinyUpload and post the link here, or if you prefer email: prid_outing[AT]hotmail.[COM]

    I can't promise you that I can fix it, but I am just giving it a try, just a FYI :P
    I am back, guys ... and finally 18 :P

    BRING BACK THE OLD DESIGN!! OR AT LEAST FIX THE AS TAGS

  7. #7
    Junior Member
    Join Date
    Dec 2009
    Posts
    26
    http://s000.tinyupload.com/?file_id=...25988764521477

    wow that is brilliant!

    No promises understood, I am very happy that you are giving it a look. Any help appreciated - or start again and give me a price if that is appealing

    lizzy

  8. #8
    Prid - Outing Nig 13's Avatar
    Join Date
    Jul 2006
    Location
    Norway
    Posts
    1,864
    I am really lost - what do you want help with?

    The game is working flawlessly!
    I am back, guys ... and finally 18 :P

    BRING BACK THE OLD DESIGN!! OR AT LEAST FIX THE AS TAGS

  9. #9
    Junior Member
    Join Date
    Dec 2009
    Posts
    26
    Make a line in the top row and it barfs (that is a technical term!)

  10. #10
    Prid - Outing Nig 13's Avatar
    Join Date
    Jul 2006
    Location
    Norway
    Posts
    1,864
    sorry, but I can't fix it. Have been trying to fix it for hours, but to no avail! The closest I came, however, was to prevent the lag, but that created a kinda "whole". In PlayView.as, find the function droppedCounter, and replace it with this function:

    Actionscript Code:
    public function droppedCounter():Void
            {
                var foundMatches = false;
                var i = 0;
                while(i<5){  
                    foundMatches = findAndRemoveMatches();
                    i++;
                }
                newCounter();

            }

    and this is the closest I came, but can't somehow get any further Dx

    Again, sorry, but I think I going to give up on this
    I am back, guys ... and finally 18 :P

    BRING BACK THE OLD DESIGN!! OR AT LEAST FIX THE AS TAGS

  11. #11
    Junior Member
    Join Date
    Dec 2009
    Posts
    26
    Thanks very much for trying, its a puzzle! I appreciate your help

    lizzy

  12. #12
    Junior Member
    Join Date
    Dec 2009
    Posts
    26
    Worked it out myself ... after much scratching of head.
    Thanks Nig 13 .. if you want to see the result let me know - in thanks for your help

  13. #13
    Prid - Outing Nig 13's Avatar
    Join Date
    Jul 2006
    Location
    Norway
    Posts
    1,864
    @lizzylizzy: I sure would love to
    I am back, guys ... and finally 18 :P

    BRING BACK THE OLD DESIGN!! OR AT LEAST FIX THE AS TAGS

  14. #14
    Junior Member
    Join Date
    Dec 2009
    Posts
    26

    match3 source

    Hi Nig

    As promised the amended files.
    http://s000.tinyupload.com/?file_id=...33316758771344

    I 'think' what fixed it was:

    swapping these lines at around line 207 in playView.as
    grid[matches[i][j].col][matches[i][j].row] = null;
    matches[i][j].removeMovieClip();

    and breaking out the reordering of the grid into a separate function.

    I only changed play view.as

    Enjoy!
    Lizzy

  15. #15
    Prid - Outing Nig 13's Avatar
    Join Date
    Jul 2006
    Location
    Norway
    Posts
    1,864
    LOOKS AMAZING! You've improved the gameplay a lot as well, and I really love it
    I am back, guys ... and finally 18 :P

    BRING BACK THE OLD DESIGN!! OR AT LEAST FIX THE AS TAGS

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