Hey guys,
I’m trying to build a neurological experiment, in which the participants of the study need to move a joystick to make a cursor hit a target to the left or right.
At the moment the participants can see the cursor at the updated position the whole time throughout each trial.
We want to change that, so that the Cursor moves with the Joystick position input just for a certain radius and then moves on its own along a certain Vector.
I used this piece of Code to just make an Object move in 2D space along the x or y axis. Now, how can I integrate a Vector into this Code? So that the Stimulus (in this case a circle, we want to change that later to our Code and use the cursor) is not moving just along x or y axis but in all 2D space along a Vector? I would love to get some insights form you.
This is the Code:
import os
from psychopy import visual, event, core
win = visual.Window(units = 'pix', color = 'black') # Set the window
x = 0 # initial positions
y = 0
# create just once, no need to specify a position yet:
circle = visual.Circle(win, radius = 10, fillColor= 'yellow')
while True: # draw moving stimulus
x -= 2 # make circle constantly move left(here i want to use a Vector)
circle.pos = [x, y] # directly update both x *and* y
circle.draw()
win.flip() # make the drawn things visible
win.close()
core.quit()