change Score By

Change the player score up or down by this amount.

info.changeScoreBy(0)

The total score amount is increased by adding the change value when it is greater than zero (positive). If the change number is less than zero (negative), the total score is reduced by the value of the change number.

Parameters

  • value: a number whice is the amount to change the current score by.

Example

Give the player a bonus of 1000 points if they reach 9 lives.

Single player

let giveBonus = true

if (info.life() > 8) {
    if (giveBonus) {
        info.changeScoreBy(1000)
        giveBonus = false
    }
}

Multiplayer

let giveBonus = true

if (info.player2.life() > 8) {
    if (giveBonus) {
        info.player2.changeScoreBy(1000)
        giveBonus = false
    }
}

See also

set score, score, on score