Math#maxAdd()

maxAdd(value, amount, max) → {number}

Adds the given amount to the value, but never lets the value go over the specified maximum.

Parameters
Name Type Description
value number

The value to add the amount to.

amount number

The amount to add to the value.

max number

The maximum the value is allowed to be.

Returns
number -

The new value.

Source code: math/Math.js (Line 491)
doc_phaser
2017-02-14 10:54:57
Comments
Leave a Comment

Please login to continue.