Add item collection sound
This commit is contained in:
		
							
								
								
									
										
											BIN
										
									
								
								src/art/sounds/collect.mp3
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								src/art/sounds/collect.mp3
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							| @@ -4,6 +4,8 @@ import { displace } from "./physics.ts"; | ||||
| import { getHuntMode } from "./huntmode.ts"; | ||||
| import { DrawPile } from "./drawpile.ts"; | ||||
| import { FLOOR_CELL_SIZE } from "./gridart.ts"; | ||||
| import { sndCollect } from "./sounds.ts"; | ||||
| import { choose } from "./utils.ts"; | ||||
|  | ||||
| export class Floater { | ||||
|   xy: Point; | ||||
| @@ -23,7 +25,7 @@ export class Floater { | ||||
|     this.z = z; | ||||
|     this.velZ = 0; | ||||
|  | ||||
|     this.frame = 0; | ||||
|     this.frame = choose([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]); | ||||
|     this.spin = 0; | ||||
|  | ||||
|     this.collected = false; | ||||
| @@ -79,6 +81,7 @@ export class Floater { | ||||
|       return; | ||||
|     } | ||||
|     this.collected = true; | ||||
|     sndCollect.play({ volume: 0.1 }); | ||||
|     this.#callbacks.obtain(); | ||||
|   } | ||||
|  | ||||
|   | ||||
| @@ -1,4 +1,5 @@ | ||||
| import audBite from "./art/sounds/bite.mp3"; | ||||
| import audCollect from "./art/sounds/collect.mp3"; | ||||
| import audDeath from "./art/sounds/death.mp3"; | ||||
| import audDig from "./art/sounds/dig.mp3"; | ||||
| import audEnding from "./art/sounds/ending.mp3"; | ||||
| @@ -12,6 +13,7 @@ import audSleep from "./art/sounds/sleep.mp3"; | ||||
| import { Sound } from "./sound.ts"; | ||||
|  | ||||
| export let sndBite = new Sound(audBite); | ||||
| export let sndCollect = new Sound(audCollect); | ||||
| export let sndDeath = new Sound(audDeath); | ||||
| export let sndDig = new Sound(audDig); | ||||
| export let sndEnding = new Sound(audEnding); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user