I’ve created a demo experiment where participants are required to memorise a pattern of black and white squares, and then click on the squares in a blank grid to reproduce the pattern. I want participants to be able to change their response if they make a mistake, and when they’re happy with it continue to the next trial. I’ve got it working with the following code component in the ‘Each Frame’ tab, to change squares from white-black and black-white:
for square in [R1, R2, R3, R4]: # Response when a square has not already been clicked: if mouse.isPressedIn(square) and square.fillColor == 'white': square.fillColor = 'black' #Response when a square has already been clicked: else: if mouse.isPressedIn(square) and square.fillColor == 'black': square.fillColor = 'white'
However the colour doesn’t always change instantly but instead ‘flickers’ and sometimes takes several clicks to finally change. I think this may be to do with the timing of the click and the screen refresh rate but I’m not sure if there is a work-around. Can anyone help?