parameters: (self)
docstring: Watch the keys and change direction.
docstring_summary: Watch the keys and change direction.
docstring_tokens: Watch the keys and change direction .
function: def update_direction(self):
          """Watch the keys and change direction."""
  
          if pyxel.btn(pyxel.KEY_UP):
              if self.direction is not DOWN:
                  self.direction = UP
          elif pyxel.btn(pyxel.KEY_DOWN):
              if self.direction is not UP:
                  self.direction = DOWN
          elif pyxel.btn(pyxel.KEY_LEFT):
              if self.direction is not RIGHT:
                  self.direction = LEFT
          elif pyxel.btn(pyxel.KEY_RIGHT):
              if self.direction is not LEFT:
                  self.direction = RIGHT
function_tokens: def update_direction ( self ) : if pyxel . btn ( pyxel . KEY_UP ) : if self . direction is not DOWN : self . direction = UP elif pyxel . btn ( pyxel . KEY_DOWN ) : if self . direction is not UP : self . direction = DOWN elif pyxel . btn ( pyxel . KEY_LEFT ) : if self . direction is not RIGHT : self . direction = LEFT elif pyxel . btn ( pyxel . KEY_RIGHT ) : if self . direction is not LEFT : self . direction = RIGHT