Here How I detect match

Get help using Construct 2

Post » Mon Jul 27, 2015 6:14 pm

I think I need to share a simple approach to detect match on screen, since I'm working on match-3 puzzle.

Image
source file:
https://dl.dropboxusercontent.com/u/659 ... tch_3.capx

Really simple but to make it work we need to modify collision polygon shape as showed up below:
Image

Say Your sprite size is 64 pixel, So You need to reduce polygon size by 2 from each edge or equal 60 pixel.You get the idea each adjacent sprite will have a gap 4 pixel between collision shape.
ImageImage
B
108
S
49
G
23
Posts: 783
Reputation: 22,611

Post » Tue Jul 28, 2015 6:46 am

If you have a look at my blog http://myconstruct2dev.blogspot.co.uk/2 ... tch-3.html there is an open source match 3 game. The code in the event file "matches" should work for a "match on screen" approach (e.g. you don't have an array or tilemap or string which describes your grid of colours to match), though it is all functions.
My tutorial through development blog is at http://myconstruct2dev.blogspot.co.uk/
B
12
S
3
Posts: 221
Reputation: 1,328

Post » Tue Jul 28, 2015 3:56 pm

@rexrainbow has a few plugins that might be of use:
plugin: plugin-matcher_t74348?&hilit=rex+matcher
demo: bejeweled-plugins-demo_t78318?&hilit=rex+matcher
https://www.ravenheart.ca/home
I don't check the forums much anymore, but I will receive an email for PMs.

"Someone once told me I bite off more than I can chew...

I told them I would rather choke on greatness than nibble on mediocrity."
B
22
S
6
G
1
Posts: 1,418
Reputation: 4,830

Post » Tue Jul 28, 2015 4:26 pm

@gumshoe2029
Neither of the first 2 posts are asking for how to do a match - they are showing how to do it without having to load half a dozen non-standard plugins.
If your vision so exceeds your ability, then look to something closer.
Moderator
B
134
S
30
G
86
Posts: 5,413
Reputation: 59,510

Post » Tue Jul 28, 2015 6:59 pm

Update version: https://dl.dropboxusercontent.com/u/659 ... ch_3a.capx
Intersection match turn into combo item.
Image

@paulscottrobson
Yes me too, I have tendency to avoiding use an array for a reason. I read nice article too: http://www.raywenderlich.com/66915/how- ... 2#comments

Thanks @gumshoe2029 I knew rex has alot of usefull plugins. I prefer to build the system from scratch to understand what is under the hood.

Well I have already make the swap & match mechanic work (even shuffle too). This method simply just an auto-match to check possible combo after crushing occur or at initial setup.But feel free to give any suggestions
As suggested by @zenox98 in previous thread, I use R0J0 flood-fill method to detect match by swap.
ImageImage
B
108
S
49
G
23
Posts: 783
Reputation: 22,611

Post » Wed Jul 29, 2015 9:16 pm

alextro wrote:Thanks @gumshoe2029 I knew rex has alot of usefull plugins. I prefer to build the system from scratch to understand what is under the hood.


This is always a good method. Especially if you have the time to do it.
https://www.ravenheart.ca/home
I don't check the forums much anymore, but I will receive an email for PMs.

"Someone once told me I bite off more than I can chew...

I told them I would rather choke on greatness than nibble on mediocrity."
B
22
S
6
G
1
Posts: 1,418
Reputation: 4,830

Post » Wed Jul 29, 2015 10:03 pm

Now it is more rich with 4 & 5 combo items!
https://www.dropbox.com/s/fw5yl7lis041f ... .capx?dl=0

Image
ImageImage
B
108
S
49
G
23
Posts: 783
Reputation: 22,611


Return to How do I....?

Who is online

Users browsing this forum: brunopalermo and 23 guests