breakout71/src/pure_functions.ts

7 lines
217 B
TypeScript
Raw Normal View History

export function clamp(value: number, min: number, max: number) {
return Math.max(min, Math.min(value, max));
}
export function comboKeepingRate(level: number) {
return clamp(1 - 1 / (1 + level) * 1.5, 0, 1)
}