UNPKG

phaser

Version:

A fast, free and fun HTML5 Game Framework for Desktop and Mobile web browsers from the team at Phaser Studio Inc.

25 lines (22 loc) 659 B
/** * @author Richard Davey <rich@phaser.io> * @copyright 2013-2025 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * Subtract an `amount` from `value`, limiting the minimum result to `min`. * * @function Phaser.Math.MinSub * @since 3.0.0 * * @param {number} value - The value to subtract from. * @param {number} amount - The amount to subtract. * @param {number} min - The minimum value to return. * * @return {number} The resulting value. */ var MinSub = function (value, amount, min) { return Math.max(value - amount, min); }; module.exports = MinSub;