Match-3 mechanics

This forum is currently in read-only mode.
  • Hello.

    Everybody probably played casual games genre of match-3. For example: Cradle of Rome, Treasures of Montezuma. There is a field in the game in which about 64 squares (8 horizontal and 8 vertical), principle of the game - to collect the same pieces in a series of 3 or more moving their places.

    Tell me please how to create a similar game mechanics in Construct?

    Is there any examples? <img src="http://i987.photobucket.com/albums/ae352/constructgame/fpp.gif">

  • Just recently this topic came up again. So this is the thread for you: Puzzle Help

  • Does anybody know how to make this using Array object?

  • The array part wouldn't be too hard, but you kinda need to know all the rules first.

    Like piece movement, do they slide, or do you pick them up, etc. Then there's the rules for deciding if something is adjacent to another.

    BTW the card game object might work for this as well.

  • Does anybody know how to make this using Array object?

    Actually I'm making use of an Array in my puzzle engine. It's just for the playfield creation, definition of playfield size and placement of new spawning blocks. It has nothing to do with the matching of 3 or more blocks (well it's used to pick rows/columns in the matching events too). I thought about doing it all with an Array, but didn't go through with it, since the approach I already had was just so easy.

    BTW the card game object might work for this as well.

    For real? I never thought about that possibility...

  • BTW the card game object might work for this as well.

    I've tried it, but I can't understand how to make match-3 mechanics using this object.

    Could you make a simple example for me? <img src="http://i987.photobucket.com/albums/ae352/constructgame/ev.gif">

    I thought about doing it all with an Array, but didn't go through with it, since the approach I already had was just so easy.

    I dowloaded your example (here)... But I would like to make mechanics like in The Treasures Of Montezuma game (i.e. possibility to select pieces with cursor, move them from the left to the right and from the right to the left, and if there is 3 or more pieces together they must be destroyed, etc).

  • I dowloaded your example (here)... But I would like to make mechanics like in The Treasures Of Montezuma game (i.e. possibility to select pieces with cursor, move them from the left to the right and from the right to the left, and if there is 3 or more pieces together they must be destroyed, etc).

    Yes well, this is just a little editing I did for mattdubs right there. No use of an array to be found I'm sry. I don't know exactly about the Montezuma game, but from your description my Crypta engine works pretty much like that. You do select stuff with the mouse and can switch horizontally and vertically. Destroying works of course... plus spawning of new blocks. All of that.

    Apart from the array usage, all information is there in mattdubs' thread in order to make a working matching/destroying engine. Will take a little effort to read into it and check out the various caps provided. If you really really want to see it I guess I could share a basic version of my puzzle engine.

  • PixelRebirth, you're very very cool!!! <img src="http://i987.photobucket.com/albums/ae352/constructgame/ew.gif">

    I've just visited your wordpress blog and downloaded the Crypta game! It's Awesome!

    Great gameplay and looks like really commercial game!

    If it's possible could you explain me how did you make a such thing or may be show an example?!

    I want the same mechanics like in your Crypta game! <img src="http://i987.photobucket.com/albums/ae352/constructgame/df.gif">

    By the way I've already made design of pieces, but how to make the game mechanics I don't know...

  • PixelRebirth, you're very very cool!!! Image

    I've just visited your wordpress blog and downloaded the Crypta game! It's Awesome!

    Great gameplay and looks like really commercial game!

    Too much praise there, just too much. Hehe.

    If it's possible could you explain me how did you make a such thing or may be show an example?!

    I want the same mechanics like in your Crypta game! Image

    Of course I'd be happy to help you setting up your own puzzle game. Would you mind sharing a cap of your current progress (either openly or PM)? That would be a good starting point to do some of my "amazing" explaining.

    By the way I've already made design of pieces, but how to make the game mechanics I don't know...

    <img src="http://i35.tinypic.com/o52haq_th.jpg">

    Those are beautiful! That'll be a cute puzzler!

  • [quote:2rz9k7m7]I've tried it, but I can't understand how to make match-3 mechanics using this object.

    Could you make a simple example for me?

    Ok never mind then. I was thinking that it might make things easier for picking. But really once you understand an array you don't need it.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Of course I'd be happy to help you setting up your own puzzle game. Would you mind sharing a cap of your current progress (either openly or PM)? That would be a good starting point to do some of my "amazing" explaining.

    I think this topic is useful for many people so I suggest to share cap files right here.

    Here is my project:

    'cap' file

    'exe' file

    There are simple pieces in the game just for example, because original pieces is in the process of designing. It remains to realize only two things: destroying pieces when the same three together, and resp. spawning of new blocks.

    If you know how to make this please help me.

    P.S. PixelRebirth, I very much like your game, if you could to share your mechanics I would be very grateful... <img src="http://i987.photobucket.com/albums/ae352/constructgame/ah.gif">

  • Okay MJ, thanks for sharing!

    It remains to realize only two things: destroying pieces when the same three together, and resp. spawning of new blocks.

    Actually you would still need to set up the playfield generation in a way that there wouldn't be 3 matched at the beginning. Unless you want that for some reason.

    If you know how to make this please help me.

    I do know. I can't simply explain it in a few phrases I'm afraid. Will take a little more than that.

    For starters: Add an array, use X and Y size of the array as the dimensions of your playfield.

    In your cap it's 8x8 for example. Now don't put any blocks in your layout at the beginning, but create them on startup for each element of the array. For positioning you could use any object as reference point. Now loop through the blocks X over Y ascending and check always for the blocks which are positioned one and two units left and above the current block. If for one direction both match you'll randomize the block until both don't with a while loop.

    That would be the beginning generally speaking... but as I mentioned typing everything out like that is very theoretical and I'm not a novelist either.

    So what I will do is either implement it in your cap or more likely create a basic commented example of my engine. Either way, it'll take a bit of time. I'll see to it over the weekend. Have a little patience.

  • id think using a simple collision detection mechanic with offset collisions tests for the part you move would work.

  • So what I will do is either implement it in your cap or more likely create a basic commented example of my engine. Either way, it'll take a bit of time. I'll see to it over the weekend. Have a little patience.

    I do not really understand how to work with Array, so I better wait for your example.

  • Well, you have to take chain and more-than-3 elimination into account. The premise is simple, but execution - especially smooth and failproof - can be a little tricky.

    It can be done with simple condition checking (if a bit slower than array):

    For each block on the field, check if it has any neighboring blocks of the same color. If it finds one, check that block's next neighbor - that is in the same direction. If there is one, mark for demolition. Do this for EACH block on the field.

    Then, once checks are done, start the demolition. Whee! Fireworks! After that, collapse the pieces or whatever and repeat the check, until there are no blocks that meet the condition, then allow the player's input.

    This method has the advantage of streamlining; you can use fancy animations and stuff!

    Pseudo code:

    +For each block

    • Are any of its four neighbors of the same color?
    • Check that block's adjacent block, that is in the same direction

    > Mark these blocks for demolition

    When done checking all blocks, DEMOLISH! Then re-check all blocks until NONE are marked for demolition and wait for player's move.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)