'State when Mario walks to the castle to end the level'

def walking_to_castle(self):

    self.max_x_vel = 5
    self.x_accel = c.WALK_ACCEL
    if (self.x_vel < self.max_x_vel):
        self.x_vel += self.x_accel
    if ((self.walking_timer == 0) or ((self.current_time - self.walking_timer) > 200)):
        self.walking_timer = self.current_time
    elif ((self.current_time - self.walking_timer) > self.calculate_animation_speed()):
        if (self.frame_index < 3):
            self.frame_index += 1
        else:
            self.frame_index = 1
        self.walking_timer = self.current_time
