From 8b5de4a2c11303d7fb8f8030d3e01df00994b2ed Mon Sep 17 00:00:00 2001 From: kts of kettek Date: Sun, 30 Jan 2022 15:48:50 -0800 Subject: [PATCH] Add water splash sounds --- Engine/src/live/AnimalEntity.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Engine/src/live/AnimalEntity.ts b/Engine/src/live/AnimalEntity.ts index f0bb276..9276915 100644 --- a/Engine/src/live/AnimalEntity.ts +++ b/Engine/src/live/AnimalEntity.ts @@ -71,6 +71,9 @@ export class AnimalEntity extends Entity { p[0] += ((this.sprite.frame?.width??0)/2??0) - 4 p[1] += ((this.sprite.frame?.height??0)/2??0) ctx.addEntity(new PuddleEntity('effects.water.ripple.small.0'), 'ground', p[0], p[1]) + + let v = 1 + Math.floor(Math.random() * 2) + playSound(`action/splash-v${v}`, 0.25+Math.floor(Math.random()*.25)) } this.puddleTimer = 0 }