| Reference | Downloads | Github

Animating the stimulus in online experiment

Hi! I am trying to implement this experiment ( online. Basically the idea is that participant has to track a geometric shape drifting on the screen in random directions. Is there a way to implement this online (or offline for that matter?). I am not very good in JS, so my apologies in advance…

You can set the position of pretty much all stimuli based on a variable and then set that parameter to update on every frame. It’s very easy, right from Builder (once you know how you want define the motion equation/method)

Thank you, got it! Do you know any way to implement constrain, so that the figure doesn’t drift outside the screen?

You can use an if statement to change a variable to the maximum in a limit:

if xPos > 5:
    xPos = 5

(in JS this is):

if (xPos > 5) {
    xPos = 5;