Https://studio.code.org/projects/gamelab/30d226ba-6bba-4b52-adb1-46bc01ac1acf

[Posts in the debugging category need to have the following pieces of information included in order to help other teachers or our moderator team best help you. Feel free to delete everything in brackets before posting your request for debugging help.]

Link to the project or level: Game Lab - Code.org
What I expect to happen: When Lines 56-67. Background change colors when greater than or equal to 5 clickes and the bunny shakes at random clicks.
What actually happens: When eggs are clicked the background changes color at random numbers instead of at 5 or more clicks.
What I’ve tried: I have tried using different options for the if statement: mousePressedover etc. I have moved the backgrounds into different areas of code inside/outside the drawloop to start the program.

This is where a console log statement to track your variables value is very helpful. when I ran the program your variables value goes up to 23. Take a look at why or change your statement to <=

You are partially right, however I suggest making the operator into >=. Additionally the reason why it only shakes at random numbers is because mousePressedOver() actually is more like mouseDown(). Therefore even if you hold it for a second it’ll add multiple numbers. Instead use this for a better way:

if (mouseWentDown("leftButton") && mouseIsOver(egg)) {
 // execute stuff here
}