def update_child(self, matrix): next_step = mul_tuple(self.direction, self.speed) next_screen_position = next_point(self.screen_position, next_step) x, y = s2c(next_screen_position) if x >= X_CELL_NUM or x < 0 or y >= Y_CELL_NUM or y < 0 or not matrix[y][x]: # self.direction = STOP self.direction = TRIGONOMETRY_SUCKS[self.direction]["contr"]
def move_by_arrows(self): next_step = mul_tuple(self.direction, self.speed) self.make_step(next_step)