Scoring is driving me crazy

Get help using Construct 2

Post » Sun Oct 13, 2013 3:40 pm

I am building a Match-3 type of game where balls arranged in hexagon-grid are tobe destroyed according to their color. The gameplay is working fine but I can't make the scoring work. I have a text message popping up everytime seven or more balls of the same color is destroyed. But I can't seem to make the scoring work. Any help will be very much appreciated.



In the pic above, the balls with 50% opacity are the ones about to be destroyed.
Things become even more screwy when more than one hexagon of the same color is formed at the same time like in the picture.
B
4
Posts: 13
Reputation: 251

Post » Sun Oct 13, 2013 3:48 pm

Make a global variable 'score' and every time seven or more balls are destroyed -
system add to variable 'score' - whatever the points you want to give.

to display the score in a text
set text to : "score: "&score
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Sun Oct 13, 2013 3:54 pm

Thanks for your reply.
I already have a global variable for "Score". But it doesn't work properly.

As you can see from the pic, 13 red balls are destroyed but 4 hexagons are actually made. So it's only fair that the player should get points for 4x7=28 balls and not 13. And that's where scoring fails to work. sifar2013-10-13 15:59:39
B
4
Posts: 13
Reputation: 251

Post » Mon Oct 14, 2013 7:47 am

@sifar, It looks like you have already got the hexagon identification done, as you are placing a 7 on the middle ball. Have a separate variable "Hex", each time you place a 7, add one to Hex. When you come to make the score add Hex*7 to the score. Will that do it?
B
13
S
4
Posts: 67
Reputation: 1,270

Post » Mon Oct 14, 2013 11:32 am

Thanks for your input AngelEyes.

I did try it. But every time 1 is added to 'Hex' , the score to which 10 is added, keeps increasing indefinitely. I have tried "Trigger Once" but then only the first match is counted and never the subsequent ones.

This has me completely stumped.
B
4
Posts: 13
Reputation: 251

Post » Mon Oct 14, 2013 12:01 pm

This will probably not be resolved without letting someone look at your capx. The problem lies within the way you have your events set up and will probably be easily and quickly solved if we don't have to guess where the issue lies.
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Mon Oct 14, 2013 1:57 pm

You're right LittleStain. So here's the Capx.

https://www.dropbox.com/s/to5z4ip7et7innm/Hexagon1.capx
B
4
Posts: 13
Reputation: 251

Post » Mon Oct 14, 2013 3:50 pm

I didn't find the solution yet, but maybe you will.

everytime a hexagon is made, in the middle of it the number 7 shows up.
So your program seems to know the middle ball of your hexagon.
Couldn't you create a score based on that number 7 or on the balls in the middle of hexagons?
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Mon Oct 14, 2013 4:26 pm

Couldn't you create a score based on that number 7 or on the balls in the middle of hexagons?

I can't seem to. When the Score is added, it just keeps on adding instead of adding only once for each 7.

Is there any way for each 7 to be taken into account but only once?
B
4
Posts: 13
Reputation: 251

Post » Mon Oct 14, 2013 7:57 pm

@sifar, tried to change your capx, but my freebie version wont let me. Your function Find Matches is getting called every tick I think, which also means that your Hex is getting set every tick and hence you add 10 every tick. The problem is you have a wait 2 seconds before destroying the balls, so it just adds up the score. You need to put in some method that once it recognises the hexagon to go, you need to stop it recounting that hexagon until the balls are destroyed.

To test, where you put the seven, add one to the seven variable. I bet it will reach 27.

PS, really cool game. Hope that puts you on the right track.
B
13
S
4
Posts: 67
Reputation: 1,270

Next

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 14 guests