Visual Stimuli "flashing" in center of screen

I am having an interesting issue in my CPT experiment. In this experiment, the mask includes having a Pokeball move from one corner of the screen toward the center and once reaches the center, a Pokemon appears in its place. This animation works well, however, for about 90% of the trials, the Pokeball image “flashes” or “blinks” after the pokemon appears. I have tried fixing this by adjusting the initial start location of the pokeball, the onset of the pokeball image, and others, but to no avail. All of the code assets can be found at the following link: Sign in · GitLab

Thank you for all of your help :slight_smile:

The link does not work, please make sure your repository is set to be publicly visible (under ‘settings’ in gitlab).

Apologies, Should be publically accessible now

Sorry for the slow response. That is indeed a puzzle, since it looks like the pokeball stimulus is actually not even included in the trial itself. Does this only happen when running online, or does it also happen if you also run it locally?

Thank you so much for the response, I really appreciate you helping me take a look at this. This is only happening online to my knowledge, however, the majority of the development of this project has been done in javascript directly and I am not sure if there is a local .psyexp file that even closely matches the logic in the most recent version. I assume part of the issue might be because I have been developing in the javascript directly instead of using builder → javascript code.

I see. I had to do a bit of digging to find what seems to be the most recent version of the script in the repository (html/CPT_pokemon.js, right?)

Even so I can’t see an obvious reason that it should do this. The only thing I can think of is that there is some slowdown such that the ‘pokeball.setAutoDraw(false)’ doesn’t reliably trigger before the start of the ‘trial’ routine, but that should never happen because there’s a failsafe that should set it to false when the mask routine ends.

One thing you could try, and again this really shouldn’t matter, is in the ‘trialRoutineBegin’ code (line 1220-1284) you could add ‘pokeball.setAutoDraw(false)’ again. I don’t know why it would be necessary but it adds a yet further layer of redundancy to making sure it stops drawing the pokeball. If that fails, then it’s a glitch I really don’t understand that probably has something to do with cacheing or a browser glitch. Does this occur on different browsers? Different computers?

Yes, html/CPT_pokemon.js is the correct file.

I will take a look at the trialRoutineBegin code and make the changes, hopefully, that works.

To answer your other question, yes this happens across browsers (Safari and Google Chrome) and Operating Systems tested (MacOS, Windows, and Linux).

Either way, I really appreciate your help!!!