mwg API
    Preparing search index...

    Interface GrowthCurve

    Levels, experience, and the growth curve between them.

    The curve is a small interface rather than a formula, so it is entirely replaceable: a game that wants Pokémon-style fast/medium/slow curves, or a flat curve with no cap, or one read from a spreadsheet, supplies its own GrowthCurve and everything else here still works unchanged.

    interface GrowthCurve {
        maxLevel: number;
        experienceFor(level: number): number;
    }
    Index
    maxLevel: number

    the highest level the curve defines; levelling stops here

    • total experience needed to reach this level; level 1 should be 0

      Parameters

      • level: number

      Returns number