Adding an accumulative score to a Psychopy game

Hi,

I’m new to PsychoPy, so apologies for my inability to use the correct nomenclature and my general ignorance.

I’m trying to create a game for my MSc thesis. I want to create a accumulating score displayed as text.

Score will accumulate when the player can keep the cursor position (which is acting against a disturbance) in line with a stimulus (a circle) moving horizontally along an axis according to another disturbance. However, if they don’t keep their cursor in line with the stimulus, their score will not increase as rapidly (the larger the distance their cursor is from the moving stimulus, the slower the rate of score increase).

The position of the cursor is cursor.pos, and the position of the reference stimulus is ref.pos.

I want to define the score as outputf.

Beyond this, I have no clue what i’m doing. Is anybody able to help?

Hi @ucjurb1,

Here is an example of what you can do with Builder:

  1. create a shape, mouse, text and code component
  2. Set duration to infinite (blank) for those components
  3. In the code component, start the routine with a new score
  4. in the “Every frame” tab:
    a) update the shape position to move
    b) Check whether the shape contains the mouse
    c) If so, increment score variable by 3, else .05
    d) Update text component to display score, but in a rounded integer so as not to have a rapidly changing
    float as your score

circleScore.psyexp (7.0 KB)