Verse Library verse

02 Fragment

Subtracts points from a score buffer, enforces a zero floor, and triggers a deferred UI update for penalties.

verse-library/4-add-a-scoring-system/02-fragment.verse

# Example structure for your hint:
ApplyPenalty<public>(PenaltyPoints: int) : void =
    PendingScore -= PenaltyPoints
    if (PendingScore < 0):
        PendingScore = 0
    defer:
        UpdateUI()

Comments

    Sign in to vote, comment, or suggest an edit. Sign in