song_match.effect.effects¶
Package containing various game effects.
CorrectSequenceEffect- Played when a player matches the correct notes.RoundTransitionEffect- Played when transitioning between game rounds.WrongNoteEffect- Played when a player fails to match the correct notes.
song_match.effect.effects.correct_sequence¶
-
class
song_match.effect.effects.correct_sequence.CorrectSequenceEffect(song_robot: song_match.song_robot.SongRobot)[source]¶ Bases:
song_match.effect.effect.EffectPlayed when either a player or Cozmo matches a sequence of notes correctly.
-
play(is_sequence_long: bool = False, is_player: bool = True) → None[source]¶ Play the correct sequence effect.
- Play
collect-point.wav - Animate Cozmo with
MemoryMatchPlayerWinHandorMemoryMatchCozmoWinHanddepending uponis_player. - Flash the cubes green.
Parameters: - is_sequence_long – Whether the sequence the player matched was long.
- is_player – Whether the player or Cozmo played the correct sequence.
Returns: None
- Play
-
song_match.effect.effects.game_over¶
-
class
song_match.effect.effects.game_over.GameOverEffect(song_robot: song_match.song_robot.SongRobot)[source]¶ Bases:
song_match.effect.effect.Effect-
play(winners: List[song_match.player.Player], did_cozmo_win: bool = True) → cozmo.anim.AnimationTrigger[source]¶ Play the game over effect.
- Play
collect-point.wav - Animate Cozmo with
MajorFailorDanceMambodepending uponis_cozmo. - Flash the victory sequence.
Parameters: - winners – A list of the players that won the game.
- did_cozmo_win – Whether or not Cozmo shared the glory of victory.
Returns: None
- Play
-
song_match.effect.effects.round_transition¶
-
class
song_match.effect.effects.round_transition.RoundTransitionEffect(song_robot: song_match.song_robot.SongRobot)[source]¶ Bases:
song_match.effect.effect.EffectPlayed when transitioning between rounds of the game.
song_match.effect.effects.wrong_note¶
-
class
song_match.effect.effects.wrong_note.WrongNoteEffect(song_robot: song_match.song_robot.SongRobot)[source]¶ Bases:
song_match.effect.effect.EffectPlayed when either a player or Cozmo plays the wrong note.
-
play(cube_id: int, is_player: bool = True) → None[source]¶ Play the wrong note effect.
- Play
wrong-buzzer.wav - Animate Cozmo with
MemoryMatchPlayerLoseHandorMemoryMatchCozmoLoseHanddepending uponis_player. - Flash the incorrect cube red.
Parameters: - cube_id –
cube_id - is_player – Whether the player or Cozmo played the wrong note.
Returns: None
- Play
-