From 0a387609855f617c71d2c52e2a7eb80939643ace Mon Sep 17 00:00:00 2001
From: ft-Demo <fischertechnik-team@fischer.de>
Date: Wed, 27 Oct 2021 07:56:35 +0000
Subject: [PATCH] commit by robo pro coding

---
 omniwheels_x4_soccer_goal.blockly | 1667 ++++++++++++++++-------------
 omniwheels_x4_soccer_goal.py      |   77 +-
 2 files changed, 997 insertions(+), 747 deletions(-)

diff --git a/omniwheels_x4_soccer_goal.blockly b/omniwheels_x4_soccer_goal.blockly
index a0bccfc..9c0d452 100644
--- a/omniwheels_x4_soccer_goal.blockly
+++ b/omniwheels_x4_soccer_goal.blockly
@@ -19,8 +19,8 @@
     <variable id="q#H`+Gwt~43Dh@fu;G-D">posy_ball</variable>
     <variable id="a8;eFhj+gj?)7exUyU;p">posy_goal_left</variable>
     <variable id="+j/X+RCIMajR28(u#7DG">posy_goal_right</variable>
-    <variable id="2G]XEQ3Lhl$dG]=:]8Ge">x_max</variable>
     <variable id=")rK_fR,m=]b(j[{.CtBj">v_slow</variable>
+    <variable id="2G]XEQ3Lhl$dG]=:]8Ge">x_max</variable>
     <variable id="O=Lc:FQ[]f3iuM/V@.mv">v_var_ball_xpos</variable>
     <variable id="}*jl@)UA_Hjh5rc,Gt)c">y_ball_far</variable>
     <variable id="1idj3sw*{G$j`2:II{^5">v_fast</variable>
@@ -28,6 +28,7 @@
     <variable id=";S3?%3)**s[[l~Aq3*,{">v_var_ball_ypos</variable>
     <variable id="09n]XF2CKURQs)nHOfam">y_ball_near</variable>
     <variable id="2Lkg^#Z.uZy(%Nr[26)6">search_dir_left</variable>
+    <variable id="4w5r@LJD+|NUZ5,*H@JC">ts_deltas</variable>
   </variables>
   <block type="start_block" id="1n38UCidqR*}g6g]e[!h" deletable="false" x="0" y="0">
     <statement name="statement">
@@ -230,6 +231,7 @@
                                                                                                               <block type="loop_endless" id="V,Gw25li,3_,;92QCQLj">
                                                                                                                 <statement name="DO">
                                                                                                                   <block type="controls_if" id="LIzedxH5dle@WM!lcbM#">
+                                                                                                                    <mutation elseif="1"/>
                                                                                                                     <value name="IF0">
                                                                                                                       <block type="display_get_switch_state" id="/xkM7bR[)*BEY41xd)JA">
                                                                                                                         <field name="instance_name">txt_switch_ball</field>
@@ -237,769 +239,707 @@
                                                                                                                       </block>
                                                                                                                     </value>
                                                                                                                     <statement name="DO0">
-                                                                                                                      <block type="controls_if" id="aHn#xa9*3UPMZUu37%KD">
-                                                                                                                        <mutation elseif="0" else="1"/>
-                                                                                                                        <value name="IF0">
-                                                                                                                          <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>
+                                                                                                                      <block type="display_set_switch_checked" id="e{dbxbDCSb}eNt)!ipC3">
+                                                                                                                        <field name="instance_name">txt_switch_goal</field>
+                                                                                                                        <field name="property_name">checked</field>
+                                                                                                                        <value name="value">
+                                                                                                                          <shadow type="logic_boolean" id="0c-n$pLvaj^rVI|xcRS%">
+                                                                                                                            <field name="BOOL">FALSE</field>
+                                                                                                                          </shadow>
                                                                                                                         </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>
+                                                                                                                        <next>
+                                                                                                                          <block type="variables_set" id="wOh90NA`HjF.2f-y2+#D">
+                                                                                                                            <field name="VAR" id="vH;^OzJY7dOdepMScU1s">state</field>
+                                                                                                                            <value name="VALUE">
+                                                                                                                              <block type="text" id="p4:REa~1:.qsSzf0Sdwf">
+                                                                                                                                <field name="TEXT">NONE</field>
                                                                                                                               </block>
                                                                                                                             </value>
-                                                                                                                            <statement name="DO0">
-                                                                                                                              <block type="variables_set" id="?=|7j%BS8lgVb|CMk2`B">
-                                                                                                                                <field name="VAR" id="vH;^OzJY7dOdepMScU1s">state</field>
+                                                                                                                            <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="Y4VWl.KGLr*CB@5lWqMT">
-                                                                                                                                    <field name="TEXT">BALL_GOAL_BOTH</field>
+                                                                                                                                  <block type="text" id="IaVZ-uIe[M@`VD!(z-d1">
+                                                                                                                                    <field name="TEXT">NONE</field>
                                                                                                                                   </block>
                                                                                                                                 </value>
                                                                                                                                 <next>
-                                                                                                                                  <block type="controls_if" id="*lBS$ZT#Ys7,}]I-O@k^">
+                                                                                                                                  <block type="controls_if" id="aHn#xa9*3UPMZUu37%KD">
                                                                                                                                     <mutation elseif="0" else="1"/>
                                                                                                                                     <value name="IF0">
-                                                                                                                                      <block type="logic_operation" id="F*6cCZOW)ukbgn9K8?SO" inline="false">
+                                                                                                                                      <block type="logic_operation" id="~/u3*G]LZK9pvIFTV#^q" 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>
+                                                                                                                                          <block type="logic_compare" id="D%l9OSY`vM-xzaB}nY1r">
+                                                                                                                                            <field name="OP">NEQ</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="92sOCNRLiogo~;}oI++#">
+                                                                                                                                                <field name="VAR" id="S4.mduNQC(va3iR{oSdB">posx_ball</field>
                                                                                                                                               </block>
                                                                                                                                             </value>
                                                                                                                                             <value name="B">
-                                                                                                                                              <block type="math_number" id="Wzx3MWFz@%Jz9y{C/Qp1">
-                                                                                                                                                <field name="NUM">-15</field>
-                                                                                                                                              </block>
+                                                                                                                                              <block type="logic_null" id="UJ,gxhveD7#?I9I*:A(r"/>
                                                                                                                                             </value>
                                                                                                                                           </block>
                                                                                                                                         </value>
                                                                                                                                         <value name="B">
