Hello I had a number of Topics on the subject, but could not figure out from the help how to proceed with the experiment.!
I wrote a very simple code, based on the “Button” component. In result, when you click on the button component with the mouse, more and more pologons are added to each frame.:
begin routine
Polygons =
Each Frame
polygon = visual.ShapeStim(
win=win, name=‘polygon’,
vertices=[[-(0.1, 0.1)[0]/2.0,-(0.1, 0.1)[1]/2.0], [+(0.1, 0.1)[0]/2.0,-(0.1, 0.1)[1]/2.0], [0,(0.1, 0.1)[1]/2.0]],
ori=0.0, pos=(-random()+random(), -random()+random()),
lineWidth=1.0, colorSpace=‘rgb’, lineColor=‘white’, fillColor=‘white’,
opacity=None, depth=0.0, interpolate=True)
and inside the Button component
Polygons.append(polygon)
polygon.setAutoDraw(True)
The result of the code is:
I only have two critical points missing:
- I want the polygons to be added only if they do not overlap (use the overlap command)
I tried used this code, but it does not seem to me that this is the way:
Polygons.append(polygon)
if polygon.overlaps(polygon) == True:
Polygons.pop(polygon)
else:
polygon.setAutoDraw(True)
- No information was recorded about the experiment in the output file, nor the number of clicks, nor the duration of the click, nor the number of polygons added.
I would like to receive guidance on these two questions, thank you very much!