Verse Library verse

02 Device

Defines a custom creative device class that tracks and increments a score variable on demand.

verse-library/verse-the-important-rules/02-device.verse

score_keeper := class(creative_device):

    var Score : int = 0

    AddPoint() : void =
        set Score += 1
        Print("Point added")

Comments

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