if pygame rect(windowwidth settingsbuttonimage get_width() windowheight settingsbuttonimage get_height() settingsbuttonimage get_width() settingsbuttonimage get_height()collidepoint(mousexmousey) resetgame showsettingsscreen(clicked on settings button elif pygame rect(windowwidth resetbuttonimage get_width() windowheight settingsbuttonimage get_height(resetbuttonimage get_height() resetbuttonimage get_width() resetbuttonimage get_height()collidepoint(mousexmousey) resetgame true clicked on reset button else check if palette button was clicked paletteclicked getcolorofpaletteat(mousexmousey if paletteclicked !none and paletteclicked !lastpaletteclicked palette button was clicked that is different from the last palette button clicked (this check prevents the player from accidentally clicking the same palette twice lastpaletteclicked paletteclicked floodanimation(mainboardpaletteclicked life - resetgame false if haswon(mainboard) for in range( )flash border times flashborderanimation(whitemainboard resetgame true pygame time wait( pause so the player can bask in victory elif life = life is zeroso player has lost drawlifemeter( pygame display update( pygame time wait( for in range( ) flashborderanimation(blackmainboard resetgame true email questions to the authoral@inventwithpython com