def __init__(self): Rect.__init__(self) self.zone = None
else: y_vector_bbox.y = bbox.y y_vector_bbox.height=bbox.height # --- Game logic should go here # --- Drawing code should go here # First, clear the screen to white. Don't put other drawing commands # above this, or they will be erased with this command. # surf.fill(RED) for i in range(0, 13): for j in range(0,10): if i == 0 or i == 12 or j == 0 or j == 9: tiles.blit([0,0,16,16], i*16, j*16, surf) tile_bbox.__init__(i*16, j*16, 16, 16) distance_x=distance_until_rectangles_intersect(x_vector_bbox,player.delta_x_vector,tile_bbox) if distance_x is not None: if player.delta_x_vector.x < 0: player.delta_position.x = -distance_x else: player.delta_position.x = distance_x distance_y=distance_until_rectangles_intersect(y_vector_bbox,player.delta_y_vector,tile_bbox) if distance_y is not None: if player.delta_y_vector.y < 0: player.delta_position.y=-distance_y else: player.delta_position.y=distance_y
def __init__(self): Rect.__init__(self) self.zone = None self.static = True self.images = []