class Level3(Level):
    def __init__(self):
        super().__init__()
        self.jump_sound = pygame.mixer.Sound("/Users/joshuahuang/Desktop/112/TP/Jump.wav")
        lvl3 = "/Users/joshuahuang/Desktop/112/TP/1-3.png"
        self.mario = Player()
        self.background = pygame.image.load(lvl3).convert()
        self.collide = pygame.sprite.Group()
        self.ecollide = pygame.sprite.Group()
        self.starblocks = pygame.sprite.Group()
        self.fblocks = pygame.sprite.Group()
        self.lavas = pygame.sprite.Group()
        self.koopas = pygame.sprite.Group()
        self.powerupblocks = pygame.sprite.Group()
        self.blocks = pygame.sprite.Group()
        self.enemies = pygame.sprite.Group()
        self.qbs = pygame.sprite.Group()
        self.players = pygame.sprite.Group()
        self.pipes = pygame.sprite.Group()
        self.allsprites = pygame.sprite.Group()
        self.powerups = pygame.sprite.Group()
        self.movingplatforms = pygame.sprite.Group()
        l1 = Lava(210,height-36,15,40)
        l2 = Lava(424,height-36,15,40)
        l3 = Lava(532,height-36,15,40)
        l4 = Lava(1927,height-37,35,40)
        qb1 = QBlock(480,height-100,18,18)
        qb2 = QBlock(1240,height-100,18,18)
        g1 = Goomba(725,height-60)
        g2 = Goomba(1280,height-60)
        g3 = Goomba(1400,height-60)
        g4 = Goomba(1440,height-60)
        g5 = Goomba(2100,height-60)
        b1 = Block3(2253,height-60,18,18)
        k1 = Koopa(1200,height-110,2)
        for i in range(1675,1840,25):
            l = Lava(i,height-36,25,40)
            self.lavas.add(l)
            self.collide.add(l)
            self.allsprites.add(l)
        for i in range(0,2000,18):
            b = Block3(i, 57,18,18)
            self.collide.add(b)
            self.blocks.add(b)
            self.allsprites.add(b)
        for i in range(1258,1350,18):
            b = QBlock(i,height-100,18,18)
            self.collide.add(b)
            self.qbs.add(b)
            self.allsprites.add(b)
        pipe1 = Pipe(600,height-65,35,30)
        pipe2 = Pipe(770,height-90,35,55)
        pipe3 = Pipe(1630,height-90,35,55)
        f1 = FBlock(300,height-60,15,50)
        f2 = FBlock(1140,height-60,15,50)
        f3 = FBlock(940,height-60,15,50)
        f4 = FBlock(1040,height-60,15,50)
        p1 = MovingPlatform(1680,height-110,60,15,1,100,height-50,self.mario)
        p2 = MovingPlatform(1780,height-110,60,15,1,100,height-50,self.mario)
        p3 = MovingPlatform(1925,height-110,35,15,1,100,height-50,self.mario)
        self.mario.set_position(132,height-60)
        self.collide.add(f1,f2,f3,f4,k1,p1,p2,p3,l1,l2,l3,l4,qb1,g1,g2,g3,g4,g5,pipe1,pipe2,pipe3,b1)
        self.ecollide.add(pipe1,pipe2,pipe3,f1,f2,f3,f4,p1,p2,l1,l2,l3,l4,qb1,b1)
        self.movingplatforms.add(p1,p2,p3)
        self.lavas.add(l1,l2,l3,l4,)
        self.blocks.add(b1)
        self.qbs.add(qb1,qb2)
        self.starblocks.add(qb1)
        self.powerupblocks.add(qb2)
        self.players.add(self.mario)
        self.fblocks.add(f1,f2,f3,f4)
        self.enemies.add(g1,g2,g3,g4,g5)
        self.koopas.add(k1)
        self.pipes.add(pipe1,pipe2,pipe3)
        self.allsprites.add(self.mario,k1,f1,f2,f3,f4,p1,p2,p3,l1,l2,l3,l4,qb1,g1,g2,g3,g4,g5,pipe1,pipe2,pipe3,b1)
        self.level_limit = -1770