Verse Library verse

02 Comparison

Updates game state variables conditionally when player affords an item purchase.

extracted-snippets/documentation/en-us/uefn/int-in-verse/02-comparison.verse

# Source URL: https://dev.epicgames.com/documentation/en-us/uefn/int-in-verse
# Local doc:  epic-docs/documentation/en-us/uefn/int-in-verse.md
# Section:    Comparison
# Check that the player can afford this purchase.
if (Coins >= CoinsPerQuiver):
    # They can! Proceed with the purchase
    set Coins -= CoinsPerQuiver
    set Arrows += ArrowsPerQuiver
    set TotalPurchases += 1
Copy full snippet

Comments

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