User Tag List

Results 1 to 8 of 8

Thread: Bejeweled checking for next possible turn problem

  1. #1
    Clicker Multimedia Fusion 2 DeveloperSWF Export Module
    Tiles's Avatar
    Join Date
    Jun 2006
    Posts
    1,359
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Bejeweled checking for next possible turn problem

    I work at a Bejeweled clone at the moment. You check if you can switch two neighbour items so that a row of three appears. As one of the last features i want to implement a message when there is no turn left, and the game is over. This means i have to check if there is minimum one more valid turn possible.

    So far so good. Problem started with finding out which cases are even possible. This is what i came up with now. Have i forgotten something?



    Green are the pairs that can be extended to a row of minimum three when the correct item with the same colour is around. Orange is the destination place for that.

    Next problem is, how shall i solve this? I tried array and a main loop for X and Y that checks for the cases above. Means the two connected. And the two with gap. And when this gets found i run a nested loop to check all possible places that could fill the orange place. But this doesn`t work for some reason. No clue where my mistake is. Am i even at the right track? Somebody made this before? Any advice?

  2. #2
    Clicker Multimedia Fusion 2SWF Export Module
    Jacob's Avatar
    Join Date
    Jul 2007
    Location
    Second pixel to the right
    Posts
    3,208
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Bejeweled checking for next possible turn problem

    The advanced Game Board Object has features for testing if objects are aligned. I haven't used it, however.

  3. #3
    Forum Moderator Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleSWF Export Module
    Stephen's Avatar
    Join Date
    Aug 2008
    Location
    Montana
    Posts
    4,515
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Re: Bejeweled checking for next possible turn problem

    There is also a Match 3 tutorial by maVado on the October Klikdisc.

    Stephen1980
    _____________________________________________
    Nivram's Examples -Need extensions? Send me a PM.-


  4. #4
    Forum Moderator

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleXNA Export Module
    Burfelt's Avatar
    Join Date
    Jul 2006
    Location
    Denmark
    Posts
    526
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)

    Re: Bejeweled checking for next possible turn problem

    In my thoughts on making this, I thought it would be possible to check for connections by looping the position of an active object left to right and top to bottom. Then simply testing if 3 or more identical objects were hit consecutively and flag these.

    I would have a loop running through all lines horizontally first and then vertically. And in your case it would seem to have to be run diagonally through all lines left-right and right left.

    This all works in my head, but admitted I haven't thought it that much through.

  5. #5
    Clicker Multimedia Fusion 2 DeveloperSWF Export Module
    Tiles's Avatar
    Join Date
    Jun 2006
    Posts
    1,359
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Bejeweled checking for next possible turn problem

    Thanks for the advice guys

    There is also a Match 3 tutorial by maVado on the October Klikdisc.
    No download possible. I get a "Check back in an few days" message.

    AGBO ...
    AGBO is out here. I wasn`t even able to hand my bricks positions over. And i gave up at it then. I had in the same time, that i have spent to tinker around with AGBO, my core engine finished.

    The problem is not so much to detect if three are connected. The game itself is finished, and the check works ok. The problem is to test all possible cases. So that at the end really a "No More Turns Possible" message appears. And how to structure this search to run in optimum speed and performance.

    Okay, i will have a look to make an example file now. And will return in case i am still stuck

  6. #6
    Forum Moderator

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleXNA Export Module
    Burfelt's Avatar
    Join Date
    Jul 2006
    Location
    Denmark
    Posts
    526
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)

    Re: Bejeweled checking for next possible turn problem

    I see I completely missed your question, sorry.

    On another note, what happens if you detect say 6 indentical objects in a row? You diagrams doesn't seem to include this senario?

    If we have a row of objects:
    X X X 0 X X X

    And the "0" is switched to an "X" do you destroy the entire row? This might complicate the whole "valid turn left" check a bit?

  7. #7
    Forum Moderator

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleXNA Export Module
    Burfelt's Avatar
    Join Date
    Jul 2006
    Location
    Denmark
    Posts
    526
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)

    Re: Bejeweled checking for next possible turn problem

    Hmmmmm. Provided that you already figured out how to find the orange location. You can probably spread a value to all the "orange" locations, then run a loop for the number of orange locations.

    That loop could create a detector active object that is 3x3, centered on top the current "orange" location that is equal to loop index.

    Then (while still in loop) detect for overlap of active object whose identity is equal to the current pair you are checking against and that isn't flagged as actually being part of the pair being checked.

    Hope that makes any sense? If you can establish "orange" locations, then this would be a cheap and dirty way of doing it.

  8. #8
    Clicker Multimedia Fusion 2 DeveloperSWF Export Module
    Tiles's Avatar
    Join Date
    Jun 2006
    Posts
    1,359
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Bejeweled checking for next possible turn problem

    Thanks for your thoughts everybody. I appreciate it

    On another note, what happens if you detect say 6 indentical objects in a row? You diagrams doesn't seem to include this senario?

    If we have a row of objects:
    X X X 0 X X X

    And the "0" is switched to an "X" do you destroy the entire row? This might complicate the whole "valid turn left" check a bit?
    Not really. This is one of the gap cases from above. Three or more counts as a row. Can also be more than three

    Okay, i have a somehow proper working example ready. And have posted it in the file archive. I would suggest to go on in this thread there.

    http://www.clickteam.com/epicenter/ubbthreads.php?ubb=showflat&Number=173567#Post1735 67

Similar Threads

  1. Bejeweled clone, check for one more possible turn
    By Tiles in forum File Archive
    Replies: 2
    Last Post: 20th January 2010, 07:38 AM
  2. AGBO problems example - Bejeweled clone
    By Tiles in forum File Archive
    Replies: 6
    Last Post: 18th August 2009, 08:57 PM
  3. do a checking thanks
    By melnet in forum The Games Factory 2 - Technical Support
    Replies: 1
    Last Post: 12th October 2008, 12:05 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •