mirror of
https://gitlab.com/lecarore/breakout71.git
synced 2025-07-20 10:04:07 +00:00
Game state now contains a map of sounds to play next, for better perf
This commit is contained in:
parent
efa634cd8f
commit
581ee412d4
10 changed files with 1326 additions and 1153 deletions
|
@ -1,5 +1,5 @@
|
|||
import { Ball, GameState, PerkId, PerksMap } from "./types";
|
||||
import { icons, upgrades } from "./loadGameData";
|
||||
import {Ball, GameState, PerkId, PerksMap} from "./types";
|
||||
import {icons, upgrades} from "./loadGameData";
|
||||
|
||||
export function getMajorityValue(arr: string[]): string {
|
||||
const count: { [k: string]: number } = {};
|
||||
|
@ -99,3 +99,18 @@ export function distanceBetween(
|
|||
) {
|
||||
return Math.sqrt(distance2(a, b));
|
||||
}
|
||||
|
||||
export function defaultSounds() {
|
||||
return {
|
||||
aboutToPlaySound: {
|
||||
wallBeep: {vol: 0, x: 0},
|
||||
comboIncreaseMaybe: {vol: 0, x: 0},
|
||||
comboDecrease: {vol: 0, x: 0},
|
||||
coinBounce: {vol: 0, x: 0},
|
||||
explode: {vol: 0, x: 0},
|
||||
lifeLost: {vol: 0, x: 0},
|
||||
coinCatch: {vol: 0, x: 0},
|
||||
colorChange: {vol: 0, x: 0},
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue