SiliconGhetto Engine API
    Preparing search index...

    Function createXpAPI

    • Returns {
          get total(): number;
          get level(): number;
          get progress(): number;
          add(amount: number): void;
          set(xp: number): void;
          spawnOrb(x: number, y: number, z: number, amount?: number): void;
      }

      • get total(): number

        Get the player's total accumulated XP.

      • get level(): number

        Get the player's current level (derived from total XP).

      • get progress(): number

        Get the progress toward the next level (0.0 to 1.0).

      • add: function
        • Award XP to the player.

          Parameters

          • amount: number

            XP points to add

          Returns void

      • set: function
        • Set the player's total XP to an exact value.

          Parameters

          • xp: number

            New total XP

          Returns void

      • spawnOrb: function
        • Spawn a collectible XP orb at a world position.

          Parameters

          • x: number

            World X coordinate

          • y: number

            World Y coordinate

          • z: number

            World Z coordinate

          • Optionalamount: number

            XP value of the orb (default 1)

          Returns void