diff --git a/lib/display.qml b/lib/display.qml index 3261861d9aa6dbbaca7b90190026042f8c5eb79f..477ad3f11e5a5a3f18846aaa289724796c897a01 100644 --- a/lib/display.qml +++ b/lib/display.qml @@ -18,7 +18,7 @@ TXTWindow { enabled: true checked: true x: 60 - y: 171 + y: 178 width: 100 height: 40 } @@ -28,7 +28,7 @@ TXTWindow { font.pixelSize: 16 elide: Text.ElideRight x: 60 - y: 70 + y: 20 width: 179 height: 40 } @@ -38,7 +38,7 @@ TXTWindow { font.pixelSize: 16 elide: Text.ElideRight x: 60 - y: 120 + y: 80 width: 180 height: 40 } @@ -48,7 +48,7 @@ TXTWindow { font.pixelSize: 16 elide: Text.ElideRight x: 20 - y: 70 + y: 20 width: 40 height: 40 } @@ -58,28 +58,18 @@ TXTWindow { font.pixelSize: 16 elide: Text.ElideRight x: 20 - y: 120 - width: 40 - height: 40 - } - TXTLabel { - id: txt_label_counters_ - text: "C1...4" - font.pixelSize: 16 - elide: Text.ElideRight - x: 20 - y: 20 + y: 80 width: 40 height: 40 } TXTLabel { - id: txt_label_counters + id: txt_label_goal_x text: "-" font.pixelSize: 16 elide: Text.ElideRight x: 60 - y: 20 - width: 100 + y: 120 + width: 180 height: 40 } } diff --git a/lib/display.xml b/lib/display.xml index 10a85930e4dcf456eb88079fd790833bb92a9f08..503a00da799e0faf73aa49e84651de3f0e989b20 100644 --- a/lib/display.xml +++ b/lib/display.xml @@ -1 +1 @@ -<xml type="display" version="2"><item id="4" class="TXTSwitch"><name>txt_switch_active</name><enabled>true</enabled><checked>true</checked><text>START</text><geometry><x>60</x><y>171</y><width>100</width><height>40</height></geometry></item><item id="5" class="TXTLabel"><name>txt_label_ball</name><text>-</text><geometry><x>60</x><y>70</y><width>179</width><height>40</height></geometry></item><item id="6" class="TXTLabel"><name>txt_label_goal</name><text>-</text><geometry><x>60</x><y>120</y><width>180</width><height>40</height></geometry></item><item id="7" class="TXTLabel"><name>txt_label_ball_</name><text>ball</text><geometry><x>20</x><y>70</y><width>40</width><height>40</height></geometry></item><item id="8" class="TXTLabel"><name>txt_label_goal_</name><text>goal</text><geometry><x>20</x><y>120</y><width>40</width><height>40</height></geometry></item><item id="9" class="TXTLabel"><name>txt_label_counters_</name><text>C1...4</text><geometry><x>20</x><y>20</y><width>40</width><height>40</height></geometry></item><item id="10" class="TXTLabel"><name>txt_label_counters</name><text>-</text><geometry><x>60</x><y>20</y><width>100</width><height>40</height></geometry></item></xml> \ No newline at end of file +<xml type="display" version="2"><item id="4" class="TXTSwitch"><name>txt_switch_active</name><enabled>true</enabled><checked>true</checked><text>START</text><geometry><x>60</x><y>178</y><width>100</width><height>40</height></geometry></item><item id="5" class="TXTLabel"><name>txt_label_ball</name><text>-</text><geometry><x>60</x><y>20</y><width>179</width><height>40</height></geometry></item><item id="6" class="TXTLabel"><name>txt_label_goal</name><text>-</text><geometry><x>60</x><y>80</y><width>180</width><height>40</height></geometry></item><item id="7" class="TXTLabel"><name>txt_label_ball_</name><text>ball</text><geometry><x>20</x><y>20</y><width>40</width><height>40</height></geometry></item><item id="8" class="TXTLabel"><name>txt_label_goal_</name><text>goal</text><geometry><x>20</x><y>80</y><width>40</width><height>40</height></geometry></item><item id="10" class="TXTLabel"><name>txt_label_goal_x</name><text>-</text><geometry><x>60</x><y>120</y><width>180</width><height>40</height></geometry></item></xml> \ No newline at end of file diff --git a/omniwheels_x4_soccer_goal.blockly b/omniwheels_x4_soccer_goal.blockly index e2090dccf88c969cfe77ba6858241b8882bdfd4c..0171ba07333129f8bb680f1c1f43559860ddc2e6 100644 --- a/omniwheels_x4_soccer_goal.blockly +++ b/omniwheels_x4_soccer_goal.blockly @@ -14,7 +14,6 @@ <variable id="S4.mduNQC(va3iR{oSdB">posx_ball</variable> <variable id="=2ARo+;2DS07SU~j29Fk">posx_goal_left</variable> <variable id="7Tp~7_.qfmJN0SR]5p}F">posx_goal_right</variable> - <variable id="5@U(%o_ghQ1;jiB#odH8">counters</variable> <variable id="Ym/+Qo0YZe25;%N1d!*f">x_min</variable> <variable id="{]]L-TSC^#XtGnVinxf[">posx_goal_both</variable> <variable id="q#H`+Gwt~43Dh@fu;G-D">posy_ball</variable> @@ -160,1058 +159,1023 @@ </block> </value> <next> - <block type="variables_set" id="^^;w:J4Fa?h,#*%To;{+"> - <field name="VAR" id="5@U(%o_ghQ1;jiB#odH8">counters</field> + <block type="variables_set" id="PY^XT?g46JMYP[0)HO!l"> + <field name="VAR" id="S4.mduNQC(va3iR{oSdB">posx_ball</field> <value name="VALUE"> - <block type="lists_create_with" id="1k[v{tojVArtdZ^%5v;1"> - <mutation items="4"/> - <value name="ADD0"> - <block type="counter_get_value" id="GohWJgM]B+R*n;%2J2t["> - <field name="instance_name">TXT_M_C1_motor_step_counter</field> - </block> - </value> - <value name="ADD1"> - <block type="counter_get_value" id="Bb1N_HOP|)`|I9^$Ctm?"> - <field name="instance_name">TXT_M_C2_motor_step_counter</field> - </block> - </value> - <value name="ADD2"> - <block type="counter_get_value" id="ugC,Ex(62_HcLx`w;(}s"> - <field name="instance_name">TXT_M_C3_motor_step_counter</field> - </block> - </value> - <value name="ADD3"> - <block type="counter_get_value" id="0({ry;ZO6]g*8c(EP^h$"> - <field name="instance_name">TXT_M_C4_motor_step_counter</field> - </block> - </value> - </block> + <block type="logic_null" id="^h(n6DKLT?~XLRAo4CRP"/> </value> <next> - <block type="variables_set" id="PY^XT?g46JMYP[0)HO!l"> - <field name="VAR" id="S4.mduNQC(va3iR{oSdB">posx_ball</field> + <block type="variables_set" id="aF_J-4Iq4Jy=)dS.]:62"> + <field name="VAR" id="q#H`+Gwt~43Dh@fu;G-D">posy_ball</field> <value name="VALUE"> - <block type="logic_null" id="^h(n6DKLT?~XLRAo4CRP"/> + <block type="logic_null" id="~`*jJ8l2,?]ICIb*0btf"/> </value> <next> - <block type="variables_set" id="aF_J-4Iq4Jy=)dS.]:62"> - <field name="VAR" id="q#H`+Gwt~43Dh@fu;G-D">posy_ball</field> + <block type="variables_set" id="Vyrr#z=fQDk#C,Ymx5FJ"> + <field name="VAR" id="v3eHF0atAL+ouaa{W$=m">ts_ball</field> <value name="VALUE"> - <block type="logic_null" id="~`*jJ8l2,?]ICIb*0btf"/> + <block type="util_runtime_measurement" id="O!p9@+{cCQ5ov3?1cB9F"> + <field name="TIME">MILLISECOND</field> + </block> </value> <next> - <block type="variables_set" id="Vyrr#z=fQDk#C,Ymx5FJ"> - <field name="VAR" id="v3eHF0atAL+ouaa{W$=m">ts_ball</field> + <block type="variables_set" id=",#}P8.}lYXpT3LT`P:?w"> + <field name="VAR" id=";Ki:[qYaZnowqSa`]/aW">ts_goal_left</field> <value name="VALUE"> - <block type="util_runtime_measurement" id="O!p9@+{cCQ5ov3?1cB9F"> + <block type="util_runtime_measurement" id="GONAj}Dx[0?0CBm%nsU6"> <field name="TIME">MILLISECOND</field> </block> </value> <next> - <block type="variables_set" id=",#}P8.}lYXpT3LT`P:?w"> - <field name="VAR" id=";Ki:[qYaZnowqSa`]/aW">ts_goal_left</field> + <block type="variables_set" id="8`mdTp}$]{VWKH.cNxI;"> + <field name="VAR" id="z^z{Ev+IMfS6[W1raY;l">ts_goal_right</field> <value name="VALUE"> - <block type="util_runtime_measurement" id="GONAj}Dx[0?0CBm%nsU6"> + <block type="util_runtime_measurement" id="iQYX(E[,RbI0z8A#M9o%"> <field name="TIME">MILLISECOND</field> </block> </value> <next> - <block type="variables_set" id="8`mdTp}$]{VWKH.cNxI;"> - <field name="VAR" id="z^z{Ev+IMfS6[W1raY;l">ts_goal_right</field> + <block type="variables_set" id="KM.MX+]F}x6_^($zaJ42"> + <field name="VAR" id="2Lkg^#Z.uZy(%Nr[26)6">search_dir_left</field> <value name="VALUE"> - <block type="util_runtime_measurement" id="iQYX(E[,RbI0z8A#M9o%"> - <field name="TIME">MILLISECOND</field> + <block type="logic_boolean" id="G[2Hre!^[YHSfA#^`k;H"> + <field name="BOOL">TRUE</field> </block> </value> <next> - <block type="variables_set" id="KM.MX+]F}x6_^($zaJ42"> - <field name="VAR" id="2Lkg^#Z.uZy(%Nr[26)6">search_dir_left</field> + <block type="variables_set" id="?^qtAjQUmvZ=U[d1VIhg"> + <field name="VAR" id="vH;^OzJY7dOdepMScU1s">state</field> <value name="VALUE"> - <block type="logic_boolean" id="G[2Hre!^[YHSfA#^`k;H"> - <field name="BOOL">TRUE</field> + <block type="text" id="V.-^bs67=#+RFV.YX~P,"> + <field name="TEXT">NONE</field> </block> </value> <next> - <block type="variables_set" id="?^qtAjQUmvZ=U[d1VIhg"> - <field name="VAR" id="vH;^OzJY7dOdepMScU1s">state</field> + <block type="variables_set" id="!eP!#y!o25=Kc{0p7GDs"> + <field name="VAR" id="fPH`.@]riH+=v{,A)bP5">cmd</field> <value name="VALUE"> - <block type="text" id="V.-^bs67=#+RFV.YX~P,"> + <block type="text" id="vc4C]$ok!Yk@_eIUD8L)"> <field name="TEXT">NONE</field> </block> </value> <next> - <block type="variables_set" id="!eP!#y!o25=Kc{0p7GDs"> - <field name="VAR" id="fPH`.@]riH+=v{,A)bP5">cmd</field> - <value name="VALUE"> - <block type="text" id="vc4C]$ok!Yk@_eIUD8L)"> - <field name="TEXT">NONE</field> - </block> + <block type="util_wait_for" id="psY%VZ5++RBl5.z;}C^B"> + <field name="format">s</field> + <value name="value"> + <shadow type="math_number" id="((-m~`=x]Jlg;bgN9QH!"> + <field name="NUM">2</field> + </shadow> </value> <next> - <block type="util_wait_for" id="psY%VZ5++RBl5.z;}C^B"> - <field name="format">s</field> - <value name="value"> - <shadow type="math_number" id="((-m~`=x]Jlg;bgN9QH!"> - <field name="NUM">2</field> - </shadow> - </value> - <next> - <block type="loop_endless" id="V,Gw25li,3_,;92QCQLj"> - <statement name="DO"> - <block type="controls_if" id="LIzedxH5dle@WM!lcbM#"> + <block type="loop_endless" id="V,Gw25li,3_,;92QCQLj"> + <statement name="DO"> + <block type="controls_if" id="LIzedxH5dle@WM!lcbM#"> + <value name="IF0"> + <block type="display_get_switch_state" id="/xkM7bR[)*BEY41xd)JA"> + <field name="instance_name">txt_switch_active</field> + <field name="property_name">checked</field> + </block> + </value> + <statement name="DO0"> + <block type="controls_if" id="aHn#xa9*3UPMZUu37%KD"> + <mutation elseif="0" else="1"/> <value name="IF0"> - <block type="display_get_switch_state" id="/xkM7bR[)*BEY41xd)JA"> - <field name="instance_name">txt_switch_active</field> - <field name="property_name">checked</field> + <block type="logic_operation" id="~/u3*G]LZK9pvIFTV#^q" inline="false"> + <field name="OP">AND</field> + <value name="A"> + <block type="logic_compare" id="D%l9OSY`vM-xzaB}nY1r"> + <field name="OP">NEQ</field> + <value name="A"> + <block type="variables_get" id="92sOCNRLiogo~;}oI++#"> + <field name="VAR" id="S4.mduNQC(va3iR{oSdB">posx_ball</field> + </block> + </value> + <value name="B"> + <block type="logic_null" id="UJ,gxhveD7#?I9I*:A(r"/> + </value> + </block> + </value> + <value name="B"> + <block type="logic_compare" id="Nd,4OywJ0ocibay-klwh"> + <field name="OP">NEQ</field> + <value name="A"> + <block type="variables_get" id="xiIzl/p_!nb4$eUrqxet"> + <field name="VAR" id="q#H`+Gwt~43Dh@fu;G-D">posy_ball</field> + </block> + </value> + <value name="B"> + <block type="logic_null" id="z0gO+`Su.;sXQ(oI,(y^"/> + </value> + </block> + </value> </block> </value> <statement name="DO0"> - <block type="controls_if" id="aHn#xa9*3UPMZUu37%KD"> - <mutation elseif="0" else="1"/> + <block type="controls_if" id=".azto3k]W3z}%MWyt~-e"> + <mutation elseif="2" else="1"/> <value name="IF0"> - <block type="logic_operation" id="~/u3*G]LZK9pvIFTV#^q" inline="false"> + <block type="logic_operation" id="n+p!xL0Cy:ManlHugN9b" inline="false"> <field name="OP">AND</field> <value name="A"> - <block type="logic_compare" id="D%l9OSY`vM-xzaB}nY1r"> + <block type="logic_compare" id="Vs3%xCaz|qN@}C*=Tq3$"> <field name="OP">NEQ</field> <value name="A"> - <block type="variables_get" id="92sOCNRLiogo~;}oI++#"> - <field name="VAR" id="S4.mduNQC(va3iR{oSdB">posx_ball</field> + <block type="variables_get" id="GddxTJE,O^,fb~pxb3(b"> + <field name="VAR" id="=2ARo+;2DS07SU~j29Fk">posx_goal_left</field> </block> </value> <value name="B"> - <block type="logic_null" id="UJ,gxhveD7#?I9I*:A(r"/> + <block type="logic_null" id="zdJr-qt**l*{;JppUgmP"/> </value> </block> </value> <value name="B"> - <block type="logic_compare" id="Nd,4OywJ0ocibay-klwh"> + <block type="logic_compare" id="1IfAVQZEPrL6SRY?6A28"> <field name="OP">NEQ</field> <value name="A"> - <block type="variables_get" id="xiIzl/p_!nb4$eUrqxet"> - <field name="VAR" id="q#H`+Gwt~43Dh@fu;G-D">posy_ball</field> + <block type="variables_get" id="I@,t{sciNOi(fg$?r)#f"> + <field name="VAR" id="7Tp~7_.qfmJN0SR]5p}F">posx_goal_right</field> </block> </value> <value name="B"> - <block type="logic_null" id="z0gO+`Su.;sXQ(oI,(y^"/> + <block type="logic_null" id="woPk%eJHq,DN-n%_Z+nD"/> </value> </block> </value> </block> </value> <statement name="DO0"> - <block type="controls_if" id=".azto3k]W3z}%MWyt~-e"> - <mutation elseif="2" else="1"/> - <value name="IF0"> - <block type="logic_operation" id="n+p!xL0Cy:ManlHugN9b" inline="false"> - <field name="OP">AND</field> - <value name="A"> - <block type="logic_compare" id="Vs3%xCaz|qN@}C*=Tq3$"> - <field name="OP">NEQ</field> - <value name="A"> - <block type="variables_get" id="GddxTJE,O^,fb~pxb3(b"> - <field name="VAR" id="=2ARo+;2DS07SU~j29Fk">posx_goal_left</field> - </block> - </value> - <value name="B"> - <block type="logic_null" id="zdJr-qt**l*{;JppUgmP"/> - </value> - </block> - </value> - <value name="B"> - <block type="logic_compare" id="1IfAVQZEPrL6SRY?6A28"> - <field name="OP">NEQ</field> - <value name="A"> - <block type="variables_get" id="I@,t{sciNOi(fg$?r)#f"> - <field name="VAR" id="7Tp~7_.qfmJN0SR]5p}F">posx_goal_right</field> - </block> - </value> - <value name="B"> - <block type="logic_null" id="woPk%eJHq,DN-n%_Z+nD"/> - </value> - </block> - </value> + <block type="variables_set" id="?=|7j%BS8lgVb|CMk2`B"> + <field name="VAR" id="vH;^OzJY7dOdepMScU1s">state</field> + <value name="VALUE"> + <block type="text" id="Y4VWl.KGLr*CB@5lWqMT"> + <field name="TEXT">BALL_GOAL_BOTH</field> </block> </value> - <statement name="DO0"> - <block type="variables_set" id="?=|7j%BS8lgVb|CMk2`B"> - <field name="VAR" id="vH;^OzJY7dOdepMScU1s">state</field> - <value name="VALUE"> - <block type="text" id="Y4VWl.KGLr*CB@5lWqMT"> - <field name="TEXT">BALL_GOAL_BOTH</field> - </block> - </value> - <next> - <block type="controls_if" id="*lBS$ZT#Ys7,}]I-O@k^"> - <mutation elseif="0" else="1"/> - <value name="IF0"> - <block type="logic_operation" id="F*6cCZOW)ukbgn9K8?SO" inline="false"> - <field name="OP">AND</field> + <next> + <block type="controls_if" id="*lBS$ZT#Ys7,}]I-O@k^"> + <mutation elseif="0" else="1"/> + <value name="IF0"> + <block type="logic_operation" id="F*6cCZOW)ukbgn9K8?SO" inline="false"> + <field name="OP">AND</field> + <value name="A"> + <block type="logic_compare" id="gQMo_h|S:{G:nr]1=UW4"> + <field name="OP">GT</field> <value name="A"> - <block type="logic_compare" id="gQMo_h|S:{G:nr]1=UW4"> - <field name="OP">GT</field> + <block type="math_arithmetic" id="g#5+UTr_8H_R-F]F:wXY"> + <field name="OP">MINUS</field> <value name="A"> - <block type="math_arithmetic" id="g#5+UTr_8H_R-F]F:wXY"> - <field name="OP">MINUS</field> - <value name="A"> - <block type="variables_get" id=",-pErfLng]qD$?z[[Fs7"> - <field name="VAR" id="a8;eFhj+gj?)7exUyU;p">posy_goal_left</field> - </block> - </value> - <value name="B"> - <block type="variables_get" id="@8MLRa^g0hU[CeMJ#Wdh"> - <field name="VAR" id="q#H`+Gwt~43Dh@fu;G-D">posy_ball</field> - </block> - </value> + <block type="variables_get" id=",-pErfLng]qD$?z[[Fs7"> + <field name="VAR" id="a8;eFhj+gj?)7exUyU;p">posy_goal_left</field> </block> </value> <value name="B"> - <block type="math_number" id="Wzx3MWFz@%Jz9y{C/Qp1"> - <field name="NUM">-15</field> + <block type="variables_get" id="@8MLRa^g0hU[CeMJ#Wdh"> + <field name="VAR" id="q#H`+Gwt~43Dh@fu;G-D">posy_ball</field> </block> </value> </block> </value> <value name="B"> - <block type="logic_compare" id="8B#3C:X3GH?2=7:Pz69)"> - <field name="OP">GT</field> - <value name="A"> - <block type="math_arithmetic" id="BVT`l59)jj8X[?{ToBh@"> - <field name="OP">MINUS</field> - <value name="A"> - <block type="variables_get" id="r56n`}OQ/*+nk-rCW$m."> - <field name="VAR" id="+j/X+RCIMajR28(u#7DG">posy_goal_right</field> - </block> - </value> - <value name="B"> - <block type="variables_get" id="u,9zl8#.bgLY`eV8SG6g"> - <field name="VAR" id="q#H`+Gwt~43Dh@fu;G-D">posy_ball</field> - </block> - </value> - </block> - </value> - <value name="B"> - <block type="math_number" id="{pD26^qSv`7.;d_.f@0c"> - <field name="NUM">-15</field> - </block> - </value> + <block type="math_number" id="Wzx3MWFz@%Jz9y{C/Qp1"> + <field name="NUM">-15</field> </block> </value> </block> </value> - <statement name="DO0"> - <block type="procedures_callnoreturn" id="yaFH%EQx@BB~q4Cb%;Qe"> - <mutation name="soundGoal"/> - </block> - </statement> - <statement name="ELSE"> - <block type="controls_if" id="?*]pJ{$BWYb7XOmWoq=}"> - <mutation elseif="2"/> - <value name="IF0"> - <block type="logic_operation" id="aA(*kb?~twOr6-H-5Y6L" inline="false"> - <field name="OP">AND</field> + <value name="B"> + <block type="logic_compare" id="8B#3C:X3GH?2=7:Pz69)"> + <field name="OP">GT</field> + <value name="A"> + <block type="math_arithmetic" id="BVT`l59)jj8X[?{ToBh@"> + <field name="OP">MINUS</field> <value name="A"> - <block type="logic_compare" id="s@[Z^y:V@HE1Rj;{0kMC"> - <field name="OP">GT</field> - <value name="A"> - <block type="variables_get" id="i5K6*S_7LI]YP*oc?o#("> - <field name="VAR" id="S4.mduNQC(va3iR{oSdB">posx_ball</field> - </block> - </value> - <value name="B"> - <block type="variables_get" id="2.y#4B,;Y:6:KX.dWY!e"> - <field name="VAR" id="=2ARo+;2DS07SU~j29Fk">posx_goal_left</field> - </block> - </value> + <block type="variables_get" id="r56n`}OQ/*+nk-rCW$m."> + <field name="VAR" id="+j/X+RCIMajR28(u#7DG">posy_goal_right</field> </block> </value> <value name="B"> - <block type="logic_compare" id="pj/D#[B!S_nEJX02j9b`"> - <field name="OP">LT</field> - <value name="A"> - <block type="variables_get" id="$R,CQ$q_:mge?X159P8L"> - <field name="VAR" id="S4.mduNQC(va3iR{oSdB">posx_ball</field> - </block> - </value> - <value name="B"> - <block type="variables_get" id="ru(1|is|xmE}.]MuY*xT"> - <field name="VAR" id="7Tp~7_.qfmJN0SR]5p}F">posx_goal_right</field> - </block> - </value> + <block type="variables_get" id="u,9zl8#.bgLY`eV8SG6g"> + <field name="VAR" id="q#H`+Gwt~43Dh@fu;G-D">posy_ball</field> </block> </value> </block> </value> - <statement name="DO0"> - <block type="procedures_callnoreturn" id="90_K~]2igif9F@eo$.5Z"> - <mutation name="stepBall"> - <arg name="shot"/> - </mutation> - <value name="ARG0"> - <block type="logic_boolean" id="_$3,;B)-(K-03ZzRYj!5"> - <field name="BOOL">TRUE</field> - </block> - </value> + <value name="B"> + <block type="math_number" id="{pD26^qSv`7.;d_.f@0c"> + <field name="NUM">-15</field> </block> - </statement> - <value name="IF1"> - <block type="logic_compare" id=".p%vg@`T{)!T6f3i$rO9"> - <field name="OP">LT</field> + </value> + </block> + </value> + </block> + </value> + <statement name="DO0"> + <block type="procedures_callnoreturn" id="yaFH%EQx@BB~q4Cb%;Qe"> + <mutation name="soundGoal"/> + </block> + </statement> + <statement name="ELSE"> + <block type="controls_if" id="?*]pJ{$BWYb7XOmWoq=}"> + <mutation elseif="2"/> + <value name="IF0"> + <block type="logic_operation" id="aA(*kb?~twOr6-H-5Y6L" inline="false"> + <field name="OP">AND</field> + <value name="A"> + <block type="logic_compare" id="s@[Z^y:V@HE1Rj;{0kMC"> + <field name="OP">GT</field> <value name="A"> - <block type="variables_get" id="V2_?}A{Yt7$iai=yCSJ)"> + <block type="variables_get" id="i5K6*S_7LI]YP*oc?o#("> <field name="VAR" id="S4.mduNQC(va3iR{oSdB">posx_ball</field> </block> </value> <value name="B"> - <block type="variables_get" id="lpS.y*[{cEi1+0~K+1A0"> - <field name="VAR" id="{]]L-TSC^#XtGnVinxf[">posx_goal_both</field> + <block type="variables_get" id="2.y#4B,;Y:6:KX.dWY!e"> + <field name="VAR" id="=2ARo+;2DS07SU~j29Fk">posx_goal_left</field> </block> </value> </block> </value> - <statement name="DO1"> - <block type="procedures_callnoreturn" id="@n*^wewk`x?NX#m2}EQE"> - <mutation name="turnSideLeft"> - <arg name="v"/> - <arg name="ticks"/> - </mutation> - <value name="ARG0"> - <block type="variables_get" id="+m}1a:ZW]JoRW2QP.n06"> - <field name="VAR" id=")rK_fR,m=]b(j[{.CtBj">v_slow</field> - </block> - </value> - <value name="ARG1"> - <block type="math_number" id="_;2gj%#h1g[wnD|7oXuo"> - <field name="NUM">20</field> - </block> - </value> - </block> - </statement> - <value name="IF2"> - <block type="logic_compare" id="FkJHQ#CLjJp,s#{H{pha"> - <field name="OP">GT</field> + <value name="B"> + <block type="logic_compare" id="pj/D#[B!S_nEJX02j9b`"> + <field name="OP">LT</field> <value name="A"> - <block type="variables_get" id="(Dk1+3wh2]HCao.dq?PS"> + <block type="variables_get" id="$R,CQ$q_:mge?X159P8L"> <field name="VAR" id="S4.mduNQC(va3iR{oSdB">posx_ball</field> </block> </value> <value name="B"> - <block type="variables_get" id="6=]nXa6@Nlp}dkXwpg6@"> - <field name="VAR" id="{]]L-TSC^#XtGnVinxf[">posx_goal_both</field> + <block type="variables_get" id="ru(1|is|xmE}.]MuY*xT"> + <field name="VAR" id="7Tp~7_.qfmJN0SR]5p}F">posx_goal_right</field> </block> </value> </block> </value> - <statement name="DO2"> - <block type="procedures_callnoreturn" id="R590b9iY$aQ~B7!m8f2l"> - <mutation name="turnSideRight"> - <arg name="v"/> - <arg name="ticks"/> - </mutation> - <value name="ARG0"> - <block type="variables_get" id="vk%)2O)R9Ft/FMn)2yr7"> - <field name="VAR" id=")rK_fR,m=]b(j[{.CtBj">v_slow</field> - </block> - </value> - <value name="ARG1"> - <block type="math_number" id="N.3ER1#5:PMk;ocu-#q("> - <field name="NUM">20</field> - </block> - </value> + </block> + </value> + <statement name="DO0"> + <block type="procedures_callnoreturn" id="90_K~]2igif9F@eo$.5Z"> + <mutation name="stepBall"> + <arg name="shot"/> + </mutation> + <value name="ARG0"> + <block type="logic_boolean" id="_$3,;B)-(K-03ZzRYj!5"> + <field name="BOOL">TRUE</field> </block> - </statement> + </value> </block> </statement> - </block> - </next> - </block> - </statement> - <value name="IF1"> - <block type="logic_operation" id="(jJONR?QSU;KGYM!9ymz" inline="false"> - <field name="OP">AND</field> - <value name="A"> - <block type="logic_compare" id="`8=+-9%Pb7y~05?n%:.-"> - <field name="OP">NEQ</field> - <value name="A"> - <block type="variables_get" id="yho-]F]PY=,)SpSbQPwP"> - <field name="VAR" id="=2ARo+;2DS07SU~j29Fk">posx_goal_left</field> + <value name="IF1"> + <block type="logic_compare" id=".p%vg@`T{)!T6f3i$rO9"> + <field name="OP">LT</field> + <value name="A"> + <block type="variables_get" id="V2_?}A{Yt7$iai=yCSJ)"> + <field name="VAR" id="S4.mduNQC(va3iR{oSdB">posx_ball</field> + </block> + </value> + <value name="B"> + <block type="variables_get" id="lpS.y*[{cEi1+0~K+1A0"> + <field name="VAR" id="{]]L-TSC^#XtGnVinxf[">posx_goal_both</field> + </block> + </value> </block> </value> - <value name="B"> - <block type="logic_null" id="$fM$v`jz=Gu3u5N-kvvV"/> + <statement name="DO1"> + <block type="procedures_callnoreturn" id="@n*^wewk`x?NX#m2}EQE"> + <mutation name="turnSideLeft"> + <arg name="v"/> + <arg name="ticks"/> + </mutation> + <value name="ARG0"> + <block type="variables_get" id="+m}1a:ZW]JoRW2QP.n06"> + <field name="VAR" id=")rK_fR,m=]b(j[{.CtBj">v_slow</field> + </block> + </value> + <value name="ARG1"> + <block type="math_number" id="_;2gj%#h1g[wnD|7oXuo"> + <field name="NUM">20</field> + </block> + </value> + </block> + </statement> + <value name="IF2"> + <block type="logic_compare" id="FkJHQ#CLjJp,s#{H{pha"> + <field name="OP">GT</field> + <value name="A"> + <block type="variables_get" id="(Dk1+3wh2]HCao.dq?PS"> + <field name="VAR" id="S4.mduNQC(va3iR{oSdB">posx_ball</field> + </block> + </value> + <value name="B"> + <block type="variables_get" id="6=]nXa6@Nlp}dkXwpg6@"> + <field name="VAR" id="{]]L-TSC^#XtGnVinxf[">posx_goal_both</field> + </block> + </value> + </block> </value> + <statement name="DO2"> + <block type="procedures_callnoreturn" id="R590b9iY$aQ~B7!m8f2l"> + <mutation name="turnSideRight"> + <arg name="v"/> + <arg name="ticks"/> + </mutation> + <value name="ARG0"> + <block type="variables_get" id="vk%)2O)R9Ft/FMn)2yr7"> + <field name="VAR" id=")rK_fR,m=]b(j[{.CtBj">v_slow</field> + </block> + </value> + <value name="ARG1"> + <block type="math_number" id="N.3ER1#5:PMk;ocu-#q("> + <field name="NUM">20</field> + </block> + </value> + </block> + </statement> + </block> + </statement> + </block> + </next> + </block> + </statement> + <value name="IF1"> + <block type="logic_operation" id="(jJONR?QSU;KGYM!9ymz" inline="false"> + <field name="OP">AND</field> + <value name="A"> + <block type="logic_compare" id="`8=+-9%Pb7y~05?n%:.-"> + <field name="OP">NEQ</field> + <value name="A"> + <block type="variables_get" id="yho-]F]PY=,)SpSbQPwP"> + <field name="VAR" id="=2ARo+;2DS07SU~j29Fk">posx_goal_left</field> </block> </value> <value name="B"> - <block type="logic_compare" id="3[c=:H.XfB-GEfuelSLT"> - <field name="OP">EQ</field> - <value name="A"> - <block type="variables_get" id=";ZAx96@n9~k7Pw7/~*8S"> - <field name="VAR" id="7Tp~7_.qfmJN0SR]5p}F">posx_goal_right</field> - </block> - </value> - <value name="B"> - <block type="logic_null" id="Dwx`oZu-Z*UMkSF2u9uU"/> - </value> + <block type="logic_null" id="$fM$v`jz=Gu3u5N-kvvV"/> + </value> + </block> + </value> + <value name="B"> + <block type="logic_compare" id="3[c=:H.XfB-GEfuelSLT"> + <field name="OP">EQ</field> + <value name="A"> + <block type="variables_get" id=";ZAx96@n9~k7Pw7/~*8S"> + <field name="VAR" id="7Tp~7_.qfmJN0SR]5p}F">posx_goal_right</field> </block> </value> + <value name="B"> + <block type="logic_null" id="Dwx`oZu-Z*UMkSF2u9uU"/> + </value> </block> </value> - <statement name="DO1"> - <block type="variables_set" id="%Io@znvhX3QvyZ*mPL},"> - <field name="VAR" id="vH;^OzJY7dOdepMScU1s">state</field> - <value name="VALUE"> - <block type="text" id="y/+X`X}C3$Nc/TH%3_dv"> - <field name="TEXT">BALL_GOAL_LEFT</field> + </block> + </value> + <statement name="DO1"> + <block type="variables_set" id="%Io@znvhX3QvyZ*mPL},"> + <field name="VAR" id="vH;^OzJY7dOdepMScU1s">state</field> + <value name="VALUE"> + <block type="text" id="y/+X`X}C3$Nc/TH%3_dv"> + <field name="TEXT">BALL_GOAL_LEFT</field> + </block> + </value> + <next> + <block type="procedures_callnoreturn" id="k0ElL*hZU:LP$5|:#LB?"> + <mutation name="turnSideLeft"> + <arg name="v"/> + <arg name="ticks"/> + </mutation> + <value name="ARG0"> + <block type="variables_get" id="OPBK1GzGPPmCYw|3a:2R"> + <field name="VAR" id=")rK_fR,m=]b(j[{.CtBj">v_slow</field> </block> </value> - <next> - <block type="procedures_callnoreturn" id="k0ElL*hZU:LP$5|:#LB?"> - <mutation name="turnSideLeft"> - <arg name="v"/> - <arg name="ticks"/> - </mutation> - <value name="ARG0"> - <block type="variables_get" id="OPBK1GzGPPmCYw|3a:2R"> - <field name="VAR" id=")rK_fR,m=]b(j[{.CtBj">v_slow</field> - </block> - </value> - <value name="ARG1"> - <block type="math_number" id="gcH1Ps(J*{a)=3pi9diY"> - <field name="NUM">10</field> - </block> - </value> + <value name="ARG1"> + <block type="math_number" id="gcH1Ps(J*{a)=3pi9diY"> + <field name="NUM">10</field> </block> - </next> + </value> </block> - </statement> - <value name="IF2"> - <block type="logic_operation" id="1;1`n[eC4,:;kuqeyYe?" inline="false"> - <field name="OP">AND</field> + </next> + </block> + </statement> + <value name="IF2"> + <block type="logic_operation" id="1;1`n[eC4,:;kuqeyYe?" inline="false"> + <field name="OP">AND</field> + <value name="A"> + <block type="logic_compare" id="TM_H.[_zQQ6+pVvAY1~3"> + <field name="OP">EQ</field> <value name="A"> - <block type="logic_compare" id="TM_H.[_zQQ6+pVvAY1~3"> - <field name="OP">EQ</field> - <value name="A"> - <block type="variables_get" id="2%ig?qe,;l|V%-dz/sSa"> - <field name="VAR" id="=2ARo+;2DS07SU~j29Fk">posx_goal_left</field> - </block> - </value> - <value name="B"> - <block type="logic_null" id="nWaVJidHgA=jsdDixAN@"/> - </value> + <block type="variables_get" id="2%ig?qe,;l|V%-dz/sSa"> + <field name="VAR" id="=2ARo+;2DS07SU~j29Fk">posx_goal_left</field> </block> </value> <value name="B"> - <block type="logic_compare" id="h2LhI}NfWS@AVx2ZO$SV"> - <field name="OP">NEQ</field> - <value name="A"> - <block type="variables_get" id="8moxf4Q@Tu]VF!9L|68b"> - <field name="VAR" id="7Tp~7_.qfmJN0SR]5p}F">posx_goal_right</field> - </block> - </value> - <value name="B"> - <block type="logic_null" id="vjJEFGVR/}C}/4mI7%g:"/> - </value> - </block> + <block type="logic_null" id="nWaVJidHgA=jsdDixAN@"/> </value> </block> </value> - <statement name="DO2"> - <block type="variables_set" id=",9T_FbUWwGZlugNQ_c#x"> - <field name="VAR" id="vH;^OzJY7dOdepMScU1s">state</field> - <value name="VALUE"> - <block type="text" id="5?`m/5fCq/Z(s/u)oR*~"> - <field name="TEXT">BALL_GOAL_RIGHT</field> + <value name="B"> + <block type="logic_compare" id="h2LhI}NfWS@AVx2ZO$SV"> + <field name="OP">NEQ</field> + <value name="A"> + <block type="variables_get" id="8moxf4Q@Tu]VF!9L|68b"> + <field name="VAR" id="7Tp~7_.qfmJN0SR]5p}F">posx_goal_right</field> </block> </value> - <next> - <block type="procedures_callnoreturn" id="+j-FQusX0T9FJ1P}u:0|"> - <mutation name="turnSideRight"> - <arg name="v"/> - <arg name="ticks"/> - </mutation> - <value name="ARG0"> - <block type="variables_get" id="Jx~`*{sDX:}UuM`gsZp/"> - <field name="VAR" id=")rK_fR,m=]b(j[{.CtBj">v_slow</field> - </block> - </value> - <value name="ARG1"> - <block type="math_number" id=")k]SdR3F1bII`Mo!4Q2T"> - <field name="NUM">10</field> - </block> - </value> - </block> - </next> + <value name="B"> + <block type="logic_null" id="vjJEFGVR/}C}/4mI7%g:"/> + </value> </block> - </statement> - <statement name="ELSE"> - <block type="variables_set" id="=B4Rj[z{i:0)u!6?C.@u"> - <field name="VAR" id="vH;^OzJY7dOdepMScU1s">state</field> - <value name="VALUE"> - <block type="text" id="Vz)~xH3AGhNl8(w~ZeE1"> - <field name="TEXT">BALL_NO_GOAL</field> + </value> + </block> + </value> + <statement name="DO2"> + <block type="variables_set" id=",9T_FbUWwGZlugNQ_c#x"> + <field name="VAR" id="vH;^OzJY7dOdepMScU1s">state</field> + <value name="VALUE"> + <block type="text" id="5?`m/5fCq/Z(s/u)oR*~"> + <field name="TEXT">BALL_GOAL_RIGHT</field> + </block> + </value> + <next> + <block type="procedures_callnoreturn" id="+j-FQusX0T9FJ1P}u:0|"> + <mutation name="turnSideRight"> + <arg name="v"/> + <arg name="ticks"/> + </mutation> + <value name="ARG0"> + <block type="variables_get" id="Jx~`*{sDX:}UuM`gsZp/"> + <field name="VAR" id=")rK_fR,m=]b(j[{.CtBj">v_slow</field> </block> </value> - <next> - <block type="procedures_callnoreturn" id=")f0^YOdfvadl{9t=j|w1"> - <mutation name="stepBall"> - <arg name="shot"/> - </mutation> - <value name="ARG0"> - <block type="logic_boolean" id="oi!78vnT!+MpPB1n]qMf"> - <field name="BOOL">FALSE</field> - </block> - </value> + <value name="ARG1"> + <block type="math_number" id=")k]SdR3F1bII`Mo!4Q2T"> + <field name="NUM">10</field> </block> - </next> + </value> </block> - </statement> + </next> </block> </statement> <statement name="ELSE"> - <block type="controls_if" id=":+;zyZF]7c#-QBh8$DW^"> - <mutation elseif="2" else="1"/> - <value name="IF0"> - <block type="logic_operation" id="T;e37h:tRmDfk=i;=KUw" inline="false"> - <field name="OP">AND</field> + <block type="variables_set" id="=B4Rj[z{i:0)u!6?C.@u"> + <field name="VAR" id="vH;^OzJY7dOdepMScU1s">state</field> + <value name="VALUE"> + <block type="text" id="Vz)~xH3AGhNl8(w~ZeE1"> + <field name="TEXT">BALL_NO_GOAL</field> + </block> + </value> + <next> + <block type="procedures_callnoreturn" id=")f0^YOdfvadl{9t=j|w1"> + <mutation name="stepBall"> + <arg name="shot"/> + </mutation> + <value name="ARG0"> + <block type="logic_boolean" id="oi!78vnT!+MpPB1n]qMf"> + <field name="BOOL">FALSE</field> + </block> + </value> + </block> + </next> + </block> + </statement> + </block> + </statement> + <statement name="ELSE"> + <block type="controls_if" id=":+;zyZF]7c#-QBh8$DW^"> + <mutation elseif="2" else="1"/> + <value name="IF0"> + <block type="logic_operation" id="T;e37h:tRmDfk=i;=KUw" inline="false"> + <field name="OP">AND</field> + <value name="A"> + <block type="logic_compare" id="J?P(P(GS*(XS.u3,^gDH"> + <field name="OP">NEQ</field> <value name="A"> - <block type="logic_compare" id="J?P(P(GS*(XS.u3,^gDH"> - <field name="OP">NEQ</field> - <value name="A"> - <block type="variables_get" id="%=:pZSNhgSS#}A7RFb-m"> - <field name="VAR" id="=2ARo+;2DS07SU~j29Fk">posx_goal_left</field> - </block> - </value> - <value name="B"> - <block type="logic_null" id="Krr)V8_2jy)QKT|Uy)A`"/> - </value> + <block type="variables_get" id="%=:pZSNhgSS#}A7RFb-m"> + <field name="VAR" id="=2ARo+;2DS07SU~j29Fk">posx_goal_left</field> </block> </value> <value name="B"> - <block type="logic_compare" id="ffs5T2N@HW6q,YD7+=4y"> - <field name="OP">NEQ</field> - <value name="A"> - <block type="variables_get" id="~_Q+EdEV/6ho6B-lM|e."> - <field name="VAR" id="7Tp~7_.qfmJN0SR]5p}F">posx_goal_right</field> - </block> - </value> - <value name="B"> - <block type="logic_null" id="Xec|5GQgP=8o:@`Scn4C"/> - </value> - </block> + <block type="logic_null" id="Krr)V8_2jy)QKT|Uy)A`"/> </value> </block> </value> - <statement name="DO0"> - <block type="variables_set" id="u#?[x*W2[}s=7T+@kGX3"> - <field name="VAR" id="vH;^OzJY7dOdepMScU1s">state</field> - <value name="VALUE"> - <block type="text" id="Gi1v,-rKbpMdik!jz5aA"> - <field name="TEXT">NO_BALL_GOAL_BOTH</field> + <value name="B"> + <block type="logic_compare" id="ffs5T2N@HW6q,YD7+=4y"> + <field name="OP">NEQ</field> + <value name="A"> + <block type="variables_get" id="~_Q+EdEV/6ho6B-lM|e."> + <field name="VAR" id="7Tp~7_.qfmJN0SR]5p}F">posx_goal_right</field> </block> </value> - <next> - <block type="controls_if" id="ip*`sP8:b(5pR4)~R_an"> - <mutation elseif="2" else="1"/> - <value name="IF0"> - <block type="logic_operation" id="fn=DRPVeg$aV~zkMY*tl" inline="false"> - <field name="OP">AND</field> + <value name="B"> + <block type="logic_null" id="Xec|5GQgP=8o:@`Scn4C"/> + </value> + </block> + </value> + </block> + </value> + <statement name="DO0"> + <block type="variables_set" id="u#?[x*W2[}s=7T+@kGX3"> + <field name="VAR" id="vH;^OzJY7dOdepMScU1s">state</field> + <value name="VALUE"> + <block type="text" id="Gi1v,-rKbpMdik!jz5aA"> + <field name="TEXT">NO_BALL_GOAL_BOTH</field> + </block> + </value> + <next> + <block type="controls_if" id="ip*`sP8:b(5pR4)~R_an"> + <mutation elseif="2" else="1"/> + <value name="IF0"> + <block type="logic_operation" id="fn=DRPVeg$aV~zkMY*tl" inline="false"> + <field name="OP">AND</field> + <value name="A"> + <block type="logic_compare" id="2Q5e3vZ!5/=nainF0od+"> + <field name="OP">GTE</field> <value name="A"> - <block type="logic_compare" id="2Q5e3vZ!5/=nainF0od+"> - <field name="OP">GTE</field> - <value name="A"> - <block type="variables_get" id="CDb^~4feXbvngdh004${"> - <field name="VAR" id="{]]L-TSC^#XtGnVinxf[">posx_goal_both</field> - </block> - </value> - <value name="B"> - <block type="variables_get" id="cR*DIW$3$NL#u11S8#v,"> - <field name="VAR" id="Ym/+Qo0YZe25;%N1d!*f">x_min</field> - </block> - </value> + <block type="variables_get" id="CDb^~4feXbvngdh004${"> + <field name="VAR" id="{]]L-TSC^#XtGnVinxf[">posx_goal_both</field> </block> </value> <value name="B"> - <block type="logic_compare" id="c(LuogB[ECxBtM-6/r4b"> - <field name="OP">LTE</field> - <value name="A"> - <block type="variables_get" id="z~zx!V^G#Ywd}HPCLcCn"> - <field name="VAR" id="{]]L-TSC^#XtGnVinxf[">posx_goal_both</field> - </block> - </value> - <value name="B"> - <block type="variables_get" id=")0O+HGV1!`X_dJGq4=yZ"> - <field name="VAR" id="2G]XEQ3Lhl$dG]=:]8Ge">x_max</field> - </block> - </value> + <block type="variables_get" id="cR*DIW$3$NL#u11S8#v,"> + <field name="VAR" id="Ym/+Qo0YZe25;%N1d!*f">x_min</field> </block> </value> </block> </value> - <statement name="DO0"> - <block type="controls_if" id="#R16p?0!Rt1}82Q_5zO2"> - <mutation elseif="1" else="1"/> - <value name="IF0"> - <block type="logic_compare" id="UzXI%rAMZA[}UE*cbXUd"> - <field name="OP">LT</field> - <value name="A"> - <block type="variables_get" id="@5%T+t9W1)BZT@oXqnww"> - <field name="VAR" id="v0BvP7[91TGaMpQG$r0f">goal_width</field> - </block> - </value> - <value name="B"> - <block type="math_number" id="Wb8s[K5@WIquU`@,7c@w"> - <field name="NUM">130</field> - </block> - </value> + <value name="B"> + <block type="logic_compare" id="c(LuogB[ECxBtM-6/r4b"> + <field name="OP">LTE</field> + <value name="A"> + <block type="variables_get" id="z~zx!V^G#Ywd}HPCLcCn"> + <field name="VAR" id="{]]L-TSC^#XtGnVinxf[">posx_goal_both</field> </block> </value> - <statement name="DO0"> - <block type="procedures_callnoreturn" id="pu3s6{_T@bDFusTBxc)c"> - <mutation name="fwd"> - <arg name="v"/> - <arg name="ticks"/> - </mutation> - <value name="ARG0"> - <block type="variables_get" id="]RO~:%x7+T~!YzQ5FD:C"> - <field name="VAR" id=")rK_fR,m=]b(j[{.CtBj">v_slow</field> - </block> - </value> - <value name="ARG1"> - <block type="math_number" id="v0c-z!Z^U6/IWhKEPnE*"> - <field name="NUM">10</field> - </block> - </value> - </block> - </statement> - <value name="IF1"> - <block type="logic_compare" id="XoLsJ}.)nZb?`6tpIqv-"> - <field name="OP">GT</field> - <value name="A"> - <block type="variables_get" id="9NAs7T{MBx/=YP5BpW43"> - <field name="VAR" id="v0BvP7[91TGaMpQG$r0f">goal_width</field> - </block> - </value> - <value name="B"> - <block type="math_number" id="|2@A]z`Rs0UlH}Ovv9`T"> - <field name="NUM">40</field> - </block> - </value> + <value name="B"> + <block type="variables_get" id=")0O+HGV1!`X_dJGq4=yZ"> + <field name="VAR" id="2G]XEQ3Lhl$dG]=:]8Ge">x_max</field> </block> </value> - <statement name="DO1"> - <block type="procedures_callnoreturn" id="Y6^M7Oqd:JSsRteXXtVD"> - <mutation name="bwd"> - <arg name="v"/> - <arg name="ticks"/> - </mutation> - <value name="ARG0"> - <block type="variables_get" id="8F$+J#P35!A!gFI[:AHU"> - <field name="VAR" id=")rK_fR,m=]b(j[{.CtBj">v_slow</field> - </block> - </value> - <value name="ARG1"> - <block type="math_number" id="dFB2rRWf.tj`$C?![{FH"> - <field name="NUM">10</field> - </block> - </value> - </block> - </statement> </block> - </statement> - <value name="IF1"> - <block type="logic_compare" id="(H+T:yEGNo[y%GO7P;Dz"> + </value> + </block> + </value> + <statement name="DO0"> + <block type="controls_if" id="#R16p?0!Rt1}82Q_5zO2"> + <mutation elseif="1" else="1"/> + <value name="IF0"> + <block type="logic_compare" id="UzXI%rAMZA[}UE*cbXUd"> <field name="OP">LT</field> <value name="A"> - <block type="variables_get" id="D`d-ScN5}NDq#So6U%2M"> - <field name="VAR" id="{]]L-TSC^#XtGnVinxf[">posx_goal_both</field> + <block type="variables_get" id="@5%T+t9W1)BZT@oXqnww"> + <field name="VAR" id="v0BvP7[91TGaMpQG$r0f">goal_width</field> </block> </value> <value name="B"> - <block type="variables_get" id="kw^gNGg!Q00uE[+DZwGg"> - <field name="VAR" id="Ym/+Qo0YZe25;%N1d!*f">x_min</field> + <block type="math_number" id="Wb8s[K5@WIquU`@,7c@w"> + <field name="NUM">130</field> </block> </value> </block> </value> - <statement name="DO1"> - <block type="procedures_callnoreturn" id="mG-?FU_hknyuqCH{oWJT"> - <mutation name="left"> + <statement name="DO0"> + <block type="procedures_callnoreturn" id="pu3s6{_T@bDFusTBxc)c"> + <mutation name="fwd"> <arg name="v"/> <arg name="ticks"/> </mutation> <value name="ARG0"> - <block type="variables_get" id="R%Oe)=kR9%E%`E3L[QVN"> + <block type="variables_get" id="]RO~:%x7+T~!YzQ5FD:C"> <field name="VAR" id=")rK_fR,m=]b(j[{.CtBj">v_slow</field> </block> </value> <value name="ARG1"> - <block type="math_number" id="xRlPd!,I^P3`5.OAFO-L"> + <block type="math_number" id="v0c-z!Z^U6/IWhKEPnE*"> <field name="NUM">10</field> </block> </value> </block> </statement> - <value name="IF2"> - <block type="logic_compare" id="VxyB%0*)9[A{wCi_b~$0"> + <value name="IF1"> + <block type="logic_compare" id="XoLsJ}.)nZb?`6tpIqv-"> <field name="OP">GT</field> <value name="A"> - <block type="variables_get" id="-;*b3g{dTtQ{%@$gw6P)"> - <field name="VAR" id="{]]L-TSC^#XtGnVinxf[">posx_goal_both</field> + <block type="variables_get" id="9NAs7T{MBx/=YP5BpW43"> + <field name="VAR" id="v0BvP7[91TGaMpQG$r0f">goal_width</field> </block> </value> <value name="B"> - <block type="variables_get" id="?q##-)hY2%F2{Lx*2U0U"> - <field name="VAR" id="2G]XEQ3Lhl$dG]=:]8Ge">x_max</field> + <block type="math_number" id="|2@A]z`Rs0UlH}Ovv9`T"> + <field name="NUM">40</field> </block> </value> </block> </value> - <statement name="DO2"> - <block type="procedures_callnoreturn" id="oGweCRo;|ZbP%1KR7B]a"> - <mutation name="right"> + <statement name="DO1"> + <block type="procedures_callnoreturn" id="Y6^M7Oqd:JSsRteXXtVD"> + <mutation name="bwd"> <arg name="v"/> <arg name="ticks"/> </mutation> <value name="ARG0"> - <block type="variables_get" id="Vc7Fp*A$WDu^X7t.%1`9"> + <block type="variables_get" id="8F$+J#P35!A!gFI[:AHU"> <field name="VAR" id=")rK_fR,m=]b(j[{.CtBj">v_slow</field> </block> </value> <value name="ARG1"> - <block type="math_number" id="E-tWBnGP,8}Za*a95_6n"> + <block type="math_number" id="dFB2rRWf.tj`$C?![{FH"> <field name="NUM">10</field> </block> </value> </block> </statement> </block> - </next> - </block> - </statement> - <value name="IF1"> - <block type="logic_operation" id="OODzyK;qukR-n-DzK/{V" inline="false"> - <field name="OP">AND</field> - <value name="A"> - <block type="logic_compare" id="RXI-@2_E6Wh|wxbt$s,I"> - <field name="OP">NEQ</field> + </statement> + <value name="IF1"> + <block type="logic_compare" id="(H+T:yEGNo[y%GO7P;Dz"> + <field name="OP">LT</field> <value name="A"> - <block type="variables_get" id="do13adT([f7eV=#H|B[K"> - <field name="VAR" id="=2ARo+;2DS07SU~j29Fk">posx_goal_left</field> + <block type="variables_get" id="D`d-ScN5}NDq#So6U%2M"> + <field name="VAR" id="{]]L-TSC^#XtGnVinxf[">posx_goal_both</field> + </block> + </value> + <value name="B"> + <block type="variables_get" id="kw^gNGg!Q00uE[+DZwGg"> + <field name="VAR" id="Ym/+Qo0YZe25;%N1d!*f">x_min</field> + </block> + </value> + </block> + </value> + <statement name="DO1"> + <block type="procedures_callnoreturn" id="mG-?FU_hknyuqCH{oWJT"> + <mutation name="left"> + <arg name="v"/> + <arg name="ticks"/> + </mutation> + <value name="ARG0"> + <block type="variables_get" id="R%Oe)=kR9%E%`E3L[QVN"> + <field name="VAR" id=")rK_fR,m=]b(j[{.CtBj">v_slow</field> + </block> + </value> + <value name="ARG1"> + <block type="math_number" id="xRlPd!,I^P3`5.OAFO-L"> + <field name="NUM">10</field> + </block> + </value> + </block> + </statement> + <value name="IF2"> + <block type="logic_compare" id="VxyB%0*)9[A{wCi_b~$0"> + <field name="OP">GT</field> + <value name="A"> + <block type="variables_get" id="-;*b3g{dTtQ{%@$gw6P)"> + <field name="VAR" id="{]]L-TSC^#XtGnVinxf[">posx_goal_both</field> </block> </value> <value name="B"> - <block type="logic_null" id="fizI-!+UN#8/mWI*%=W]"/> + <block type="variables_get" id="?q##-)hY2%F2{Lx*2U0U"> + <field name="VAR" id="2G]XEQ3Lhl$dG]=:]8Ge">x_max</field> + </block> </value> </block> </value> + <statement name="DO2"> + <block type="procedures_callnoreturn" id="oGweCRo;|ZbP%1KR7B]a"> + <mutation name="right"> + <arg name="v"/> + <arg name="ticks"/> + </mutation> + <value name="ARG0"> + <block type="variables_get" id="Vc7Fp*A$WDu^X7t.%1`9"> + <field name="VAR" id=")rK_fR,m=]b(j[{.CtBj">v_slow</field> + </block> + </value> + <value name="ARG1"> + <block type="math_number" id="E-tWBnGP,8}Za*a95_6n"> + <field name="NUM">10</field> + </block> + </value> + </block> + </statement> + </block> + </next> + </block> + </statement> + <value name="IF1"> + <block type="logic_operation" id="OODzyK;qukR-n-DzK/{V" inline="false"> + <field name="OP">AND</field> + <value name="A"> + <block type="logic_compare" id="RXI-@2_E6Wh|wxbt$s,I"> + <field name="OP">NEQ</field> + <value name="A"> + <block type="variables_get" id="do13adT([f7eV=#H|B[K"> + <field name="VAR" id="=2ARo+;2DS07SU~j29Fk">posx_goal_left</field> + </block> + </value> + <value name="B"> + <block type="logic_null" id="fizI-!+UN#8/mWI*%=W]"/> + </value> + </block> + </value> + <value name="B"> + <block type="logic_compare" id="xrJIK[zPx+}zKlkzTc#w"> + <field name="OP">EQ</field> + <value name="A"> + <block type="variables_get" id="pc9J=b0[$xVE!_ya2}(Z"> + <field name="VAR" id="7Tp~7_.qfmJN0SR]5p}F">posx_goal_right</field> + </block> + </value> + <value name="B"> + <block type="logic_null" id="N19OOSab2Qlki*P#1DVj"/> + </value> + </block> + </value> + </block> + </value> + <statement name="DO1"> + <block type="variables_set" id="qjHV]^:Wo)#J|x`[z9Dw"> + <field name="VAR" id="vH;^OzJY7dOdepMScU1s">state</field> + <value name="VALUE"> + <block type="text" id="0tLy^$!b-,Fdll2TwLa0"> + <field name="TEXT">NO_BALL_GOAL_LEFT</field> + </block> + </value> + <next> + <block type="procedures_callnoreturn" id="U96^i60j(oeYzU8kTgU}"> + <mutation name="right"> + <arg name="v"/> + <arg name="ticks"/> + </mutation> + <value name="ARG0"> + <block type="variables_get" id="NNO?/UcvB5S=//YOQ51j"> + <field name="VAR" id=")rK_fR,m=]b(j[{.CtBj">v_slow</field> + </block> + </value> + <value name="ARG1"> + <block type="math_number" id="_v5Xu{_@Lx/yhwcczyYw"> + <field name="NUM">10</field> + </block> + </value> + </block> + </next> + </block> + </statement> + <value name="IF2"> + <block type="logic_operation" id="_ffH*UYCZwP#p@(u*vKt" inline="false"> + <field name="OP">AND</field> + <value name="A"> + <block type="logic_compare" id="FuFu?Z[*41)=3e8JR]J;"> + <field name="OP">EQ</field> + <value name="A"> + <block type="variables_get" id="SqF~a0kV,A7s{_^N9^ux"> + <field name="VAR" id="=2ARo+;2DS07SU~j29Fk">posx_goal_left</field> + </block> + </value> <value name="B"> - <block type="logic_compare" id="xrJIK[zPx+}zKlkzTc#w"> - <field name="OP">EQ</field> - <value name="A"> - <block type="variables_get" id="pc9J=b0[$xVE!_ya2}(Z"> - <field name="VAR" id="7Tp~7_.qfmJN0SR]5p}F">posx_goal_right</field> - </block> - </value> - <value name="B"> - <block type="logic_null" id="N19OOSab2Qlki*P#1DVj"/> - </value> - </block> + <block type="logic_null" id="!SjW++O0oh^QU(]FB5$#"/> </value> </block> </value> - <statement name="DO1"> - <block type="variables_set" id="qjHV]^:Wo)#J|x`[z9Dw"> - <field name="VAR" id="vH;^OzJY7dOdepMScU1s">state</field> - <value name="VALUE"> - <block type="text" id="0tLy^$!b-,Fdll2TwLa0"> - <field name="TEXT">NO_BALL_GOAL_LEFT</field> - </block> - </value> - <next> - <block type="procedures_callnoreturn" id="U96^i60j(oeYzU8kTgU}"> - <mutation name="right"> - <arg name="v"/> - <arg name="ticks"/> - </mutation> - <value name="ARG0"> - <block type="variables_get" id="NNO?/UcvB5S=//YOQ51j"> - <field name="VAR" id=")rK_fR,m=]b(j[{.CtBj">v_slow</field> - </block> - </value> - <value name="ARG1"> - <block type="math_number" id="_v5Xu{_@Lx/yhwcczyYw"> - <field name="NUM">10</field> - </block> - </value> - </block> - </next> - </block> - </statement> - <value name="IF2"> - <block type="logic_operation" id="_ffH*UYCZwP#p@(u*vKt" inline="false"> - <field name="OP">AND</field> + <value name="B"> + <block type="logic_compare" id="aX7B2KBJ)s)ba|pbt7pB"> + <field name="OP">NEQ</field> <value name="A"> - <block type="logic_compare" id="FuFu?Z[*41)=3e8JR]J;"> - <field name="OP">EQ</field> - <value name="A"> - <block type="variables_get" id="SqF~a0kV,A7s{_^N9^ux"> - <field name="VAR" id="=2ARo+;2DS07SU~j29Fk">posx_goal_left</field> - </block> - </value> - <value name="B"> - <block type="logic_null" id="!SjW++O0oh^QU(]FB5$#"/> - </value> + <block type="variables_get" id="+_/Dc,$asRE]ha^Ka).9"> + <field name="VAR" id="7Tp~7_.qfmJN0SR]5p}F">posx_goal_right</field> </block> </value> <value name="B"> - <block type="logic_compare" id="aX7B2KBJ)s)ba|pbt7pB"> - <field name="OP">NEQ</field> - <value name="A"> - <block type="variables_get" id="+_/Dc,$asRE]ha^Ka).9"> - <field name="VAR" id="7Tp~7_.qfmJN0SR]5p}F">posx_goal_right</field> - </block> - </value> - <value name="B"> - <block type="logic_null" id="tA?4Q8nb1Np=Ih}SVJbo"/> - </value> - </block> + <block type="logic_null" id="tA?4Q8nb1Np=Ih}SVJbo"/> </value> </block> </value> - <statement name="DO2"> - <block type="variables_set" id="zX@s(@}$N7L6cM*{mc:{"> - <field name="VAR" id="vH;^OzJY7dOdepMScU1s">state</field> - <value name="VALUE"> - <block type="text" id="Zw4*=firw67G(Xw@?.}|"> - <field name="TEXT">NO_BALL_GOAL_RIGHT</field> + </block> + </value> + <statement name="DO2"> + <block type="variables_set" id="zX@s(@}$N7L6cM*{mc:{"> + <field name="VAR" id="vH;^OzJY7dOdepMScU1s">state</field> + <value name="VALUE"> + <block type="text" id="Zw4*=firw67G(Xw@?.}|"> + <field name="TEXT">NO_BALL_GOAL_RIGHT</field> + </block> + </value> + <next> + <block type="procedures_callnoreturn" id="Wizmeh4`g4Fgmk1A|sV@"> + <mutation name="left"> + <arg name="v"/> + <arg name="ticks"/> + </mutation> + <value name="ARG0"> + <block type="variables_get" id="s+91j;@jAXoyAP!%ls#{"> + <field name="VAR" id=")rK_fR,m=]b(j[{.CtBj">v_slow</field> </block> </value> - <next> - <block type="procedures_callnoreturn" id="Wizmeh4`g4Fgmk1A|sV@"> - <mutation name="left"> - <arg name="v"/> - <arg name="ticks"/> - </mutation> - <value name="ARG0"> - <block type="variables_get" id="s+91j;@jAXoyAP!%ls#{"> - <field name="VAR" id=")rK_fR,m=]b(j[{.CtBj">v_slow</field> - </block> - </value> - <value name="ARG1"> - <block type="math_number" id="xovp]RW^z_.J8r09vIYb"> - <field name="NUM">10</field> - </block> - </value> + <value name="ARG1"> + <block type="math_number" id="xovp]RW^z_.J8r09vIYb"> + <field name="NUM">10</field> </block> - </next> + </value> + </block> + </next> + </block> + </statement> + <statement name="ELSE"> + <block type="variables_set" id="50o[ObTwzWD=aupUSv#W"> + <field name="VAR" id="vH;^OzJY7dOdepMScU1s">state</field> + <value name="VALUE"> + <block type="text" id="BaG@T;!/Smm@WZeM1+h#"> + <field name="TEXT">NONE</field> </block> - </statement> - <statement name="ELSE"> - <block type="variables_set" id="50o[ObTwzWD=aupUSv#W"> - <field name="VAR" id="vH;^OzJY7dOdepMScU1s">state</field> + </value> + <next> + <block type="variables_set" id="[XyQyt*v|[_TPm5C]YnP"> + <field name="VAR" id="fPH`.@]riH+=v{,A)bP5">cmd</field> <value name="VALUE"> - <block type="text" id="BaG@T;!/Smm@WZeM1+h#"> + <block type="text" id="IaVZ-uIe[M@`VD!(z-d1"> <field name="TEXT">NONE</field> </block> </value> - <next> - <block type="variables_set" id="[XyQyt*v|[_TPm5C]YnP"> - <field name="VAR" id="fPH`.@]riH+=v{,A)bP5">cmd</field> - <value name="VALUE"> - <block type="text" id="IaVZ-uIe[M@`VD!(z-d1"> - <field name="TEXT">NONE</field> - </block> - </value> - </block> - </next> </block> - </statement> + </next> </block> </statement> </block> </statement> + </block> + </statement> + <next> + <block type="display_set_label_text" id="QDZ)v?E3iW-Liq4HKvUn"> + <field name="instance_name">txt_label_ball</field> + <value name="value"> + <shadow type="text" id="B`M|)AOBioxQGjue#9y^"> + <field name="TEXT">abc</field> + </shadow> + <block type="text_format" id="bMzX7EzL+}J^dowK5pv|"> + <mutation items="2"/> + <value name="value"> + <shadow type="text" id="(C2/oN~6=q7Bw[A5`Pz)"> + <field name="TEXT">x:{}, y:{}</field> + </shadow> + </value> + <value name="ADD0"> + <block type="variables_get" id="N3bK$!XutDL@t?7tqOnB"> + <field name="VAR" id="S4.mduNQC(va3iR{oSdB">posx_ball</field> + </block> + </value> + <value name="ADD1"> + <block type="variables_get" id="CIUI@k|{^~}vfJeTSYP2"> + <field name="VAR" id="q#H`+Gwt~43Dh@fu;G-D">posy_ball</field> + </block> + </value> + </block> + </value> <next> - <block type="display_set_label_text" id="QDZ)v?E3iW-Liq4HKvUn"> - <field name="instance_name">txt_label_ball</field> + <block type="display_set_label_text" id="2Ac72_SmdOYaC#|w[dk%"> + <field name="instance_name">txt_label_goal</field> <value name="value"> - <shadow type="text" id="B`M|)AOBioxQGjue#9y^"> + <shadow type="text"> <field name="TEXT">abc</field> </shadow> - <block type="text_format" id="bMzX7EzL+}J^dowK5pv|"> - <mutation items="2"/> + <block type="text_format" id="xXJlH+s%1,D1WcfOkt#6"> + <mutation items="4"/> <value name="value"> - <shadow type="text" id="(C2/oN~6=q7Bw[A5`Pz)"> - <field name="TEXT">x:{}, y:{}</field> + <shadow type="text" id=":(AhX7mg_fQeOGz*xR@g"> + <field name="TEXT">left:{} {}, right:{} {}</field> </shadow> </value> <value name="ADD0"> - <block type="variables_get" id="N3bK$!XutDL@t?7tqOnB"> - <field name="VAR" id="S4.mduNQC(va3iR{oSdB">posx_ball</field> + <block type="variables_get" id="ppSdz+]@cvkJ)r-5HdD^"> + <field name="VAR" id="=2ARo+;2DS07SU~j29Fk">posx_goal_left</field> </block> </value> <value name="ADD1"> - <block type="variables_get" id="CIUI@k|{^~}vfJeTSYP2"> - <field name="VAR" id="q#H`+Gwt~43Dh@fu;G-D">posy_ball</field> + <block type="variables_get" id="Fe?~n3W$cZh6_K]^Dsyx"> + <field name="VAR" id="a8;eFhj+gj?)7exUyU;p">posy_goal_left</field> + </block> + </value> + <value name="ADD2"> + <block type="variables_get" id="^dcWdBa0xHuSF#~S44{U"> + <field name="VAR" id="7Tp~7_.qfmJN0SR]5p}F">posx_goal_right</field> + </block> + </value> + <value name="ADD3"> + <block type="variables_get" id="kuo|)Aebqd#k+PebfFA^"> + <field name="VAR" id="+j/X+RCIMajR28(u#7DG">posy_goal_right</field> </block> </value> </block> </value> <next> - <block type="display_set_label_text" id="2Ac72_SmdOYaC#|w[dk%"> - <field name="instance_name">txt_label_goal</field> + <block type="display_set_label_text" id="Fn{?O{el^_@qD+)BLOev"> + <field name="instance_name">txt_label_goal_x</field> <value name="value"> - <shadow type="text"> + <shadow type="text" id="}wMC[[!{mYT9LBcx}EtT"> <field name="TEXT">abc</field> </shadow> - <block type="text_format" id="xXJlH+s%1,D1WcfOkt#6"> - <mutation items="6"/> + <block type="text_format" id="zV,[,3k$`H2B5D[4-c.d"> + <mutation items="2"/> <value name="value"> - <shadow type="text" id=":(AhX7mg_fQeOGz*xR@g"> - <field name="TEXT">left:{} {}, right:{} {}, p:{}, w:{}</field> + <shadow type="text" id="pLr%-2L|$X9_^)k~m;J("> + <field name="TEXT">p:{}, w:{}</field> </shadow> </value> <value name="ADD0"> - <block type="variables_get" id="ppSdz+]@cvkJ)r-5HdD^"> - <field name="VAR" id="=2ARo+;2DS07SU~j29Fk">posx_goal_left</field> - </block> - </value> - <value name="ADD1"> - <block type="variables_get" id="Fe?~n3W$cZh6_K]^Dsyx"> - <field name="VAR" id="a8;eFhj+gj?)7exUyU;p">posy_goal_left</field> - </block> - </value> - <value name="ADD2"> - <block type="variables_get" id="^dcWdBa0xHuSF#~S44{U"> - <field name="VAR" id="7Tp~7_.qfmJN0SR]5p}F">posx_goal_right</field> - </block> - </value> - <value name="ADD3"> - <block type="variables_get" id="kuo|)Aebqd#k+PebfFA^"> - <field name="VAR" id="+j/X+RCIMajR28(u#7DG">posy_goal_right</field> - </block> - </value> - <value name="ADD4"> - <block type="variables_get" id="#`/5m819@:#HS;yIM[b0"> + <block type="variables_get" id="1/;a8^BqFI^^?=Ea;HdL"> <field name="VAR" id="{]]L-TSC^#XtGnVinxf[">posx_goal_both</field> </block> </value> - <value name="ADD5"> - <block type="variables_get" id="FtuJ6v[UEy/YEuJ3qlsr"> + <value name="ADD1"> + <block type="variables_get" id="CD]^^%xF/1z=fT)6mSMr"> <field name="VAR" id="v0BvP7[91TGaMpQG$r0f">goal_width</field> </block> </value> </block> </value> <next> - <block type="display_set_label_text" id="Fn{?O{el^_@qD+)BLOev"> - <field name="instance_name">txt_label_counters</field> - <value name="value"> - <shadow type="text"> - <field name="TEXT">abc</field> + <block type="text_print" id="##1hG%c^2!NKjN~e1lyg"> + <value name="TEXT"> + <shadow type="text" id="p_E`2=Fj^pN,D}gxPEvW"> + <field name="TEXT"/> </shadow> - <block type="text_format" id="XRX)WXoaE,9N}4t?YAI#"> - <mutation items="1"/> + <block type="text_format" id="mB*d7.SSna@S_Ds5Y4[o"> + <mutation items="12"/> <value name="value"> - <shadow type="text" id="UlS|}~2{uOl01S@(ahiE"> - <field name="TEXT">{}</field> + <shadow type="text" id="a{L7ErJR}=Flx|}3~+X4"> + <field name="TEXT">{}:{} GOAL left: {} {}, right:{} {}, p:{}, w:{} BALL_pos:{},{} v_x:{} v_y:{}</field> </shadow> </value> <value name="ADD0"> - <block type="variables_get" id="XdyZ*L#*0E`A`0/3UYf~"> - <field name="VAR" id="5@U(%o_ghQ1;jiB#odH8">counters</field> + <block type="variables_get" id="UGc[vu*b~9D^!p.3?7mo"> + <field name="VAR" id="vH;^OzJY7dOdepMScU1s">state</field> + </block> + </value> + <value name="ADD1"> + <block type="variables_get" id="wVt[k#I:X+:T`RVkRf]K"> + <field name="VAR" id="fPH`.@]riH+=v{,A)bP5">cmd</field> + </block> + </value> + <value name="ADD2"> + <block type="variables_get" id="+?O{K7(C)vw`Y6!T4L(o"> + <field name="VAR" id="=2ARo+;2DS07SU~j29Fk">posx_goal_left</field> + </block> + </value> + <value name="ADD3"> + <block type="variables_get" id="kiYnqn=QqrO`bh^F{AQ#"> + <field name="VAR" id="a8;eFhj+gj?)7exUyU;p">posy_goal_left</field> + </block> + </value> + <value name="ADD4"> + <block type="variables_get" id="/(B3zJewppd~EofXj-kV"> + <field name="VAR" id="7Tp~7_.qfmJN0SR]5p}F">posx_goal_right</field> + </block> + </value> + <value name="ADD5"> + <block type="variables_get" id=",3+x;7D(bN-41WySQn.v"> + <field name="VAR" id="+j/X+RCIMajR28(u#7DG">posy_goal_right</field> + </block> + </value> + <value name="ADD6"> + <block type="variables_get" id="u$4~ei085+j]JF61p!Kz"> + <field name="VAR" id="{]]L-TSC^#XtGnVinxf[">posx_goal_both</field> + </block> + </value> + <value name="ADD7"> + <block type="variables_get" id="#umK_pdUK0;[tcAYO_7s"> + <field name="VAR" id="v0BvP7[91TGaMpQG$r0f">goal_width</field> + </block> + </value> + <value name="ADD8"> + <block type="variables_get" id="sPxj5C*ZzYUH*$WCe4|q"> + <field name="VAR" id="S4.mduNQC(va3iR{oSdB">posx_ball</field> + </block> + </value> + <value name="ADD9"> + <block type="variables_get" id="~vY0WPr#jWq#SxvDb1@n"> + <field name="VAR" id="q#H`+Gwt~43Dh@fu;G-D">posy_ball</field> + </block> + </value> + <value name="ADD10"> + <block type="variables_get" id="r!O8lsSDk:Xs*=-;)LRu"> + <field name="VAR" id="O=Lc:FQ[]f3iuM/V@.mv">v_var_ball_xpos</field> + </block> + </value> + <value name="ADD11"> + <block type="variables_get" id="`fG05b:bzq8[q?bquCg6"> + <field name="VAR" id=";S3?%3)**s[[l~Aq3*,{">v_var_ball_ypos</field> </block> </value> </block> </value> <next> - <block type="text_print" id="##1hG%c^2!NKjN~e1lyg"> - <value name="TEXT"> - <shadow type="text" id="p_E`2=Fj^pN,D}gxPEvW"> - <field name="TEXT"/> - </shadow> - <block type="text_format" id="mB*d7.SSna@S_Ds5Y4[o"> - <mutation items="12"/> + <block type="procedures_callnoreturn" id="O6U,(~H4n-^0fP^x)_,{"> + <mutation name="checkTimeoutsSetGoalBoth"/> + <next> + <block type="util_wait_for" id="U4XL;U0gG@tD~]*kp|L{"> + <field name="format">ms</field> <value name="value"> - <shadow type="text" id="a{L7ErJR}=Flx|}3~+X4"> - <field name="TEXT">{}:{} GOAL left: {} {}, right:{} {}, p:{}, w:{} BALL_pos:{},{} v_x:{} v_y:{}</field> + <shadow type="math_number" id="E9K@*OZ(Ftp5CGt}.9cT"> + <field name="NUM">80</field> </shadow> </value> - <value name="ADD0"> - <block type="variables_get" id="UGc[vu*b~9D^!p.3?7mo"> - <field name="VAR" id="vH;^OzJY7dOdepMScU1s">state</field> - </block> - </value> - <value name="ADD1"> - <block type="variables_get" id="wVt[k#I:X+:T`RVkRf]K"> - <field name="VAR" id="fPH`.@]riH+=v{,A)bP5">cmd</field> - </block> - </value> - <value name="ADD2"> - <block type="variables_get" id="+?O{K7(C)vw`Y6!T4L(o"> - <field name="VAR" id="=2ARo+;2DS07SU~j29Fk">posx_goal_left</field> - </block> - </value> - <value name="ADD3"> - <block type="variables_get" id="kiYnqn=QqrO`bh^F{AQ#"> - <field name="VAR" id="a8;eFhj+gj?)7exUyU;p">posy_goal_left</field> - </block> - </value> - <value name="ADD4"> - <block type="variables_get" id="/(B3zJewppd~EofXj-kV"> - <field name="VAR" id="7Tp~7_.qfmJN0SR]5p}F">posx_goal_right</field> - </block> - </value> - <value name="ADD5"> - <block type="variables_get" id=",3+x;7D(bN-41WySQn.v"> - <field name="VAR" id="+j/X+RCIMajR28(u#7DG">posy_goal_right</field> - </block> - </value> - <value name="ADD6"> - <block type="variables_get" id="u$4~ei085+j]JF61p!Kz"> - <field name="VAR" id="{]]L-TSC^#XtGnVinxf[">posx_goal_both</field> - </block> - </value> - <value name="ADD7"> - <block type="variables_get" id="#umK_pdUK0;[tcAYO_7s"> - <field name="VAR" id="v0BvP7[91TGaMpQG$r0f">goal_width</field> - </block> - </value> - <value name="ADD8"> - <block type="variables_get" id="sPxj5C*ZzYUH*$WCe4|q"> - <field name="VAR" id="S4.mduNQC(va3iR{oSdB">posx_ball</field> - </block> - </value> - <value name="ADD9"> - <block type="variables_get" id="~vY0WPr#jWq#SxvDb1@n"> - <field name="VAR" id="q#H`+Gwt~43Dh@fu;G-D">posy_ball</field> - </block> - </value> - <value name="ADD10"> - <block type="variables_get" id="r!O8lsSDk:Xs*=-;)LRu"> - <field name="VAR" id="O=Lc:FQ[]f3iuM/V@.mv">v_var_ball_xpos</field> - </block> - </value> - <value name="ADD11"> - <block type="variables_get" id="`fG05b:bzq8[q?bquCg6"> - <field name="VAR" id=";S3?%3)**s[[l~Aq3*,{">v_var_ball_ypos</field> - </block> - </value> - </block> - </value> - <next> - <block type="procedures_callnoreturn" id="O6U,(~H4n-^0fP^x)_,{"> - <mutation name="checkTimeoutsSetGoalBoth"/> - <next> - <block type="util_wait_for" id="U4XL;U0gG@tD~]*kp|L{"> - <field name="format">ms</field> - <value name="value"> - <shadow type="math_number" id="E9K@*OZ(Ftp5CGt}.9cT"> - <field name="NUM">80</field> - </shadow> - </value> - </block> - </next> </block> </next> </block> @@ -1223,9 +1187,9 @@ </block> </next> </block> - </statement> + </next> </block> - </next> + </statement> </block> </next> </block> @@ -1281,7 +1245,7 @@ </block> </statement> </block> - <block type="procedures_defnoreturn" id="BJV|hZc!#JXq:io7MmM`" x="0" y="4239"> + <block type="procedures_defnoreturn" id="BJV|hZc!#JXq:io7MmM`" x="0" y="4119"> <mutation> <arg name="shot" varid="ymkMx:g,wGvcvRtYUanL" argid=":62/?4I]sXmWy2!AnMxj"/> </mutation> @@ -1646,10 +1610,11 @@ </block> </statement> </block> - <block type="procedures_defnoreturn" id="N2EC5uK:$~0ERXAdK0!y" x="0" y="5478"> + <block type="procedures_defnoreturn" id="N2EC5uK:$~0ERXAdK0!y" x="0" y="5358"> <field name="NAME">checkTimeoutsSetGoalBoth</field> <statement name="STACK"> - <block type="controls_if" id="63FfwOqK(iF!2~DVc~`p"> + <block type="controls_if" id="fRY+n0,2r=7:t9`dVQYz"> + <mutation elseif="0" else="1"/> <value name="IF0"> <block type="logic_operation" id="L/E/`yRU.kw4/D+HP-F[" inline="false"> <field name="OP">AND</field> @@ -1731,6 +1696,22 @@ </next> </block> </statement> + <statement name="ELSE"> + <block type="variables_set" id="*JOq_(7.hU!xqY=q+|pP"> + <field name="VAR" id="v0BvP7[91TGaMpQG$r0f">goal_width</field> + <value name="VALUE"> + <block type="logic_null" id="c%XG[e/MPkRx/,9jseN!"/> + </value> + <next> + <block type="variables_set" id="DBZi_Q9eAo3s#q*X==jX"> + <field name="VAR" id="{]]L-TSC^#XtGnVinxf[">posx_goal_both</field> + <value name="VALUE"> + <block type="logic_null" id="W019CrRkesv+3sHR8OVd"/> + </value> + </block> + </next> + </block> + </statement> <next> <block type="controls_if" id="o.;j7*F0}TW}ju0E18(_"> <value name="IF0"> @@ -1869,7 +1850,7 @@ </block> </statement> </block> - <block type="camera_on_ball_detected" id="dgC*A|KHMC_R5S#ZRk}d" x="0" y="6143"> + <block type="camera_on_ball_detected" id="dgC*A|KHMC_R5S#ZRk}d" x="0" y="6093"> <field name="instance_name">ball_detector</field> <statement name="statement"> <block type="variables_set" id="=2/,IQfcLO{_5PNd3UK~"> @@ -2070,7 +2051,7 @@ </block> </statement> </block> - <block type="camera_on_ball_detected" id="Rg2Gt(0WT:J2|Us~[j.3" x="0" y="6810"> + <block type="camera_on_ball_detected" id="Rg2Gt(0WT:J2|Us~[j.3" x="0" y="6760"> <field name="instance_name">ball_detector_goal_left</field> <statement name="statement"> <block type="variables_set" id="kvK,D4e%04[?+!jq*Lch"> @@ -2151,7 +2132,7 @@ </block> </statement> </block> - <block type="camera_on_ball_detected" id="(?slhGsN^:d1`vP{j9#|" x="0" y="7141"> + <block type="camera_on_ball_detected" id="(?slhGsN^:d1`vP{j9#|" x="0" y="7091"> <field name="instance_name">ball_detector_goal_right</field> <statement name="statement"> <block type="variables_set" id="0!1?#@4|tcM8+U6E[$Tl"> @@ -2232,199 +2213,7 @@ </block> </statement> </block> - <block type="counter_event" id="T^aHOKaV|bU#ZeZfn[GJ" x="0" y="7472"> - <value name="condition"> - <shadow type="counter_if_value" id="9`P*eh,|:Wnytp?G[|;{"> - <field name="instance_name">TXT_M_C1_motor_step_counter</field> - <field name="compare_operation">>=</field> - <value name="value"> - <shadow type="math_number" id="5Xl(_Jtmh*kkjV@06sU4"> - <field name="NUM">0</field> - </shadow> - </value> - </shadow> - </value> - <statement name="statement"> - <block type="lists_setIndex" id="+*/p)biB@:ZE)7i/D*eN"> - <mutation at="true"/> - <field name="MODE">SET</field> - <field name="WHERE">FROM_START</field> - <value name="LIST"> - <block type="variables_get" id="tm1$ukIcJ0D!/GLak4Ut"> - <field name="VAR" id="5@U(%o_ghQ1;jiB#odH8">counters</field> - </block> - </value> - <value name="AT"> - <block type="math_number" id="HUZdEA9c!MBYE/=;9c4,"> - <field name="NUM">1</field> - </block> - </value> - <value name="TO"> - <block type="counter_get_value" id="HJ8AeDsgADK_]_Zx:(rx"> - <field name="instance_name">TXT_M_C1_motor_step_counter</field> - </block> - </value> - <next> - <block type="display_set_label_text" id="U]A5v^]#*i_{o(=_~m#9"> - <field name="instance_name">txt_label_counters</field> - <value name="value"> - <shadow type="text" id=":[wX!6o2X57KB5_uW$?g"> - <field name="TEXT">abc</field> - </shadow> - <block type="variables_get" id="jk2Cakj:3K*LVEx9fO#9"> - <field name="VAR" id="5@U(%o_ghQ1;jiB#odH8">counters</field> - </block> - </value> - </block> - </next> - </block> - </statement> - </block> - <block type="counter_event" id="7wA~J+BkZ5~nV6aI|fLZ" x="0" y="7619"> - <value name="condition"> - <shadow type="counter_if_value" id="RDF|2PoXWvG^_k{FB37U"> - <field name="instance_name">TXT_M_C2_motor_step_counter</field> - <field name="compare_operation">>=</field> - <value name="value"> - <shadow type="math_number" id="}v;NEU2I-b+XB;eJb_8^"> - <field name="NUM">0</field> - </shadow> - </value> - </shadow> - </value> - <statement name="statement"> - <block type="lists_setIndex" id="F3O6H[o7DeuMc4EYIlK7"> - <mutation at="true"/> - <field name="MODE">SET</field> - <field name="WHERE">FROM_START</field> - <value name="LIST"> - <block type="variables_get" id="SrzEHb)xO0~tZ_L;;:*6"> - <field name="VAR" id="5@U(%o_ghQ1;jiB#odH8">counters</field> - </block> - </value> - <value name="AT"> - <block type="math_number" id="t/d4)oJyn4/xDN_H+Gc$"> - <field name="NUM">2</field> - </block> - </value> - <value name="TO"> - <block type="counter_get_value" id="TyyeB9r=L2Axv9:)!99P"> - <field name="instance_name">TXT_M_C2_motor_step_counter</field> - </block> - </value> - <next> - <block type="display_set_label_text" id="^$c%DR+x0]1{?8B+._e["> - <field name="instance_name">txt_label_counters</field> - <value name="value"> - <shadow type="text"> - <field name="TEXT">abc</field> - </shadow> - <block type="variables_get" id="yxoB?]I`o1i,GZZxsT99"> - <field name="VAR" id="5@U(%o_ghQ1;jiB#odH8">counters</field> - </block> - </value> - </block> - </next> - </block> - </statement> - </block> - <block type="counter_event" id="Nv;e.HwUkTK/=(qEs~82" x="0" y="7766"> - <value name="condition"> - <shadow type="counter_if_value" id="05ihu;VYh*tmqA78pJQL"> - <field name="instance_name">TXT_M_C3_motor_step_counter</field> - <field name="compare_operation">>=</field> - <value name="value"> - <shadow type="math_number" id="wad2)m_Xkx5}`^R4pZJf"> - <field name="NUM">0</field> - </shadow> - </value> - </shadow> - </value> - <statement name="statement"> - <block type="lists_setIndex" id="SbWu+L,iw0_ij(;+FMEt"> - <mutation at="true"/> - <field name="MODE">SET</field> - <field name="WHERE">FROM_START</field> - <value name="LIST"> - <block type="variables_get" id="r*vZ!`+v(7UQG]?uJ`H~"> - <field name="VAR" id="5@U(%o_ghQ1;jiB#odH8">counters</field> - </block> - </value> - <value name="AT"> - <block type="math_number" id="iU9Ld7bh=+wGqLS.r-WO"> - <field name="NUM">3</field> - </block> - </value> - <value name="TO"> - <block type="counter_get_value" id="gT;9PeIm8kcUEZ@,M]y#"> - <field name="instance_name">TXT_M_C3_motor_step_counter</field> - </block> - </value> - <next> - <block type="display_set_label_text" id="39cs2hab8c0]XI,eCzQT"> - <field name="instance_name">txt_label_counters</field> - <value name="value"> - <shadow type="text"> - <field name="TEXT">abc</field> - </shadow> - <block type="variables_get" id="e8uqOpay*)3CoYXGpAcZ"> - <field name="VAR" id="5@U(%o_ghQ1;jiB#odH8">counters</field> - </block> - </value> - </block> - </next> - </block> - </statement> - </block> - <block type="counter_event" id="j|Pz^uHewb7]si9}3az3" x="0" y="7913"> - <value name="condition"> - <shadow type="counter_if_value" id="N9]b*Kn_Nxk}[I9e!^Z."> - <field name="instance_name">TXT_M_C4_motor_step_counter</field> - <field name="compare_operation">>=</field> - <value name="value"> - <shadow type="math_number" id="tuFr25CcTXx3l$!b){%{"> - <field name="NUM">0</field> - </shadow> - </value> - </shadow> - </value> - <statement name="statement"> - <block type="lists_setIndex" id="eb6^}]rpfB@?MRu8-g}K"> - <mutation at="true"/> - <field name="MODE">SET</field> - <field name="WHERE">FROM_START</field> - <value name="LIST"> - <block type="variables_get" id="rl=7;!=vM{2]GEWoJ~ws"> - <field name="VAR" id="5@U(%o_ghQ1;jiB#odH8">counters</field> - </block> - </value> - <value name="AT"> - <block type="math_number" id="2)wsT9dj3mq=ai?m!eD5"> - <field name="NUM">4</field> - </block> - </value> - <value name="TO"> - <block type="counter_get_value" id="*sHixWWo*TJ-^N9/}Hh#"> - <field name="instance_name">TXT_M_C4_motor_step_counter</field> - </block> - </value> - <next> - <block type="display_set_label_text" id="{=2n9bd|c|$3;uM@}m~B"> - <field name="instance_name">txt_label_counters</field> - <value name="value"> - <shadow type="text"> - <field name="TEXT">abc</field> - </shadow> - <block type="variables_get" id="}~Ru`N3Z!CY/K,tcV{N$"> - <field name="VAR" id="5@U(%o_ghQ1;jiB#odH8">counters</field> - </block> - </value> - </block> - </next> - </block> - </statement> - </block> - <block type="input_event" id="j(TuhJ0G}{^qGSq:26FY" x="0" y="8060"> + <block type="input_event" id="j(TuhJ0G}{^qGSq:26FY" x="0" y="7422"> <value name="condition"> <block type="input_photo_transistor_if_state" id="dX]-jf`=2/tNnEnHfKvx"> <field name="instance_name">TXT_M_I8_photo_transistor</field> @@ -2447,7 +2236,7 @@ </block> </statement> </block> - <block type="procedures_defnoreturn" id="RyK*td9aN5aR;@gw4f)+" x="0" y="8197"> + <block type="procedures_defnoreturn" id="RyK*td9aN5aR;@gw4f)+" x="0" y="7559"> <field name="NAME">shotBall</field> <statement name="STACK"> <block type="variables_set" id="l,2u2WF|]I#%kDS#5O7-"> @@ -2559,7 +2348,7 @@ </block> </statement> </block> - <block type="procedures_defnoreturn" id="na=DVwj{P1Npv6z`ZSY{" x="0" y="8754"> + <block type="procedures_defnoreturn" id="na=DVwj{P1Npv6z`ZSY{" x="0" y="8116"> <field name="NAME">soundGoal</field> <statement name="STACK"> <block type="variables_set" id="o^c1yss2pIv%8YmX`=6X"> @@ -2600,7 +2389,7 @@ </block> </statement> </block> - <block type="procedures_defnoreturn" id="UFM0X7|X:*ja#f+^7kz;" x="0" y="8948"> + <block type="procedures_defnoreturn" id="UFM0X7|X:*ja#f+^7kz;" x="0" y="8310"> <mutation> <arg name="v" varid="DfDz@$]?^P=(6r:%^xC*" argid="-fFb#6a:h}yA(|L+pf*l"/> <arg name="ticks" varid="l9lR0!)Laya}3RYVW(ZQ" argid="h?@dWX*~x|BDzo:O{is["/> @@ -2697,7 +2486,7 @@ </block> </statement> </block> - <block type="procedures_defnoreturn" id="*i[s2YTWD*g9HS4dxkPq" x="0" y="9361"> + <block type="procedures_defnoreturn" id="*i[s2YTWD*g9HS4dxkPq" x="0" y="8723"> <mutation> <arg name="v" varid="DfDz@$]?^P=(6r:%^xC*" argid="k6At@e}Qga_x|SmVlf6C"/> <arg name="ticks" varid="l9lR0!)Laya}3RYVW(ZQ" argid="~VyZflQ+9HCPP`ynQ/=Y"/> @@ -2794,7 +2583,7 @@ </block> </statement> </block> - <block type="procedures_defnoreturn" id="oSa9Ly*^-c^M{$gkMZt1" x="0" y="9774"> + <block type="procedures_defnoreturn" id="oSa9Ly*^-c^M{$gkMZt1" x="0" y="9136"> <mutation> <arg name="v" varid="DfDz@$]?^P=(6r:%^xC*" argid="K)Z,8|d5@gck+Q]pnW01"/> <arg name="ticks" varid="l9lR0!)Laya}3RYVW(ZQ" argid="(Id`t]O(jxfZJay}20X{"/> @@ -2870,7 +2659,7 @@ </block> </statement> </block> - <block type="procedures_defnoreturn" id="G@]xamrhDPW$7uQ6oPo#" x="0" y="10159"> + <block type="procedures_defnoreturn" id="G@]xamrhDPW$7uQ6oPo#" x="0" y="9521"> <mutation> <arg name="v" varid="DfDz@$]?^P=(6r:%^xC*" argid="_mFFsmoZwL{(llRvf-eW"/> <arg name="ticks" varid="l9lR0!)Laya}3RYVW(ZQ" argid="aNHXtqe[T`=Y[mqp`ZDN"/> @@ -2946,7 +2735,7 @@ </block> </statement> </block> - <block type="procedures_defnoreturn" id="5Hv=PFtVvPQA=IZrkJfU" x="0" y="10544"> + <block type="procedures_defnoreturn" id="5Hv=PFtVvPQA=IZrkJfU" x="0" y="9906"> <mutation> <arg name="v" varid="DfDz@$]?^P=(6r:%^xC*" argid="~d8Z+AHZ!wz|G]JHW0lQ"/> <arg name="ticks" varid="l9lR0!)Laya}3RYVW(ZQ" argid="jRMx@L,Ya|zd@/bBb#1T"/> @@ -3037,7 +2826,7 @@ </block> </statement> </block> - <block type="procedures_defnoreturn" id="[S@[MO!Z/cNt:Jsg4dd}" x="0" y="10985"> + <block type="procedures_defnoreturn" id="[S@[MO!Z/cNt:Jsg4dd}" x="0" y="10347"> <mutation> <arg name="v" varid="DfDz@$]?^P=(6r:%^xC*" argid="8Z2n_ZVA.)85]V7j%3;7"/> <arg name="ticks" varid="l9lR0!)Laya}3RYVW(ZQ" argid="J(gJ~*9ZJJa,[V1)[xn#"/> diff --git a/omniwheels_x4_soccer_goal.py b/omniwheels_x4_soccer_goal.py index 21f192cfb756f47a9ec71fbd5427c963bee0d2dd..9f1bc42cd7974801606f74abbdbfdb18362d4d24 100644 --- a/omniwheels_x4_soccer_goal.py +++ b/omniwheels_x4_soccer_goal.py @@ -21,7 +21,6 @@ goal_width = None posx_ball = None posx_goal_left = None posx_goal_right = None -counters = None x_min = None posx_goal_both = None posy_ball = None @@ -37,10 +36,13 @@ y_ball_touch = None y_ball_near = None search_dir_left = None def checkTimeoutsSetGoalBoth(): - global v, ticks, shot, factor_x, ts_ball, ts_goal_left, ts_goal_right, cmd, state, factor_y, goal_width, posx_ball, posx_goal_left, posx_goal_right, counters, x_min, posx_goal_both, posy_ball, posy_goal_left, posy_goal_right, x_max, v_var_ball_xpos, v_slow, y_ball_far, v_var_ball_ypos, v_fast, y_ball_touch, y_ball_near, search_dir_left + global v, ticks, shot, factor_x, ts_ball, ts_goal_left, ts_goal_right, cmd, state, factor_y, goal_width, posx_ball, posx_goal_left, posx_goal_right, x_min, posx_goal_both, posy_ball, posy_goal_left, posy_goal_right, x_max, v_var_ball_xpos, v_slow, y_ball_far, v_var_ball_ypos, v_fast, y_ball_touch, y_ball_near, search_dir_left if posx_goal_left != None and posx_goal_right != None: goal_width = posx_goal_right - posx_goal_left posx_goal_both = posx_goal_left + goal_width / 2 + else: + goal_width = None + posx_goal_both = None if (time.time() * 1000) - ts_ball > 500: posx_ball = None posy_ball = None @@ -54,7 +56,7 @@ def checkTimeoutsSetGoalBoth(): def stepBall(shot): - global v, ticks, factor_x, ts_ball, ts_goal_left, ts_goal_right, cmd, state, factor_y, goal_width, posx_ball, posx_goal_left, posx_goal_right, counters, x_min, posx_goal_both, posy_ball, posy_goal_left, posy_goal_right, x_max, v_var_ball_xpos, v_slow, y_ball_far, v_var_ball_ypos, v_fast, y_ball_touch, y_ball_near, search_dir_left + global v, ticks, factor_x, ts_ball, ts_goal_left, ts_goal_right, cmd, state, factor_y, goal_width, posx_ball, posx_goal_left, posx_goal_right, x_min, posx_goal_both, posy_ball, posy_goal_left, posy_goal_right, x_max, v_var_ball_xpos, v_slow, y_ball_far, v_var_ball_ypos, v_fast, y_ball_touch, y_ball_near, search_dir_left state = 'stepBall' if posx_ball < x_min: left(v_slow, round(math.fabs(posx_ball) * 0.07)) @@ -76,7 +78,7 @@ def stepBall(shot): def ball_callback(event): - global v, ticks, shot, factor_x, ts_ball, ts_goal_left, ts_goal_right, cmd, state, factor_y, goal_width, posx_ball, posx_goal_left, posx_goal_right, counters, x_min, posx_goal_both, posy_ball, posy_goal_left, posy_goal_right, x_max, v_var_ball_xpos, v_slow, y_ball_far, v_var_ball_ypos, v_fast, y_ball_touch, y_ball_near, search_dir_left + global v, ticks, shot, factor_x, ts_ball, ts_goal_left, ts_goal_right, cmd, state, factor_y, goal_width, posx_ball, posx_goal_left, posx_goal_right, x_min, posx_goal_both, posy_ball, posy_goal_left, posy_goal_right, x_max, v_var_ball_xpos, v_slow, y_ball_far, v_var_ball_ypos, v_fast, y_ball_touch, y_ball_near, search_dir_left ts_ball = (time.time() * 1000) posx_ball = event.value.x posy_ball = event.value.y @@ -89,7 +91,7 @@ ball_detector.add_detection_listener(ball_callback) def ball_callback2(event): - global v, ticks, shot, factor_x, ts_ball, ts_goal_left, ts_goal_right, cmd, state, factor_y, goal_width, posx_ball, posx_goal_left, posx_goal_right, counters, x_min, posx_goal_both, posy_ball, posy_goal_left, posy_goal_right, x_max, v_var_ball_xpos, v_slow, y_ball_far, v_var_ball_ypos, v_fast, y_ball_touch, y_ball_near, search_dir_left + global v, ticks, shot, factor_x, ts_ball, ts_goal_left, ts_goal_right, cmd, state, factor_y, goal_width, posx_ball, posx_goal_left, posx_goal_right, x_min, posx_goal_both, posy_ball, posy_goal_left, posy_goal_right, x_max, v_var_ball_xpos, v_slow, y_ball_far, v_var_ball_ypos, v_fast, y_ball_touch, y_ball_near, search_dir_left ts_goal_left = (time.time() * 1000) posx_goal_left = event.value.x posy_goal_left = event.value.y @@ -100,7 +102,7 @@ ball_detector_goal_left.add_detection_listener(ball_callback2) def ball_callback23(event): - global v, ticks, shot, factor_x, ts_ball, ts_goal_left, ts_goal_right, cmd, state, factor_y, goal_width, posx_ball, posx_goal_left, posx_goal_right, counters, x_min, posx_goal_both, posy_ball, posy_goal_left, posy_goal_right, x_max, v_var_ball_xpos, v_slow, y_ball_far, v_var_ball_ypos, v_fast, y_ball_touch, y_ball_near, search_dir_left + global v, ticks, shot, factor_x, ts_ball, ts_goal_left, ts_goal_right, cmd, state, factor_y, goal_width, posx_ball, posx_goal_left, posx_goal_right, x_min, posx_goal_both, posy_ball, posy_goal_left, posy_goal_right, x_max, v_var_ball_xpos, v_slow, y_ball_far, v_var_ball_ypos, v_fast, y_ball_touch, y_ball_near, search_dir_left ts_goal_right = (time.time() * 1000) posx_goal_right = event.value.x posy_goal_right = event.value.y @@ -111,57 +113,17 @@ ball_detector_goal_right.add_detection_listener(ball_callback23) def callback(event): - global v, ticks, shot, factor_x, ts_ball, ts_goal_left, ts_goal_right, cmd, state, factor_y, goal_width, posx_ball, posx_goal_left, posx_goal_right, counters, x_min, posx_goal_both, posy_ball, posy_goal_left, posy_goal_right, x_max, v_var_ball_xpos, v_slow, y_ball_far, v_var_ball_ypos, v_fast, y_ball_touch, y_ball_near, search_dir_left - if TXT_M_C1_motor_step_counter.get_count() >= 0: - counters[0] = TXT_M_C1_motor_step_counter.get_count() - display.set_attr("txt_label_counters.text", str(counters)) - - -TXT_M_C1_motor_step_counter.add_change_listener("count", callback) - - -def callback2(event): - global v, ticks, shot, factor_x, ts_ball, ts_goal_left, ts_goal_right, cmd, state, factor_y, goal_width, posx_ball, posx_goal_left, posx_goal_right, counters, x_min, posx_goal_both, posy_ball, posy_goal_left, posy_goal_right, x_max, v_var_ball_xpos, v_slow, y_ball_far, v_var_ball_ypos, v_fast, y_ball_touch, y_ball_near, search_dir_left - if TXT_M_C2_motor_step_counter.get_count() >= 0: - counters[1] = TXT_M_C2_motor_step_counter.get_count() - display.set_attr("txt_label_counters.text", str(counters)) - - -TXT_M_C2_motor_step_counter.add_change_listener("count", callback2) - - -def callback3(event): - global v, ticks, shot, factor_x, ts_ball, ts_goal_left, ts_goal_right, cmd, state, factor_y, goal_width, posx_ball, posx_goal_left, posx_goal_right, counters, x_min, posx_goal_both, posy_ball, posy_goal_left, posy_goal_right, x_max, v_var_ball_xpos, v_slow, y_ball_far, v_var_ball_ypos, v_fast, y_ball_touch, y_ball_near, search_dir_left - if TXT_M_C3_motor_step_counter.get_count() >= 0: - counters[2] = TXT_M_C3_motor_step_counter.get_count() - display.set_attr("txt_label_counters.text", str(counters)) - - -TXT_M_C3_motor_step_counter.add_change_listener("count", callback3) - - -def callback4(event): - global v, ticks, shot, factor_x, ts_ball, ts_goal_left, ts_goal_right, cmd, state, factor_y, goal_width, posx_ball, posx_goal_left, posx_goal_right, counters, x_min, posx_goal_both, posy_ball, posy_goal_left, posy_goal_right, x_max, v_var_ball_xpos, v_slow, y_ball_far, v_var_ball_ypos, v_fast, y_ball_touch, y_ball_near, search_dir_left - if TXT_M_C4_motor_step_counter.get_count() >= 0: - counters[3] = TXT_M_C4_motor_step_counter.get_count() - display.set_attr("txt_label_counters.text", str(counters)) - - -TXT_M_C4_motor_step_counter.add_change_listener("count", callback4) - - -def callback5(event): - global v, ticks, shot, factor_x, ts_ball, ts_goal_left, ts_goal_right, cmd, state, factor_y, goal_width, posx_ball, posx_goal_left, posx_goal_right, counters, x_min, posx_goal_both, posy_ball, posy_goal_left, posy_goal_right, x_max, v_var_ball_xpos, v_slow, y_ball_far, v_var_ball_ypos, v_fast, y_ball_touch, y_ball_near, search_dir_left + global v, ticks, shot, factor_x, ts_ball, ts_goal_left, ts_goal_right, cmd, state, factor_y, goal_width, posx_ball, posx_goal_left, posx_goal_right, x_min, posx_goal_both, posy_ball, posy_goal_left, posy_goal_right, x_max, v_var_ball_xpos, v_slow, y_ball_far, v_var_ball_ypos, v_fast, y_ball_touch, y_ball_near, search_dir_left if TXT_M_I8_photo_transistor.is_dark(): shotBall() time.sleep(5) -TXT_M_I8_photo_transistor.add_change_listener("dark", callback5) +TXT_M_I8_photo_transistor.add_change_listener("dark", callback) def shotBall(): - global v, ticks, shot, factor_x, ts_ball, ts_goal_left, ts_goal_right, cmd, state, factor_y, goal_width, posx_ball, posx_goal_left, posx_goal_right, counters, x_min, posx_goal_both, posy_ball, posy_goal_left, posy_goal_right, x_max, v_var_ball_xpos, v_slow, y_ball_far, v_var_ball_ypos, v_fast, y_ball_touch, y_ball_near, search_dir_left + global v, ticks, shot, factor_x, ts_ball, ts_goal_left, ts_goal_right, cmd, state, factor_y, goal_width, posx_ball, posx_goal_left, posx_goal_right, x_min, posx_goal_both, posy_ball, posy_goal_left, posy_goal_right, x_max, v_var_ball_xpos, v_slow, y_ball_far, v_var_ball_ypos, v_fast, y_ball_touch, y_ball_near, search_dir_left cmd = 'shotBall' TXT_M_S1_servomotor.set_position(int(400)) TXT_M_M1_encodermotor.set_speed(int(512), Motor.CCW) @@ -188,7 +150,7 @@ def shotBall(): def soundGoal(): - global v, ticks, shot, factor_x, ts_ball, ts_goal_left, ts_goal_right, cmd, state, factor_y, goal_width, posx_ball, posx_goal_left, posx_goal_right, counters, x_min, posx_goal_both, posy_ball, posy_goal_left, posy_goal_right, x_max, v_var_ball_xpos, v_slow, y_ball_far, v_var_ball_ypos, v_fast, y_ball_touch, y_ball_near, search_dir_left + global v, ticks, shot, factor_x, ts_ball, ts_goal_left, ts_goal_right, cmd, state, factor_y, goal_width, posx_ball, posx_goal_left, posx_goal_right, x_min, posx_goal_both, posy_ball, posy_goal_left, posy_goal_right, x_max, v_var_ball_xpos, v_slow, y_ball_far, v_var_ball_ypos, v_fast, y_ball_touch, y_ball_near, search_dir_left cmd = 'soundGOAL' TXT_M.get_loudspeaker().play("26_Augenzwinkern.wav", False) display.set_attr("txt_switch_active.checked", str(False).lower()) @@ -199,7 +161,7 @@ def soundGoal(): def turnSideLeft(v, ticks): - global shot, factor_x, ts_ball, ts_goal_left, ts_goal_right, cmd, state, factor_y, goal_width, posx_ball, posx_goal_left, posx_goal_right, counters, x_min, posx_goal_both, posy_ball, posy_goal_left, posy_goal_right, x_max, v_var_ball_xpos, v_slow, y_ball_far, v_var_ball_ypos, v_fast, y_ball_touch, y_ball_near, search_dir_left + global shot, factor_x, ts_ball, ts_goal_left, ts_goal_right, cmd, state, factor_y, goal_width, posx_ball, posx_goal_left, posx_goal_right, x_min, posx_goal_both, posy_ball, posy_goal_left, posy_goal_right, x_max, v_var_ball_xpos, v_slow, y_ball_far, v_var_ball_ypos, v_fast, y_ball_touch, y_ball_near, search_dir_left cmd = 'turnSideLeft' if ticks >= 1: TXT_M_M1_encodermotor.set_speed(int(v_slow), Motor.CCW) @@ -215,7 +177,7 @@ def turnSideLeft(v, ticks): def turnSideRight(v, ticks): - global shot, factor_x, ts_ball, ts_goal_left, ts_goal_right, cmd, state, factor_y, goal_width, posx_ball, posx_goal_left, posx_goal_right, counters, x_min, posx_goal_both, posy_ball, posy_goal_left, posy_goal_right, x_max, v_var_ball_xpos, v_slow, y_ball_far, v_var_ball_ypos, v_fast, y_ball_touch, y_ball_near, search_dir_left + global shot, factor_x, ts_ball, ts_goal_left, ts_goal_right, cmd, state, factor_y, goal_width, posx_ball, posx_goal_left, posx_goal_right, x_min, posx_goal_both, posy_ball, posy_goal_left, posy_goal_right, x_max, v_var_ball_xpos, v_slow, y_ball_far, v_var_ball_ypos, v_fast, y_ball_touch, y_ball_near, search_dir_left cmd = 'turnSideRight' if ticks >= 1: TXT_M_M1_encodermotor.set_speed(int(v_slow), Motor.CW) @@ -231,7 +193,7 @@ def turnSideRight(v, ticks): def fwd(v, ticks): - global shot, factor_x, ts_ball, ts_goal_left, ts_goal_right, cmd, state, factor_y, goal_width, posx_ball, posx_goal_left, posx_goal_right, counters, x_min, posx_goal_both, posy_ball, posy_goal_left, posy_goal_right, x_max, v_var_ball_xpos, v_slow, y_ball_far, v_var_ball_ypos, v_fast, y_ball_touch, y_ball_near, search_dir_left + global shot, factor_x, ts_ball, ts_goal_left, ts_goal_right, cmd, state, factor_y, goal_width, posx_ball, posx_goal_left, posx_goal_right, x_min, posx_goal_both, posy_ball, posy_goal_left, posy_goal_right, x_max, v_var_ball_xpos, v_slow, y_ball_far, v_var_ball_ypos, v_fast, y_ball_touch, y_ball_near, search_dir_left cmd = 'fwd' if ticks >= 1: TXT_M_M1_encodermotor.set_speed(int(v), Motor.CCW) @@ -246,7 +208,7 @@ def fwd(v, ticks): def bwd(v, ticks): - global shot, factor_x, ts_ball, ts_goal_left, ts_goal_right, cmd, state, factor_y, goal_width, posx_ball, posx_goal_left, posx_goal_right, counters, x_min, posx_goal_both, posy_ball, posy_goal_left, posy_goal_right, x_max, v_var_ball_xpos, v_slow, y_ball_far, v_var_ball_ypos, v_fast, y_ball_touch, y_ball_near, search_dir_left + global shot, factor_x, ts_ball, ts_goal_left, ts_goal_right, cmd, state, factor_y, goal_width, posx_ball, posx_goal_left, posx_goal_right, x_min, posx_goal_both, posy_ball, posy_goal_left, posy_goal_right, x_max, v_var_ball_xpos, v_slow, y_ball_far, v_var_ball_ypos, v_fast, y_ball_touch, y_ball_near, search_dir_left cmd = 'bwd' if ticks >= 1: TXT_M_M1_encodermotor.set_speed(int(v), Motor.CW) @@ -261,7 +223,7 @@ def bwd(v, ticks): def left(v, ticks): - global shot, factor_x, ts_ball, ts_goal_left, ts_goal_right, cmd, state, factor_y, goal_width, posx_ball, posx_goal_left, posx_goal_right, counters, x_min, posx_goal_both, posy_ball, posy_goal_left, posy_goal_right, x_max, v_var_ball_xpos, v_slow, y_ball_far, v_var_ball_ypos, v_fast, y_ball_touch, y_ball_near, search_dir_left + global shot, factor_x, ts_ball, ts_goal_left, ts_goal_right, cmd, state, factor_y, goal_width, posx_ball, posx_goal_left, posx_goal_right, x_min, posx_goal_both, posy_ball, posy_goal_left, posy_goal_right, x_max, v_var_ball_xpos, v_slow, y_ball_far, v_var_ball_ypos, v_fast, y_ball_touch, y_ball_near, search_dir_left cmd = 'left ({}, {})'.format(v, ticks) if ticks >= 1: TXT_M_M1_encodermotor.set_speed(int(v), Motor.CCW) @@ -276,7 +238,7 @@ def left(v, ticks): def right(v, ticks): - global shot, factor_x, ts_ball, ts_goal_left, ts_goal_right, cmd, state, factor_y, goal_width, posx_ball, posx_goal_left, posx_goal_right, counters, x_min, posx_goal_both, posy_ball, posy_goal_left, posy_goal_right, x_max, v_var_ball_xpos, v_slow, y_ball_far, v_var_ball_ypos, v_fast, y_ball_touch, y_ball_near, search_dir_left + global shot, factor_x, ts_ball, ts_goal_left, ts_goal_right, cmd, state, factor_y, goal_width, posx_ball, posx_goal_left, posx_goal_right, x_min, posx_goal_both, posy_ball, posy_goal_left, posy_goal_right, x_max, v_var_ball_xpos, v_slow, y_ball_far, v_var_ball_ypos, v_fast, y_ball_touch, y_ball_near, search_dir_left cmd = 'right ({}, {})'.format(v, ticks) if ticks >= 1: TXT_M_M1_encodermotor.set_speed(int(v), Motor.CW) @@ -307,7 +269,6 @@ posx_goal_right = None posy_goal_right = None goal_width = 0 posx_goal_both = 0 -counters = [TXT_M_C1_motor_step_counter.get_count(), TXT_M_C2_motor_step_counter.get_count(), TXT_M_C3_motor_step_counter.get_count(), TXT_M_C4_motor_step_counter.get_count()] posx_ball = None posy_ball = None ts_ball = (time.time() * 1000) @@ -366,8 +327,8 @@ while True: state = 'NONE' cmd = 'NONE' display.set_attr("txt_label_ball.text", str('x:{}, y:{}'.format(posx_ball, posy_ball))) - display.set_attr("txt_label_goal.text", str('left:{} {}, right:{} {}, p:{}, w:{}'.format(posx_goal_left, posy_goal_left, posx_goal_right, posy_goal_right, posx_goal_both, goal_width))) - display.set_attr("txt_label_counters.text", str('{}'.format(counters))) + display.set_attr("txt_label_goal.text", str('left:{} {}, right:{} {}'.format(posx_goal_left, posy_goal_left, posx_goal_right, posy_goal_right))) + display.set_attr("txt_label_goal_x.text", str('p:{}, w:{}'.format(posx_goal_both, goal_width))) print('{}:{} GOAL left: {} {}, right:{} {}, p:{}, w:{} BALL_pos:{},{} v_x:{} v_y:{}'.format(state, cmd, posx_goal_left, posy_goal_left, posx_goal_right, posy_goal_right, posx_goal_both, goal_width, posx_ball, posy_ball, v_var_ball_xpos, v_var_ball_ypos)) checkTimeoutsSetGoalBoth() time.sleep(0.08)