-                                                                                                                                          <block type="logic_compare" id="8B#3C:X3GH?2=7:Pz69)">
-                                                                                                                                            <field name="OP">GT</field>
+                                                                                                                                          <block type="logic_compare" id="Nd,4OywJ0ocibay-klwh">
+                                                                                                                                            <field name="OP">NEQ</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 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="math_number" id="{pD26^qSv`7.;d_.f@0c">
-                                                                                                                                                <field name="NUM">-15</field>
-                                                                                                                                              </block>
+                                                                                                                                              <block type="logic_null" id="z0gO+`Su.;sXQ(oI,(y^"/>
                                                                                                                                             </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"/>
+                                                                                                                                      <block type="controls_if" id=".azto3k]W3z}%MWyt~-e">
+                                                                                                                                        <mutation elseif="2" else="1"/>
                                                                                                                                         <value name="IF0">
-                                                                                                                                          <block type="logic_operation" id="aA(*kb?~twOr6-H-5Y6L" 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="s@[Z^y:V@HE1Rj;{0kMC">
-                                                                                                                                                <field name="OP">GT</field>
+                                                                                                                                              <block type="logic_compare" id="Vs3%xCaz|qN@}C*=Tq3$">
+                                                                                                                                                <field name="OP">NEQ</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 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="variables_get" id="2.y#4B,;Y:6:KX.dWY!e">
-                                                                                                                                                    <field name="VAR" id="=2ARo+;2DS07SU~j29Fk">posx_goal_left</field>
-                                                                                                                                                  </block>
+                                                                                                                                                  <block type="logic_null" id="zdJr-qt**l*{;JppUgmP"/>
                                                                                                                                                 </value>
                                                                                                                                               </block>
                                                                                                                                             </value>
                                                                                                                                             <value name="B">
-                                                                                                                                              <block type="logic_compare" id="pj/D#[B!S_nEJX02j9b`">
-                                                                                                                                                <field name="OP">LT</field>
+                                                                                                                                              <block type="logic_compare" id="1IfAVQZEPrL6SRY?6A28">
+                                                                                                                                                <field name="OP">NEQ</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 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="variables_get" id="ru(1|is|xmE}.]MuY*xT">
-                                                                                                                                                    <field name="VAR" id="7Tp~7_.qfmJN0SR]5p}F">posx_goal_right</field>
-                                                                                                                                                  </block>
+                                                                                                                                                  <block type="logic_null" id="woPk%eJHq,DN-n%_Z+nD"/>
                                                                                                                                                 </value>
                                                                                                                                               </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 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>
+                                                                                                                                                    <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="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>
+                                                                                                                                                        </value>
+                                                                                                                                                        <value name="B">
+                                                                                                                                                          <block type="math_number" id="Wzx3MWFz@%Jz9y{C/Qp1">
+                                                                                                                                                            <field name="NUM">-15</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>
+                                                                                                                                                    </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="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>
+                                                                                                                                                        </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>
+                                                                                                                                                        </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>
+                                                                                                                                                      </block>
+                                                                                                                                                    </statement>
+                                                                                                                                                    <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>
+                                                                                                                                                    <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_compare" id=".p%vg@`T{)!T6f3i$rO9">
-                                                                                                                                            <field name="OP">LT</field>
+                                                                                                                                          <block type="logic_operation" id="(jJONR?QSU;KGYM!9ymz" inline="false">
+                                                                                                                                            <field name="OP">AND</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 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_null" id="$fM$v`jz=Gu3u5N-kvvV"/>
+                                                                                                                                                </value>
                                                                                                                                               </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="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>
                                                                                                                                           </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 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>
-                                                                                                                                            <value name="ARG1">
-                                                                                                                                              <block type="math_number" id="_;2gj%#h1g[wnD|7oXuo">
-                                                                                                                                                <field name="NUM">20</field>
+                                                                                                                                            <next>
+                                                                                                                                              <block type="procedures_callnoreturn" id="(i}[E;K*h61?Yj@H+4v$">
+                                                                                                                                                <mutation name="right">
+                                                                                                                                                  <arg name="v"/>
+                                                                                                                                                  <arg name="ticks"/>
+                                                                                                                                                </mutation>
+                                                                                                                                                <value name="ARG0">
+                                                                                                                                                  <block type="variables_get" id="zY9o+1gHa`*0RV3vw/^f">
+                                                                                                                                                    <field name="VAR" id=")rK_fR,m=]b(j[{.CtBj">v_slow</field>
+                                                                                                                                                  </block>
+                                                                                                                                                </value>
+                                                                                                                                                <value name="ARG1">
+                                                                                                                                                  <block type="math_number" id="@YEXBoGu~5nsOT/q7WTv">
+                                                                                                                                                    <field name="NUM">10</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>
+                                                                                                                                                  </block>
+                                                                                                                                                </next>
                                                                                                                                               </block>
-                                                                                                                                            </value>
+                                                                                                                                            </next>
                                                                                                                                           </block>
                                                                                                                                         </statement>
                                                                                                                                         <value name="IF2">
-                                                                                                                                          <block type="logic_compare" id="FkJHQ#CLjJp,s#{H{pha">
-                                                                                                                                            <field name="OP">GT</field>
+                                                                                                                                          <block type="logic_operation" id="1;1`n[eC4,:;kuqeyYe?" inline="false">
+                                                                                                                                            <field name="OP">AND</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 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>
                                                                                                                                             </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="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>
                                                                                                                                             </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 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>
-                                                                                                                                            <value name="ARG1">
-                                                                                                                                              <block type="math_number" id="N.3ER1#5:PMk;ocu-#q(">
-                                                                                                                                                <field name="NUM">20</field>
+                                                                                                                                            <next>
+                                                                                                                                              <block type="procedures_callnoreturn" id="y[ZY.{Gbl^-0x-V[?Jf8">
+                                                                                                                                                <mutation name="left">
+                                                                                                                                                  <arg name="v"/>
+                                                                                                                                                  <arg name="ticks"/>
+                                                                                                                                                </mutation>
+                                                                                                                                                <value name="ARG0">
+                                                                                                                                                  <block type="variables_get" id="t7w)pg%K798s{[9Mn.AB">
+                                                                                                                                                    <field name="VAR" id=")rK_fR,m=]b(j[{.CtBj">v_slow</field>
+                                                                                                                                                  </block>
+                                                                                                                                                </value>
+                                                                                                                                                <value name="ARG1">
+                                                                                                                                                  <block type="math_number" id="@QQ[enP43_i]i}wq_G_L">
+                                                                                                                                                    <field name="NUM">10</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>
+                                                                                                                                              </block>
+                                                                                                                                            </next>
+                                                                                                                                          </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>
                                                                                                                                               </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>
