def move(self, direction):
self.pos = (self.pos[0] + direction[0], self.pos[1] + direction[1])
+ def can_move(self, direction, level):
+ '''Check if we can move in the given direction'''
+ cand_pos = (self.pos[0] + direction[0], self.pos[1] + direction[1])
+ return not level.blocked(cand_pos)
+
def get_image(self):
return self.sprite