Moving stimuli changing direction

Hi @obeescee, I am not sure what your task is trying to achieve, however you can get the circles to move using Builder, with some polygons as circles and a code component to control the movement.

# Start Experiment
moveSpeed = .025

# Each Frame

# Invert moveSpeed when circle at edge of screen
if polygon.pos[0] >= 1 or polygon.pos[0] <= -1:
    moveSpeed *= -1

if t > 1:
    polygon.pos[0] = polygon.pos[0] + moveSpeed
    polygon_2.pos[0] = polygon_2.pos[0] - moveSpeed
    polygon._needVertexUpdate = True
    polygon_2._needVertexUpdate = True

How does this perform on your machine? Here is the example circles.psyexp (8.6 KB)

1 Like