# Color click game

**URL:** <https://discourse.processing.org/t/color-click-game/25207>\
**Category:** Coding Questions\
**Tags:** homework\
**Created:** [November 5, 2020, 3:28pm UTC](https://discourse.processing.org/t/color-click-game/25207 "2020-11-05T15:28:45Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jeremy](https://avatars.discourse-cdn.com/v4/letter/j/82dd89/32.png) [@jeremy](https://discourse.processing.org/u/jeremy)\
**Post date:** [November 5, 2020, 3:28pm UTC](https://discourse.processing.org/t/color-click-game/25207/1 "2020-11-05T15:28:45Z")

</div>

I want to let it wrong when the mouse clicked wrong place  
so I use the if-else , mouse X and Y in right range and clicked it get score,  
But now I clicked the first color ,it input twice clicked , then, it appear the incorrect clicked.

void mouseClicked() {  
if (score==0) {  
if (mouseX \<= 365 && mouseX \>= 235 && mouseY \<= 365 && mouseY \>= 235) {  
score+=10;  
}  
else{  
wrong();  
}  
}

---

<div class="post-metadata">

**Author:** ![Chrisir](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/chrisir/32/45_2.png) [@Chrisir](https://discourse.processing.org/u/Chrisir)\
**Post date:** [November 5, 2020, 3:41pm UTC](https://discourse.processing.org/t/color-click-game/25207/2 "2020-11-05T15:41:14Z")

</div>

Hello,

I don’t fully get what you mean, but why do you have this: `if (score==0) {`
