I am designing a game, but I am having some trouble implementing a decent score system. Basically I have nodes with two different possible characteristics: color and shape. Since the player click from node to node, I want to award more points to the players which hit the same shape, same color or both, like: (SAME SHAPE x 3! AWESOME!, SAME SHAPE AND COLOR x 5! ARE YOU A WIZARD?!).

However I am having a lot of trouble implementing this. Can someone point me in the right direction or show me algorithms that can do this?


1 Answer 1


To do this, your game has to keep track of the previous nodes clicked by the player, and check the sequence for the combos that you care about.

The usual approach is to just keep adding things to your record of what the player has done until they break the combo chain (however your game defines that), at which point you clear the record and start over again, building up a new chain of actions.

  • \$\begingroup\$ My question was how to do exactly that? Could you describe a quick example? \$\endgroup\$
    – NewbGamer
    Commented Dec 22, 2012 at 0:19
  • \$\begingroup\$ @NewbGamer imagine you have a List/Vector. On click, just append the clicked item to it. When the newest item doesn't match the previous item, the combo is broken, and you're done; clear it out. \$\endgroup\$
    – ashes999
    Commented Dec 22, 2012 at 1:51

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .