Did I find the right examples for you? yes no

All Samples(3)  |  Call(3)  |  Derive(0)  |  Import(0)
does the sprite belong to any groups
Sprite.alive(): return bool

Returns True when the Sprite belongs to one or more Groups.

src/c/s/CS112-Spring2012-HEAD/samplecode/shmup_example/main.py   CS112-Spring2012(Download)
            elif event.type == MOUSEBUTTONDOWN and event.button == 1:
            elif event.type == KEYDOWN and event.key == K_SPACE and not player.alive():
                player = Player(bounds.center, bounds)
        for enemy in groupcollide(enemies, player.bullets, True, True):
            if player.alive():
                score += 1
        screen.blit(score_text, (5, 5))
        if not player.alive():
            gameover = font.render("Press Space to Respawn", False, (255, 255, 255))
            rect = gameover.get_rect()