We are about to switch to a new forum software. Until then we have removed the registration on this forum.
I would like to find a method so that when you press the mouse button and release it, it will add a score of 1, like the cookie clicker type game. The challenge I have is that when I try this with a rectangle, press the mouse button, the score is continual and the score goes up rapidly each time you press it. Here is the example code:
def setup(): global score size(200, 200) fill(0) background(255) # white textSize(32) score=0 def draw(): global score background(255) # white text(score,110, 190) text("Score:", 10, 190) if (mouseX >75) and (mouseX < 125) and (mouseY > 25) and (mouseY < 125): fill(255,0,0) rect(75,25,50,100) if mousePressed : fill(1,1,255) rect(75,25,50,100) text("pressed", 40, 160) score=score+1 else: fill(0) rect(75,25,50,100)