Scoring is driving me crazy

0 favourites
  • 12 posts
From the Asset Store
Create the right kind of drama with Film Scoring Tools sound library!
  • 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.

    <img src="http://i43.tinypic.com/152deno.jpg" border="0" />

    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.

  • 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

  • Thanks for your reply. <img src="smileys/smiley1.gif" border="0" align="middle" />

    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.

  • 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?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 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. <img src="smileys/smiley5.gif" border="0" align="middle" />

  • 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.

  • You're right LittleStain. So here's the Capx. <img src="smileys/smiley1.gif" border="0" align="middle" />

    dropbox.com/s/to5z4ip7et7innm/Hexagon1.capx

  • 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?

  • 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?

  • 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.

  • really cool game.

    Thanks. <img src="smileys/smiley9.gif" border="0" align="middle" />

    And thanks again for taking an interest and helping out. I am trying a few new things. Let's see how that goes.

  • Cant download the Capx so couldn't play

    Have you used something like

    Every Tick

        For each sprite

        Check condition

            Add to score

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