Thank you so much for creating this forum. I am not familiar with coding and it is difficult to understand. Therefore, I would be greatly grateful if someone could help me in very simple steps.
I am working on creating an experiment using Builder. In the experiment, 60 sentences are individually presented to participants and they are required to judge each sentence. Two things that I wand include in the task using coding that I don’t know how this is done although I have looked at several explanations in the forum. First, after the 20th and 40th sentence , I want participants to take a break for one minute. Second, During the break, I want a countdown clock to appear so that a participant can know how much time is left for the break to end. A photo has been attached. Any help would be very thankful.
In any given routine, there will be a variable called
t, which is the time (in seconds) since the routine began. So to get a measure of how long is left, you just do
[[TOTAL TIME]] - t (where
[[TOTAL TIME]] is how long you want the routine to last).
If you add a Polygon component to the routine, you can set its orientation to be
set each frame, which means it will calculate whatever value is put in each time the screen refreshes. To make it look like a clock, we’d want to make it very long and thin (size
(0.1, 1) for example) and have it be
anchored at the bottom center, meaning this is the point it rotates around.
As orientation is from 0-360, we need to transform the time remaining such that when
t is 0 the orientation is 0 and when
[[TOTAL TIME]] - t is 0, the orientation is 360. So, the value you would put in the orientation field for your Polygon would be:
(t / [[TOTAL TIME]]) * 360
If you want to see this in action, there is a clock face demo in the demos tab in Builder, I also used a similar method when making the clock routine in this Countdown demo: