mirror of
https://gitlab.com/lecarore/breakout71.git
synced 2025-04-20 12:15:06 -04:00
7 lines
217 B
TypeScript
7 lines
217 B
TypeScript
![]() |
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)
|
||
|
}
|