Skip to content

Commit

Permalink
chore(sounds): play splash when gooba appears
Browse files Browse the repository at this point in the history
  • Loading branch information
remarkablemark committed Jan 25, 2025
1 parent e477eeb commit 873676f
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 0 deletions.
Binary file added public/sounds/splash.mp3
Binary file not shown.
1 change: 1 addition & 0 deletions src/constants/sounds.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@ export enum Sound {
Hit = 'Hit',
Pop = 'Pop',
Shoot = 'Shoot',
Splash = 'Splash',
Whoosh = 'Whoosh',
}
4 changes: 4 additions & 0 deletions src/gameobjects/enemy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ export function addEnemy() {
{ bubble: false, damage, speed },
])

if (enemy.sprite === Sprite.Gooba) {
play(Sound.Splash)
}

addEnemyState(enemy)

enemy.onCollide(Tag.Player, () => {
Expand Down
1 change: 1 addition & 0 deletions src/scenes/preload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ scene(Scene.Preload, () => {
[Sound.Hit, 'sounds/hit.mp3'],
[Sound.Pop, 'sounds/pop.mp3'],
[Sound.Shoot, 'sounds/shoot.mp3'],
[Sound.Splash, 'sounds/splash.mp3'],
[Sound.Whoosh, 'sounds/whoosh.mp3'],
]

Expand Down

0 comments on commit 873676f

Please sign in to comment.