CatNap count the blocks problem

Hello

I made a game like catnap but now i want a func that counts the blocks when you tap it.

So like i can create a reward system when you complete the game destroying 4 blocks you get 2 stars if you can complete the game destroying 2 blocks you get 3 stars something like that. I was experimenting with code so i made a var: " points: Int = 0 " and then in the func where you tapp the block “points = +1” and then i print it out in the log so i can see if it worked and it worked but it does not count the blocks. Every time i destroy a block it says 1. It does not add up.

I hope you understand my text. I would really appreciate your help.

Thank you
With best regards
Mitchkovitch

I guess the questions would have to be: where are you declaring this ‘points’ variable? When you tap the block, is “points = +1” what you’re displaying on screen, or is that the code you’re calling to increase the points variable? (The line of code points = +1 is an assignment, not an increment; if that line is executed, points will always be assigned the value 1. Perhaps you meant points += 1?)

Thank you
It was a stupid mistake , you were right , I had to use “score + = 1” and not “score = +1”

thank you so much for your help!