-                                                                                                                                  </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_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>
-                                                                                                                              </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>
-                                                                                                                                    <value name="ARG1">
-                                                                                                                                      <block type="math_number" id="gcH1Ps(J*{a)=3pi9diY">
-                                                                                                                                        <field name="NUM">10</field>
-                                                                                                                                      </block>
-                                                                                                                                    </value>
-                                                                                                                                  </block>
-                                                                                                                                </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="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>
-                                                                                                                                </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>
-                                                                                                                                </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>
-                                                                                                                                    <value name="ARG1">
-                                                                                                                                      <block type="math_number" id=")k]SdR3F1bII`Mo!4Q2T">
-                                                                                                                                        <field name="NUM">10</field>
-                                                                                                                                      </block>
-                                                                                                                                    </value>
-                                                                                                                                  </block>
-                                                                                                                                </next>
-                                                                                                                              </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>
-                                                                                                                                  </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="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>
-                                                                                                                                </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>
-                                                                                                                                </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>
+                                                                                                                                    <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="variables_get" id="CDb^~4feXbvngdh004${">
-                                                                                                                                                <field name="VAR" id="{]]L-TSC^#XtGnVinxf[">posx_goal_both</field>
+                                                                                                                                              <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>
                                                                                                                                             </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 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>
                                                                                                                                             </value>
                                                                                                                                           </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>
+                                                                                                                                        <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>
-                                                                                                                                            <value name="B">
-                                                                                                                                              <block type="variables_get" id=")0O+HGV1!`X_dJGq4=yZ">
-                                                                                                                                                <field name="VAR" id="2G]XEQ3Lhl$dG]=:]8Ge">x_max</field>
+                                                                                                                                            <next>
+                                                                                                                                              <block type="procedures_callnoreturn" id="P+}`zd*$@4@,U%+g]P}{">
+                                                                                                                                                <mutation name="left">
+                                                                                                                                                  <arg name="v"/>
+                                                                                                                                                  <arg name="ticks"/>
+                                                                                                                                                </mutation>
+                                                                                                                                                <value name="ARG0">
+                                                                                                                                                  <block type="variables_get" id="z[AY$^%4?]qje:]J(7,0">
+                                                                                                                                                    <field name="VAR" id=")rK_fR,m=]b(j[{.CtBj">v_slow</field>
+                                                                                                                                                  </block>
+                                                                                                                                                </value>
+                                                                                                                                                <value name="ARG1">
+                                                                                                                                                  <block type="math_number" id="Jk=pATr?AkrYPXbZqpA,">
+                                                                                                                                                    <field name="NUM">10</field>
+                                                                                                                                                  </block>
+                                                                                                                                                </value>
                                                                                                                                               </block>
-                                                                                                                                            </value>
+                                                                                                                                            </next>
                                                                                                                                           </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>
+                                                                                                                                        </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="variables_get" id="@5%T+t9W1)BZT@oXqnww">
-                                                                                                                                                <field name="VAR" id="v0BvP7[91TGaMpQG$r0f">goal_width</field>
+                                                                                                                                              <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="math_number" id="Wb8s[K5@WIquU`@,7c@w">
-                                                                                                                                                <field name="NUM">130</field>
+                                                                                                                                              <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="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>
+                                                                                                                                        <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>
-                                                                                                                                            <value name="ARG1">
-                                                                                                                                              <block type="math_number" id="v0c-z!Z^U6/IWhKEPnE*">
-                                                                                                                                                <field name="NUM">10</field>
+                                                                                                                                            <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>
-                                                                                                                                            </value>
+                                                                                                                                            </next>
                                                                                                                                           </block>
                                                                                                                                         </statement>
-                                                                                                                                        <value name="IF1">
-                                                                                                                                          <block type="logic_compare" id="XoLsJ}.)nZb?`6tpIqv-">
-                                                                                                                                            <field name="OP">GT</field>
+                                                                                                                                        <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="variables_get" id="9NAs7T{MBx/=YP5BpW43">
-                                                                                                                                                <field name="VAR" id="v0BvP7[91TGaMpQG$r0f">goal_width</field>
+                                                                                                                                              <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>
                                                                                                                                             </value>
                                                                                                                                             <value name="B">
-                                                                                                                                              <block type="math_number" id="|2@A]z`Rs0UlH}Ovv9`T">
-                                                                                                                                                <field name="NUM">40</field>
+                                                                                                                                              <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>
                                                                                                                                             </value>
                                                                                                                                           </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>
+                                                                                                                                        <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>
-                                                                                                                                            <value name="ARG1">
-                                                                                                                                              <block type="math_number" id="dFB2rRWf.tj`$C?![{FH">
-                                                                                                                                                <field name="NUM">10</field>
+                                                                                                                                            <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>
                                                                                                                                               </block>
-                                                                                                                                            </value>
+                                                                                                                                            </next>
                                                                                                                                           </block>
                                                                                                                                         </statement>
-                                                                                                                                      </block>
-                                                                                                                                    </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="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="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>
+                                                                                                                                        <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>
+                                                                                                                                            </value>
+                                                                                                                                            <next>
+                                                                                                                                              <block type="procedures_callnoreturn" id="5}bN@s?[YYt;d~8PCD9R">
+                                                                                                                                                <mutation name="left">
+                                                                                                                                                  <arg name="v"/>
+                                                                                                                                                  <arg name="ticks"/>
+                                                                                                                                                </mutation>
+                                                                                                                                                <value name="ARG0">
+                                                                                                                                                  <block type="variables_get" id="`zyKF%[|r}m!CZ$IvD(3">
+                                                                                                                                                    <field name="VAR" id=")rK_fR,m=]b(j[{.CtBj">v_slow</field>
+                                                                                                                                                  </block>
+                                                                                                                                                </value>
+                                                                                                                                                <value name="ARG1">
+                                                                                                                                                  <block type="math_number" id=":p`-E`1z1SO?lV_0SI-+">
+                                                                                                                                                    <field name="NUM">10</field>
+                                                                                                                                                  </block>
+                                                                                                                                                </value>
+                                                                                                                                              </block>
+                                                                                                                                            </next>
                                                                                                                                           </block>
-                                                                                                                                        </value>
+                                                                                                                                        </statement>
                                                                                                                                       </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_null" id="!SjW++O0oh^QU(]FB5$#"/>
