Button to increase score doesn't work properly
in
Programming Questions
•
6 months ago
Hello all,
I am busy to create a button to increase a score, and i ran into the following problem.
I created the following statement to check if the button is pressed:
if(mousePressed && mouseX > xPosScoreSpeler1 && mouseX < xPosScoreSpeler1 + groottePlusKnop && mouseY > yPosScoreSpeler1 && mouseY < yPosScoreSpeler1 + groottePlusKnop){
(its in dutch but the problem lies within if(mousePressed))
The problem i now have is that as long the button is pressed the counter increases like crazy. I couldnt find a mouseClicked/mouseReleased Variable in the reference, only a function, and i dont want to use that function becouse i have multiple screens in my program.
Does anyone have a solution for my problem?
thx in advance.
1