Hello, I have been adapting the BART that appears across Pavlovia. I have noticed that between each trial, after banking, that an after image of the balloon flickers on the screen briefly. Is there a way that I can remove this?
I have tried in Chrome and Firefox in case it’s a browser issue, but it’s the same behaviour in both.
I have linked the base version of the experiment as found from Pavlovia
When a component is set Each Frame then it isn’t updated until the end of the first frame, which means that it spends one frame at the same value as the previous presentation of the same component.
The solution is to set the component to a default value in Begin Routine (or possibly End Routine of the previous run). This is one reason that I usually make changes to components in Each Frame code tabs rather than in the components themselves. If the component is updated Each Repeat then it will start each run with the defaul value.
I’ve just come back to this and found a couple of issues that I can’t sort out.
Firstly, the starting balloon always has a value of £0.05, it’s almost as is it’s recording a previous press and storing it to increase nPumps even before the routine with the code for it has started.
The final score doesn’t display correctly. It is always £0
I have managed to fix the start value always being £0.05.
I have added
event.clearEvents()
to the begin routine tab of the balloon size. That has sorted the issue as I believe it was saving the space bar from a previous routine.
As for the final score display. It turns out it isn’t that it’s always £0, it’s that it isn’t displaying as a 2 decimal point float, even though you have coded in the “£%2.f” . I managed to sort it by moving the formatting into it’s own section.
So from
scoreText=u"Well done! You banked a total of\n£%2.f" % bankedEarnings
to
scoreText="Well done! You banked a total of\n£" + "%.2f" %bankedEarnings
this seems to have fixed those issues for the offline version
Edit* I have tested this online as well, and the “event.clearEvents()” JS equivalent works as well, so it now works fine online as well.
If you can, please send a merge request back to the original no I can incorporate your fixes. Personally, I would prefer to use formatting code that can be auto translated into JS, but I decided not to touch that aspect of the demo.