-                                                                                                                                    </value>
-                                                                                                                                  </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>
-                                                                                                                                </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>
-                                                                                                                                <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>
-                                                                                                                                  </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>
-                                                                                                                                </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>
+                                                                                                                        </next>
+                                                                                                                      </block>
+                                                                                                                    </statement>
+                                                                                                                    <value name="IF1">
+                                                                                                                      <block type="display_get_switch_state" id="W*7Y)67NbcqaOVewJ.np">
+                                                                                                                        <field name="instance_name">txt_switch_goal</field>
+                                                                                                                        <field name="property_name">checked</field>
+                                                                                                                      </block>
+                                                                                                                    </value>
+                                                                                                                    <statement name="DO1">
+                                                                                                                      <block type="display_set_switch_checked" id="%_V~x~j${8%iwXc4v(3M">
+                                                                                                                        <field name="instance_name">txt_switch_ball</field>
+                                                                                                                        <field name="property_name">checked</field>
+                                                                                                                        <value name="value">
+                                                                                                                          <shadow type="logic_boolean" id="fx[!zan}[smp8@JZ_*MV">
+                                                                                                                            <field name="BOOL">FALSE</field>
+                                                                                                                          </shadow>
+                                                                                                                        </value>
+                                                                                                                        <next>
+                                                                                                                          <block type="procedures_callnoreturn" id="$-][okh+zvY$}C[tq{aZ">
+                                                                                                                            <mutation name="stepOnlyGoal"/>
+                                                                                                                          </block>
+                                                                                                                        </next>
                                                                                                                       </block>
                                                                                                                     </statement>
                                                                                                                     <next>
@@ -1164,91 +1104,206 @@
                                                                                                                                                   </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"/>
-                                                                                                                                                        <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>
-                                                                                                                                                        </value>
+                                                                                                                                                  <block type="variables_set" id="6x+{VP+wdcN`Z%}[I.!L">
+                                                                                                                                                    <field name="VAR" id="4w5r@LJD+|NUZ5,*H@JC">ts_deltas</field>
+                                                                                                                                                    <value name="VALUE">
+                                                                                                                                                      <block type="lists_create_with" id="LDomGXVQ/3v0~^mXO=H:">
+                                                                                                                                                        <mutation items="3"/>
                                                                                                                                                         <value name="ADD0">
-                                                                                                                                                          <block type="variables_get" id="UGc[vu*b~9D^!p.3?7mo">
-                                                                                                                                                            <field name="VAR" id="vH;^OzJY7dOdepMScU1s">state</field>
+                                                                                                                                                          <block type="math_arithmetic" id="t680,3~Y1s!r4H9oe8JV">
+                                                                                                                                                            <field name="OP">MINUS</field>
+                                                                                                                                                            <value name="A">
+                                                                                                                                                              <block type="util_runtime_measurement" id="j%rmr;8@Az.]O/{}Y4_U">
+                                                                                                                                                                <field name="TIME">MILLISECOND</field>
+                                                                                                                                                              </block>
+                                                                                                                                                            </value>
+                                                                                                                                                            <value name="B">
+                                                                                                                                                              <block type="variables_get" id="C/5XJ8aZmH}nTu/c{K/3">
+                                                                                                                                                                <field name="VAR" id="v3eHF0atAL+ouaa{W$=m">ts_ball</field>
+                                                                                                                                                              </block>
+                                                                                                                                                            </value>
                                                                                                                                                           </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 type="math_arithmetic" id="$d!a-N+BUJRl4UwINuSA">
+                                                                                                                                                            <field name="OP">MINUS</field>
+                                                                                                                                                            <value name="A">
+                                                                                                                                                              <block type="util_runtime_measurement" id="(V|oNw#p7uI.IS-0bNIb">
+                                                                                                                                                                <field name="TIME">MILLISECOND</field>
+                                                                                                                                                              </block>
+                                                                                                                                                            </value>
+                                                                                                                                                            <value name="B">
+                                                                                                                                                              <block type="variables_get" id="^|.#)!4#E5}RC4|@nT=E">
+                                                                                                                                                                <field name="VAR" id=";Ki:[qYaZnowqSa`]/aW">ts_goal_left</field>
+                                                                                                                                                              </block>
+                                                                                                                                                            </value>
                                                                                                                                                           </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 type="math_arithmetic" id="g-kAJ}l^chb1#7`^GN})">
+                                                                                                                                                            <field name="OP">MINUS</field>
+                                                                                                                                                            <value name="A">
+                                                                                                                                                              <block type="util_runtime_measurement" id="f}EvEIL!N;0K~[,Yj{i|">
+                                                                                                                                                                <field name="TIME">MILLISECOND</field>
+                                                                                                                                                              </block>
+                                                                                                                                                            </value>
+                                                                                                                                                            <value name="B">
+                                                                                                                                                              <block type="variables_get" id="(VfxxD;J|pK4hJH~.L#:">
+                                                                                                                                                                <field name="VAR" id="z^z{Ev+IMfS6[W1raY;l">ts_goal_right</field>
+                                                                                                                                                              </block>
+                                                                                                                                                            </value>
                                                                                                                                                           </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>
+                                                                                                                                                      <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="15"/>
                                                                                                                                                             <value name="value">
-                                                                                                                                                              <shadow type="math_number" id="E9K@*OZ(Ftp5CGt}.9cT">
-                                                                                                                                                                <field name="NUM">80</field>
+                                                                                                                                                              <shadow type="text" id="a{L7ErJR}=Flx|}3~+X4">
+                                                                                                                                                                <field name="TEXT">{:.1f} {:.1f} {:.1f} {}:{}  GOAL left: {} {}, right:{} {}, p:{}, w:{} BALL_pos:{},{} v_x:{} v_y:{}</field>
                                                                                                                                                               </shadow>
                                                                                                                                                             </value>
+                                                                                                                                                            <value name="ADD0">
+                                                                                                                                                              <block type="lists_getIndex" id="CbdeIGK@44m#g.!M[#x$">
+                                                                                                                                                                <mutation statement="false" at="true"/>
+                                                                                                                                                                <field name="MODE">GET</field>
+                                                                                                                                                                <field name="WHERE">FROM_START</field>
+                                                                                                                                                                <value name="VALUE">
+                                                                                                                                                                  <block type="variables_get" id="}7jQPibx;u0_gP;A]},T">
+                                                                                                                                                                    <field name="VAR" id="4w5r@LJD+|NUZ5,*H@JC">ts_deltas</field>
+                                                                                                                                                                  </block>
+                                                                                                                                                                </value>
+                                                                                                                                                                <value name="AT">
+                                                                                                                                                                  <block type="math_number" id="[Wss|q41wTq{v=?|sD.f">
+                                                                                                                                                                    <field name="NUM">1</field>
+                                                                                                                                                                  </block>
+                                                                                                                                                                </value>
+                                                                                                                                                              </block>
+                                                                                                                                                            </value>
+                                                                                                                                                            <value name="ADD1">
+                                                                                                                                                              <block type="lists_getIndex" id="2]ZTjNwL+l|+n=]^@kBa">
+                                                                                                                                                                <mutation statement="false" at="true"/>
+                                                                                                                                                                <field name="MODE">GET</field>
+                                                                                                                                                                <field name="WHERE">FROM_START</field>
+                                                                                                                                                                <value name="VALUE">
+                                                                                                                                                                  <block type="variables_get" id="4AF^Nf7uzZK##!V!tCyY">
+                                                                                                                                                                    <field name="VAR" id="4w5r@LJD+|NUZ5,*H@JC">ts_deltas</field>
+                                                                                                                                                                  </block>
+                                                                                                                                                                </value>
+                                                                                                                                                                <value name="AT">
+                                                                                                                                                                  <block type="math_number" id="`!LwlvmfWrC[X9}c`xAy">
+                                                                                                                                                                    <field name="NUM">2</field>
+                                                                                                                                                                  </block>
+                                                                                                                                                                </value>
+                                                                                                                                                              </block>
+                                                                                                                                                            </value>
+                                                                                                                                                            <value name="ADD2">
+                                                                                                                                                              <block type="lists_getIndex" id="4C()}[ATkY^*1!#aVh,d">
+                                                                                                                                                                <mutation statement="false" at="true"/>
+                                                                                                                                                                <field name="MODE">GET</field>
+                                                                                                                                                                <field name="WHERE">FROM_START</field>
+                                                                                                                                                                <value name="VALUE">
+                                                                                                                                                                  <block type="variables_get" id="L_TvMk8V]tf,^rAwG;{_">
+                                                                                                                                                                    <field name="VAR" id="4w5r@LJD+|NUZ5,*H@JC">ts_deltas</field>
+                                                                                                                                                                  </block>
+                                                                                                                                                                </value>
+                                                                                                                                                                <value name="AT">
+                                                                                                                                                                  <block type="math_number" id="LTfrlTDNfb/=}Ze]-s^V">
+                                                                                                                                                                    <field name="NUM">3</field>
+                                                                                                                                                                  </block>
+                                                                                                                                                                </value>
+                                                                                                                                                              </block>
+                                                                                                                                                            </value>
+                                                                                                                                                            <value name="ADD3">
+                                                                                                                                                              <block type="variables_get" id="UGc[vu*b~9D^!p.3?7mo">
+                                                                                                                                                                <field name="VAR" id="vH;^OzJY7dOdepMScU1s">state</field>
+                                                                                                                                                              </block>
+                                                                                                                                                            </value>
+                                                                                                                                                            <value name="ADD4">
+                                                                                                                                                              <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="ADD5">
+                                                                                                                                                              <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="ADD6">
+                                                                                                                                                              <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="ADD7">
+                                                                                                                                                              <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="ADD8">
+                                                                                                                                                              <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="ADD9">
+                                                                                                                                                              <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="ADD10">
+                                                                                                                                                              <block type="variables_get" id="#umK_pdUK0;[tcAYO_7s">
+                                                                                                                                                                <field name="VAR" id="v0BvP7[91TGaMpQG$r0f">goal_width</field>
+                                                                                                                                                              </block>
+                                                                                                                                                            </value>
+                                                                                                                                                            <value name="ADD11">
+                                                                                                                                                              <block type="variables_get" id="sPxj5C*ZzYUH*$WCe4|q">
+                                                                                                                                                                <field name="VAR" id="S4.mduNQC(va3iR{oSdB">posx_ball</field>
+                                                                                                                                                              </block>
+                                                                                                                                                            </value>
+                                                                                                                                                            <value name="ADD12">
+                                                                                                                                                              <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="ADD13">
+                                                                                                                                                              <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="ADD14">
+                                                                                                                                                              <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">10</field>
+                                                                                                                                                                  </shadow>
+                                                                                                                                                                  <block type="math_on_list" id="@13*5nlwbH6_4qGl%Fa8">
+                                                                                                                                                                    <mutation op="MIN"/>
+                                                                                                                                                                    <field name="OP">MIN</field>
+                                                                                                                                                                    <value name="LIST">
+                                                                                                                                                                      <block type="variables_get" id="*ir?dEyI42euOFBWsvl{">
+                                                                                                                                                                        <field name="VAR" id="4w5r@LJD+|NUZ5,*H@JC">ts_deltas</field>
+                                                                                                                                                                      </block>
+                                                                                                                                                                    </value>
+                                                                                                                                                                  </block>
+                                                                                                                                                                </value>
+                                                                                                                                                              </block>
+                                                                                                                                                            </next>
                                                                                                                                                           </block>
                                                                                                                                                         </next>
                                                                                                                                                       </block>
@@ -1326,7 +1381,187 @@
       </block>
     </statement>
   </block>
-  <block type="procedures_defnoreturn" id="BJV|hZc!#JXq:io7MmM`" x="0" y="4261">
+  <block type="procedures_defnoreturn" id="En/f/xqq^SH?wf?Q!C!`" x="0" y="4297">
+    <field name="NAME">stepOnlyGoal</field>
+    <statement name="STACK">
+      <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="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>
+            </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>
+            </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>
+              </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>
+              </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">
+            <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>
+            </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="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>
+    </statement>
+  </block>
+  <block type="procedures_defnoreturn" id="BJV|hZc!#JXq:io7MmM`" x="0" y="5050">
     <mutation>
       <arg name="shot" varid="ymkMx:g,wGvcvRtYUanL" argid=":62/?4I]sXmWy2!AnMxj"/>
     </mutation>
@@ -1691,7 +1926,7 @@
       </block>
     </statement>
   </block>
-  <block type="procedures_defnoreturn" id="N2EC5uK:$~0ERXAdK0!y" x="0" y="5500">
+  <block type="procedures_defnoreturn" id="N2EC5uK:$~0ERXAdK0!y" x="0" y="6289">
     <field name="NAME">checkTimeoutsSetGoalBoth</field>
     <statement name="STACK">
       <block type="controls_if" id="fRY+n0,2r=7:t9`dVQYz">
@@ -1931,7 +2166,7 @@
       </block>
     </statement>
   </block>
-  <block type="camera_on_ball_detected" id="dgC*A|KHMC_R5S#ZRk}d" x="0" y="6235">
+  <block type="camera_on_ball_detected" id="dgC*A|KHMC_R5S#ZRk}d" x="0" y="7024">
     <field name="instance_name">ball_detector</field>
     <statement name="statement">
       <block type="variables_set" id="=2/,IQfcLO{_5PNd3UK~">
@@ -2132,7 +2367,7 @@
       </block>
     </statement>
   </block>
-  <block type="camera_on_ball_detected" id="Rg2Gt(0WT:J2|Us~[j.3" x="0" y="6902">
+  <block type="camera_on_ball_detected" id="Rg2Gt(0WT:J2|Us~[j.3" x="0" y="7691">
     <field name="instance_name">ball_detector_goal_left</field>
     <statement name="statement">
       <block type="variables_set" id="kvK,D4e%04[?+!jq*Lch">
@@ -2213,7 +2448,7 @@
       </block>
     </statement>
   </block>
-  <block type="camera_on_ball_detected" id="(?slhGsN^:d1`vP{j9#|" x="0" y="7233">
+  <block type="camera_on_ball_detected" id="(?slhGsN^:d1`vP{j9#|" x="0" y="8022">
     <field name="instance_name">ball_detector_goal_right</field>
     <statement name="statement">
       <block type="variables_set" id="0!1?#@4|tcM8+U6E[$Tl">
@@ -2294,7 +2529,7 @@
       </block>
     </statement>
   </block>
-  <block type="input_event" id="j(TuhJ0G}{^qGSq:26FY" x="0" y="7564">
+  <block type="input_event" id="j(TuhJ0G}{^qGSq:26FY" x="0" y="8353">
     <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>
@@ -2317,7 +2552,7 @@
       </block>
     </statement>
   </block>
-  <block type="procedures_defnoreturn" id="RyK*td9aN5aR;@gw4f)+" x="0" y="7701">
+  <block type="procedures_defnoreturn" id="RyK*td9aN5aR;@gw4f)+" x="0" y="8490">
     <field name="NAME">shotBall</field>
     <statement name="STACK">
       <block type="variables_set" id="l,2u2WF|]I#%kDS#5O7-">
@@ -2429,7 +2664,7 @@
       </block>
     </statement>
   </block>
-  <block type="procedures_defnoreturn" id="na=DVwj{P1Npv6z`ZSY{" x="0" y="8258">
+  <block type="procedures_defnoreturn" id="na=DVwj{P1Npv6z`ZSY{" x="0" y="9047">
     <field name="NAME">soundGoal</field>
     <statement name="STACK">
       <block type="variables_set" id="o^c1yss2pIv%8YmX`=6X">
@@ -2470,7 +2705,7 @@
       </block>
     </statement>
   </block>
