mirror of
https://gitlab.com/lecarore/breakout71.git
synced 2025-04-21 04:26:14 -04:00
5 colors /level, sound when ball or brick change color
This commit is contained in:
parent
b6fe46c9bc
commit
2e3ab3011f
21 changed files with 1379 additions and 598 deletions
|
@ -1,4 +1,5 @@
|
|||
|
||||
import {PerksMap, Upgrade} from "./types";
|
||||
|
||||
export function getMajorityValue(arr: string[]): string {
|
||||
const count: { [k: string]: number } = {};
|
||||
|
@ -16,4 +17,10 @@ export function sample<T>(arr: T[]): T {
|
|||
export function sumOfKeys(obj:{[key:string]:number} | undefined | null){
|
||||
if(!obj) return 0
|
||||
return Object.values(obj)?.reduce((a,b)=>a+b,0) ||0
|
||||
}
|
||||
}
|
||||
|
||||
export const makeEmptyPerksMap = (upgrades:Upgrade[]) => {
|
||||
const p = {} as any;
|
||||
upgrades.forEach((u) => (p[u.id] = 0));
|
||||
return p as PerksMap;
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue