Commit da800a32 authored by Rebecca's avatar Rebecca

_

parent e8006870
......@@ -195,7 +195,7 @@ function experimentInit() {
ori: 0.0, pos: [0, 0],
lineWidth: 1.0, lineColor: new util.Color('white'),
fillColor: new util.Color('white'),
opacity: undefined, depth: -2, interpolate: true,
opacity: undefined, depth: -3, interpolate: true,
});
// Create some handy timers
......@@ -783,6 +783,12 @@ function tracking_trialRoutineEachFrame(snapshot) {
)
);
if (polygon.contains(tracking_square)) {
thisCol = "red";
} else {
thisCol = "white";
}
// *polygon* updates
if (t >= 0.0 && polygon.status === PsychoJS.Status.NOT_STARTED) {
......@@ -793,12 +799,10 @@ function tracking_trialRoutineEachFrame(snapshot) {
polygon.setAutoDraw(true);
}
if (polygon.contains(tracking_square)) {
thisCol = "red";
} else {
thisCol = "white";
}
if (polygon.status === PsychoJS.Status.STARTED){ // only update if being drawn
polygon.setFillColor(new util.Color(thisCol), false);
}
// check for quit (typically the Esc key)
if (psychoJS.experiment.experimentEnded || psychoJS.eventManager.getKeys({keyList:['escape']}).length > 0) {
return quitPsychoJS('The [Escape] key was pressed. Goodbye!', false);
......
......@@ -206,7 +206,7 @@ function experimentInit() {
ori: 0.0, pos: [0, 0],
lineWidth: 1.0, lineColor: new util.Color('white'),
fillColor: new util.Color('white'),
opacity: undefined, depth: -2, interpolate: true,
opacity: undefined, depth: -3, interpolate: true,
});
// Create some handy timers
......@@ -788,6 +788,12 @@ function tracking_trialRoutineEachFrame(snapshot) {
)
);
if (polygon.contains(tracking_square)) {
thisCol = "red";
} else {
thisCol = "white";
}
// *polygon* updates
if (t >= 0.0 && polygon.status === PsychoJS.Status.NOT_STARTED) {
......@@ -798,12 +804,10 @@ function tracking_trialRoutineEachFrame(snapshot) {
polygon.setAutoDraw(true);
}
if (polygon.contains(tracking_square)) {
thisCol = "red";
} else {
thisCol = "white";
}
if (polygon.status === PsychoJS.Status.STARTED){ // only update if being drawn
polygon.setFillColor(new util.Color(thisCol), false);
}
// check for quit (typically the Esc key)
if (psychoJS.experiment.experimentEnded || psychoJS.eventManager.getKeys({keyList:['escape']}).length > 0) {
return quitPsychoJS('The [Escape] key was pressed. Goodbye!', false);
......
......@@ -275,12 +275,29 @@
<Param name="disabled" updates="None" val="False" valType="bool"/>
<Param name="name" updates="None" val="tracking_code" valType="code"/>
</CodeComponent>
<CodeComponent name="checkTarget">
<Param name="Before Experiment" updates="constant" val="" valType="extendedCode"/>
<Param name="Before JS Experiment" updates="constant" val="" valType="extendedCode"/>
<Param name="Begin Experiment" updates="constant" val="" valType="extendedCode"/>
<Param name="Begin JS Experiment" updates="constant" val="" valType="extendedCode"/>
<Param name="Begin JS Routine" updates="constant" val="" valType="extendedCode"/>
<Param name="Begin Routine" updates="constant" val="" valType="extendedCode"/>
<Param name="Code Type" updates="None" val="Auto-&gt;JS" valType="str"/>
<Param name="Each Frame" updates="constant" val="if polygon.contains(tracking_square):&amp;#10; thisCol = 'red'&amp;#10; #continueRoutine = False&amp;#10;else:&amp;#10; thisCol = 'white'" valType="extendedCode"/>
<Param name="Each JS Frame" updates="constant" val="if (polygon.contains(tracking_square)) {&amp;#10; thisCol = &quot;red&quot;;&amp;#10;} else {&amp;#10; thisCol = &quot;white&quot;;&amp;#10;}&amp;#10;" valType="extendedCode"/>
<Param name="End Experiment" updates="constant" val="" valType="extendedCode"/>
<Param name="End JS Experiment" updates="constant" val="" valType="extendedCode"/>
<Param name="End JS Routine" updates="constant" val="" valType="extendedCode"/>
<Param name="End Routine" updates="constant" val="" valType="extendedCode"/>
<Param name="disabled" updates="None" val="False" valType="bool"/>
<Param name="name" updates="None" val="checkTarget" valType="code"/>
</CodeComponent>
<PolygonComponent name="polygon">
<Param name="colorSpace" updates="constant" val="rgb" valType="str"/>
<Param name="contrast" updates="constant" val="1" valType="num"/>
<Param name="disabled" updates="None" val="False" valType="bool"/>
<Param name="durationEstim" updates="None" val="" valType="num"/>
<Param name="fillColor" updates="constant" val="white" valType="color"/>
<Param name="fillColor" updates="set every frame" val="$thisCol" valType="color"/>
<Param name="interpolate" updates="constant" val="linear" valType="str"/>
<Param name="lineColor" updates="constant" val="white" valType="color"/>
<Param name="lineWidth" updates="constant" val="1" valType="num"/>
......@@ -300,23 +317,6 @@
<Param name="syncScreenRefresh" updates="None" val="True" valType="bool"/>
<Param name="units" updates="None" val="from exp settings" valType="str"/>
</PolygonComponent>
<CodeComponent name="checkTarget">
<Param name="Before Experiment" updates="constant" val="" valType="extendedCode"/>
<Param name="Before JS Experiment" updates="constant" val="" valType="extendedCode"/>
<Param name="Begin Experiment" updates="constant" val="" valType="extendedCode"/>
<Param name="Begin JS Experiment" updates="constant" val="" valType="extendedCode"/>
<Param name="Begin JS Routine" updates="constant" val="" valType="extendedCode"/>
<Param name="Begin Routine" updates="constant" val="" valType="extendedCode"/>
<Param name="Code Type" updates="None" val="Auto-&gt;JS" valType="str"/>
<Param name="Each Frame" updates="constant" val="if polygon.contains(tracking_square):&amp;#10; thisCol = 'red'&amp;#10; #continueRoutine = False&amp;#10;else:&amp;#10; thisCol = 'white'" valType="extendedCode"/>
<Param name="Each JS Frame" updates="constant" val="if (polygon.contains(tracking_square)) {&amp;#10; thisCol = &quot;red&quot;;&amp;#10;} else {&amp;#10; thisCol = &quot;white&quot;;&amp;#10;}&amp;#10;" valType="extendedCode"/>
<Param name="End Experiment" updates="constant" val="" valType="extendedCode"/>
<Param name="End JS Experiment" updates="constant" val="" valType="extendedCode"/>
<Param name="End JS Routine" updates="constant" val="" valType="extendedCode"/>
<Param name="End Routine" updates="constant" val="" valType="extendedCode"/>
<Param name="disabled" updates="None" val="False" valType="bool"/>
<Param name="name" updates="None" val="checkTarget" valType="code"/>
</CodeComponent>
</Routine>
</Routines>
<Flow>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment