File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed
Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -88,12 +88,12 @@ class DriveControlPanel extends React.Component {
8888 if ( this . props . drivingMode ) {
8989 if ( this . controlMap [ evt . key ] ) {
9090 this . controlMap [ evt . key ] . pressed = false
91- if ( this . controlMap [ evt . key ] . fn == "back" ) this . x ++ ;
92- if ( this . controlMap [ evt . key ] . fn == "forward" ) this . x -- ;
93- if ( this . controlMap [ evt . key ] . fn == "right" ) this . y ++ ;
94- if ( this . controlMap [ evt . key ] . fn == "left" ) this . y -- ;
95- if ( this . controlMap [ evt . key ] . fn == "tright" ) this . t ++ ;
96- if ( this . controlMap [ evt . key ] . fn == "tleft" ) this . t -- ;
91+ if ( this . controlMap [ evt . key ] . fn == "back" && this . x < 1 ) this . x ++ ;
92+ if ( this . controlMap [ evt . key ] . fn == "forward" && this . x > - 1 ) this . x -- ;
93+ if ( this . controlMap [ evt . key ] . fn == "right" && this . y < 1 ) this . y ++ ;
94+ if ( this . controlMap [ evt . key ] . fn == "left" && this . y > - 1 ) this . y -- ;
95+ if ( this . controlMap [ evt . key ] . fn == "tright" && this . t < 1 ) this . t ++ ;
96+ if ( this . controlMap [ evt . key ] . fn == "tleft" && this . t > - 1 ) this . t -- ;
9797 }
9898
9999 // Stops robot if it finds that all keys have been lifted up, acts as a failsafe to above logic
You can’t perform that action at this time.
0 commit comments