-  <block type="procedures_defnoreturn" id="UFM0X7|X:*ja#f+^7kz;" x="0" y="8452">
+  <block type="procedures_defnoreturn" id="UFM0X7|X:*ja#f+^7kz;" x="0" y="9241">
     <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["/>
@@ -2567,7 +2802,7 @@
       </block>
     </statement>
   </block>
-  <block type="procedures_defnoreturn" id="*i[s2YTWD*g9HS4dxkPq" x="0" y="8865">
+  <block type="procedures_defnoreturn" id="*i[s2YTWD*g9HS4dxkPq" x="0" y="9654">
     <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"/>
@@ -2664,7 +2899,7 @@
       </block>
     </statement>
   </block>
-  <block type="procedures_defnoreturn" id="oSa9Ly*^-c^M{$gkMZt1" x="0" y="9278">
+  <block type="procedures_defnoreturn" id="oSa9Ly*^-c^M{$gkMZt1" x="0" y="10067">
     <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{"/>
@@ -2740,7 +2975,7 @@
       </block>
     </statement>
   </block>
-  <block type="procedures_defnoreturn" id="G@]xamrhDPW$7uQ6oPo#" x="0" y="9663">
+  <block type="procedures_defnoreturn" id="G@]xamrhDPW$7uQ6oPo#" x="0" y="10452">
     <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"/>
@@ -2816,7 +3051,7 @@
       </block>
     </statement>
   </block>
-  <block type="procedures_defnoreturn" id="5Hv=PFtVvPQA=IZrkJfU" x="0" y="10048">
+  <block type="procedures_defnoreturn" id="5Hv=PFtVvPQA=IZrkJfU" x="0" y="10837">
     <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"/>
@@ -2907,7 +3142,7 @@
       </block>
     </statement>
   </block>
-  <block type="procedures_defnoreturn" id="[S@[MO!Z/cNt:Jsg4dd}" x="0" y="10489">
+  <block type="procedures_defnoreturn" id="[S@[MO!Z/cNt:Jsg4dd}" x="0" y="11278">
     <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 d482ef9..1fd31f8 100644
--- a/omniwheels_x4_soccer_goal.py
+++ b/omniwheels_x4_soccer_goal.py
@@ -26,8 +26,8 @@ posx_goal_both = None
 posy_ball = None
 posy_goal_left = None
 posy_goal_right = None
-x_max = None
 v_slow = None
+x_max = None
 v_var_ball_xpos = None
 y_ball_far = None
 v_fast = None
@@ -35,8 +35,9 @@ y_ball_touch = None
 v_var_ball_ypos = None
 y_ball_near = None
 search_dir_left = None
+ts_deltas = None
 def checkTimeoutsSetGoalBoth():
-    global shot, v, ticks, factor_x, state, ts_ball, ts_goal_left, ts_goal_right, cmd, 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_slow, v_var_ball_xpos, y_ball_far, v_fast, y_ball_touch, v_var_ball_ypos, y_ball_near, search_dir_left
+    global shot, v, ticks, factor_x, state, ts_ball, ts_goal_left, ts_goal_right, cmd, 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, v_slow, x_max, v_var_ball_xpos, y_ball_far, v_fast, y_ball_touch, v_var_ball_ypos, y_ball_near, search_dir_left, ts_deltas
     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
@@ -55,8 +56,25 @@ def checkTimeoutsSetGoalBoth():
 
 
 
+def stepOnlyGoal():
+    global shot, v, ticks, factor_x, state, ts_ball, ts_goal_left, ts_goal_right, cmd, 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, v_slow, x_max, v_var_ball_xpos, y_ball_far, v_fast, y_ball_touch, v_var_ball_ypos, y_ball_near, search_dir_left, ts_deltas
+    if posx_goal_both >= x_min and posx_goal_both <= x_max:
+        if goal_width < 130:
+            fwd(v_slow, 10)
+        elif goal_width > 40:
+            bwd(v_slow, 10)
+        else:
+            pass
+    elif posx_goal_both < x_min:
+        left(v_slow, 10)
+    elif posx_goal_both > x_max:
+        right(v_slow, 10)
+    else:
+        pass
+
+
 def stepBall(shot):
-    global v, ticks, factor_x, state, ts_ball, ts_goal_left, ts_goal_right, cmd, 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_slow, v_var_ball_xpos, y_ball_far, v_fast, y_ball_touch, v_var_ball_ypos, y_ball_near, search_dir_left
+    global v, ticks, factor_x, state, ts_ball, ts_goal_left, ts_goal_right, cmd, 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, v_slow, x_max, v_var_ball_xpos, y_ball_far, v_fast, y_ball_touch, v_var_ball_ypos, y_ball_near, search_dir_left, ts_deltas
     state = 'stepBall'
     if posx_ball < x_min:
         left(v_slow, round(math.fabs(posx_ball) * 0.07))
@@ -78,7 +96,7 @@ def stepBall(shot):
 
 
 def ball_callback(event):
-    global shot, v, ticks, factor_x, state, ts_ball, ts_goal_left, ts_goal_right, cmd, 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_slow, v_var_ball_xpos, y_ball_far, v_fast, y_ball_touch, v_var_ball_ypos, y_ball_near, search_dir_left
+    global shot, v, ticks, factor_x, state, ts_ball, ts_goal_left, ts_goal_right, cmd, 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, v_slow, x_max, v_var_ball_xpos, y_ball_far, v_fast, y_ball_touch, v_var_ball_ypos, y_ball_near, search_dir_left, ts_deltas
     ts_ball = (time.time() * 1000)
     posx_ball = event.value.x
     posy_ball = event.value.y
@@ -91,7 +109,7 @@ ball_detector.add_detection_listener(ball_callback)
 
 
 def ball_callback2(event):
-    global shot, v, ticks, factor_x, state, ts_ball, ts_goal_left, ts_goal_right, cmd, 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_slow, v_var_ball_xpos, y_ball_far, v_fast, y_ball_touch, v_var_ball_ypos, y_ball_near, search_dir_left
+    global shot, v, ticks, factor_x, state, ts_ball, ts_goal_left, ts_goal_right, cmd, 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, v_slow, x_max, v_var_ball_xpos, y_ball_far, v_fast, y_ball_touch, v_var_ball_ypos, y_ball_near, search_dir_left, ts_deltas
     ts_goal_left = (time.time() * 1000)
     posx_goal_left = event.value.x
     posy_goal_left = event.value.y
@@ -102,7 +120,7 @@ ball_detector_goal_left.add_detection_listener(ball_callback2)
 
 
 def ball_callback23(event):
-    global shot, v, ticks, factor_x, state, ts_ball, ts_goal_left, ts_goal_right, cmd, 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_slow, v_var_ball_xpos, y_ball_far, v_fast, y_ball_touch, v_var_ball_ypos, y_ball_near, search_dir_left
+    global shot, v, ticks, factor_x, state, ts_ball, ts_goal_left, ts_goal_right, cmd, 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, v_slow, x_max, v_var_ball_xpos, y_ball_far, v_fast, y_ball_touch, v_var_ball_ypos, y_ball_near, search_dir_left, ts_deltas
     ts_goal_right = (time.time() * 1000)
     posx_goal_right = event.value.x
     posy_goal_right = event.value.y
@@ -113,7 +131,7 @@ ball_detector_goal_right.add_detection_listener(ball_callback23)
 
 
 def callback(event):
-    global shot, v, ticks, factor_x, state, ts_ball, ts_goal_left, ts_goal_right, cmd, 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_slow, v_var_ball_xpos, y_ball_far, v_fast, y_ball_touch, v_var_ball_ypos, y_ball_near, search_dir_left
+    global shot, v, ticks, factor_x, state, ts_ball, ts_goal_left, ts_goal_right, cmd, 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, v_slow, x_max, v_var_ball_xpos, y_ball_far, v_fast, y_ball_touch, v_var_ball_ypos, y_ball_near, search_dir_left, ts_deltas
     if TXT_M_I8_photo_transistor.is_dark():
         shotBall()
         time.sleep(5)
@@ -123,7 +141,7 @@ TXT_M_I8_photo_transistor.add_change_listener("dark", callback)
 
 
 def shotBall():
-    global shot, v, ticks, factor_x, state, ts_ball, ts_goal_left, ts_goal_right, cmd, 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_slow, v_var_ball_xpos, y_ball_far, v_fast, y_ball_touch, v_var_ball_ypos, y_ball_near, search_dir_left
+    global shot, v, ticks, factor_x, state, ts_ball, ts_goal_left, ts_goal_right, cmd, 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, v_slow, x_max, v_var_ball_xpos, y_ball_far, v_fast, y_ball_touch, v_var_ball_ypos, y_ball_near, search_dir_left, ts_deltas
     cmd = 'shotBall'
     TXT_M_S1_servomotor.set_position(int(400))
     TXT_M_M1_encodermotor.set_speed(int(512), Motor.CCW)
@@ -150,7 +168,7 @@ def shotBall():
 
 
 def soundGoal():
-    global shot, v, ticks, factor_x, state, ts_ball, ts_goal_left, ts_goal_right, cmd, 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_slow, v_var_ball_xpos, y_ball_far, v_fast, y_ball_touch, v_var_ball_ypos, y_ball_near, search_dir_left
+    global shot, v, ticks, factor_x, state, ts_ball, ts_goal_left, ts_goal_right, cmd, 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, v_slow, x_max, v_var_ball_xpos, y_ball_far, v_fast, y_ball_touch, v_var_ball_ypos, y_ball_near, search_dir_left, ts_deltas
     cmd = 'soundGOAL'
     TXT_M.get_loudspeaker().play("26_Augenzwinkern.wav", False)
     display.set_attr("txt_switch_ball.checked", str(False).lower())
@@ -161,7 +179,7 @@ def soundGoal():
 
 
 def turnSideLeft(v, ticks):
-    global shot, factor_x, state, ts_ball, ts_goal_left, ts_goal_right, cmd, 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_slow, v_var_ball_xpos, y_ball_far, v_fast, y_ball_touch, v_var_ball_ypos, y_ball_near, search_dir_left
+    global shot, factor_x, state, ts_ball, ts_goal_left, ts_goal_right, cmd, 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, v_slow, x_max, v_var_ball_xpos, y_ball_far, v_fast, y_ball_touch, v_var_ball_ypos, y_ball_near, search_dir_left, ts_deltas
     cmd = 'turnSideLeft'
     if ticks >= 1:
         TXT_M_M1_encodermotor.set_speed(int(v_slow), Motor.CCW)
@@ -177,7 +195,7 @@ def turnSideLeft(v, ticks):
 
 
 def turnSideRight(v, ticks):
-    global shot, factor_x, state, ts_ball, ts_goal_left, ts_goal_right, cmd, 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_slow, v_var_ball_xpos, y_ball_far, v_fast, y_ball_touch, v_var_ball_ypos, y_ball_near, search_dir_left
+    global shot, factor_x, state, ts_ball, ts_goal_left, ts_goal_right, cmd, 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, v_slow, x_max, v_var_ball_xpos, y_ball_far, v_fast, y_ball_touch, v_var_ball_ypos, y_ball_near, search_dir_left, ts_deltas
     cmd = 'turnSideRight'
     if ticks >= 1:
         TXT_M_M1_encodermotor.set_speed(int(v_slow), Motor.CW)
@@ -193,7 +211,7 @@ def turnSideRight(v, ticks):
 
 
 def fwd(v, ticks):
-    global shot, factor_x, state, ts_ball, ts_goal_left, ts_goal_right, cmd, 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_slow, v_var_ball_xpos, y_ball_far, v_fast, y_ball_touch, v_var_ball_ypos, y_ball_near, search_dir_left
+    global shot, factor_x, state, ts_ball, ts_goal_left, ts_goal_right, cmd, 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, v_slow, x_max, v_var_ball_xpos, y_ball_far, v_fast, y_ball_touch, v_var_ball_ypos, y_ball_near, search_dir_left, ts_deltas
     cmd = 'fwd'
     if ticks >= 1:
         TXT_M_M1_encodermotor.set_speed(int(v), Motor.CCW)
@@ -208,7 +226,7 @@ def fwd(v, ticks):
 
 
 def bwd(v, ticks):
-    global shot, factor_x, state, ts_ball, ts_goal_left, ts_goal_right, cmd, 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_slow, v_var_ball_xpos, y_ball_far, v_fast, y_ball_touch, v_var_ball_ypos, y_ball_near, search_dir_left
+    global shot, factor_x, state, ts_ball, ts_goal_left, ts_goal_right, cmd, 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, v_slow, x_max, v_var_ball_xpos, y_ball_far, v_fast, y_ball_touch, v_var_ball_ypos, y_ball_near, search_dir_left, ts_deltas
     cmd = 'bwd'
     if ticks >= 1:
         TXT_M_M1_encodermotor.set_speed(int(v), Motor.CW)
@@ -223,7 +241,7 @@ def bwd(v, ticks):
 
 
 def left(v, ticks):
-    global shot, factor_x, state, ts_ball, ts_goal_left, ts_goal_right, cmd, 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_slow, v_var_ball_xpos, y_ball_far, v_fast, y_ball_touch, v_var_ball_ypos, y_ball_near, search_dir_left
+    global shot, factor_x, state, ts_ball, ts_goal_left, ts_goal_right, cmd, 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, v_slow, x_max, v_var_ball_xpos, y_ball_far, v_fast, y_ball_touch, v_var_ball_ypos, y_ball_near, search_dir_left, ts_deltas
     cmd = 'left ({}, {})'.format(v, ticks)
     if ticks >= 1:
         TXT_M_M1_encodermotor.set_speed(int(v), Motor.CCW)
@@ -238,7 +256,7 @@ def left(v, ticks):
 
 
 def right(v, ticks):
-    global shot, factor_x, state, ts_ball, ts_goal_left, ts_goal_right, cmd, 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_slow, v_var_ball_xpos, y_ball_far, v_fast, y_ball_touch, v_var_ball_ypos, y_ball_near, search_dir_left
+    global shot, factor_x, state, ts_ball, ts_goal_left, ts_goal_right, cmd, 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, v_slow, x_max, v_var_ball_xpos, y_ball_far, v_fast, y_ball_touch, v_var_ball_ypos, y_ball_near, search_dir_left, ts_deltas
     cmd = 'right ({}, {})'.format(v, ticks)
     if ticks >= 1:
         TXT_M_M1_encodermotor.set_speed(int(v), Motor.CW)
@@ -280,6 +298,9 @@ cmd = 'NONE'
 time.sleep(2)
 while True:
     if display.get_attr("txt_switch_ball.checked"):
+        display.set_attr("txt_switch_goal.checked", str(False).lower())
+        state = 'NONE'
+        cmd = 'NONE'
         if posx_ball != None and posy_ball != None:
             if posx_goal_left != None and posx_goal_right != None:
                 state = 'BALL_GOAL_BOTH'
@@ -294,9 +315,11 @@ while True:
                         turnSideRight(v_slow, 20)
             elif posx_goal_left != None and posx_goal_right == None:
                 state = 'BALL_GOAL_LEFT'
+                right(v_slow, 10)
                 turnSideLeft(v_slow, 10)
             elif posx_goal_left == None and posx_goal_right != None:
                 state = 'BALL_GOAL_RIGHT'
+                left(v_slow, 10)
                 turnSideRight(v_slow, 10)
             else:
                 state = 'BALL_NO_GOAL'
@@ -304,19 +327,7 @@ while True:
         else:
             if posx_goal_left != None and posx_goal_right != None:
                 state = 'NO_BALL_GOAL_BOTH'
-                if posx_goal_both >= x_min and posx_goal_both <= x_max:
-                    if goal_width < 130:
-                        fwd(v_slow, 10)
-                    elif goal_width > 40:
-                        bwd(v_slow, 10)
-                    else:
-                        pass
-                elif posx_goal_both < x_min:
-                    left(v_slow, 10)
-                elif posx_goal_both > x_max:
-                    right(v_slow, 10)
-                else:
-                    pass
+                left(v_slow, 10)
             elif posx_goal_left != None and posx_goal_right == None:
                 state = 'NO_BALL_GOAL_LEFT'
                 right(v_slow, 10)
@@ -325,7 +336,10 @@ while True:
                 left(v_slow, 10)
             else:
                 state = 'NONE'
-                cmd = 'NONE'
+                left(v_slow, 10)
+    elif display.get_attr("txt_switch_goal.checked"):
+        display.set_attr("txt_switch_ball.checked", str(False).lower())
+        stepOnlyGoal()
     display.set_attr("txt_status_indicator_ball.active", str(posx_ball != None).lower())
     display.set_attr("txt_status_indicator_goal_left.active", str(posx_goal_left != None).lower())
     display.set_attr("txt_status_indicator_goal_right.active", str(posx_goal_right != None).lower())
@@ -333,8 +347,9 @@ while True:
     display.set_attr("txt_label_goal_left.text", str('{} {}'.format(posx_goal_left, posy_goal_left)))
     display.set_attr("txt_label_goal_right.text", str('{} {}'.format(posx_goal_right, posy_goal_right)))
     display.set_attr("txt_label_goal_both.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))
+    ts_deltas = [(time.time() * 1000) - ts_ball, (time.time() * 1000) - ts_goal_left, (time.time() * 1000) - ts_goal_right]
+    print('{:.1f} {:.1f} {:.1f} {}:{}  GOAL left: {} {}, right:{} {}, p:{}, w:{} BALL_pos:{},{} v_x:{} v_y:{}'.format(ts_deltas[0], ts_deltas[1], ts_deltas[2], 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)
+    time.sleep(min(ts_deltas) / 1000)
 
 
-- 
GitLab