I am new to PsychoPy and am still getting comfortable with it. I have a black circle surrounded by a hollow ring (a ball-in-hoop situation) - the ball is supposed to move, and participants should guide the ring to make sure it always surrounds the ball, and the trial will end if participants lag and the edge of the ring touches the ball at any point.
Right now I have my simple script:
#PSYCHOPY SETUP img_dir = 'images' win = visual.Window( size=[1200, 700], units="pix", fullscr=False ) circle = visual.ImageStim( win=win, image=path.join(img_dir, "circle.png"), units="pix" ) ring = visual.ImageStim( win=win, image=path.join(img_dir, "ring.png"), units="pix" ) ring.size = np.round(ring.size * 0.75) #LOOP waitingForSpace = True #draw the stimuli and update the window while waitingForSpace: #this creates a never-ending loop scan_codes, _, _ = wp.read_full_buffer() if HID_CODE_SPACE in scan_codes: waitingForSpace = False print(circle.overlaps(ring)) print(ring.overlaps(circle)) circle.draw() star.draw() win.flip()
(please ignore the wp bits, that is regarding our weird keyboard). The print statements above are pumping out
Trues. Is it possible to set this up so that the script only cares about the non-transparent edge of the ring? Am I asking too much?
Any guidance would be greatly appreciated!