LogoPixi’VN

Flags management

Explains how to use boolean flags in Pixi’VN to control game flow.

Pixi’VN provides functions to manage "game flags". Game flags are boolean values used to control the flow of the game or to store other boolean value in the game storage.

This mechanic has much less impact on save size than saving a boolean in game storage.

Set

To set a flag, use the storage.setFlag function. This function has the following parameters:

  • name: The flag name.
  • value: The flag value.
import { storage } from '@drincs/pixi-vn'

storage.setFlag('flag1', true)

Get

To get a flag, use the storage.getFlag function. This function has the following parameters:

  • name: The flag name.
import { storage } from '@drincs/pixi-vn'

const flag1 = storage.getFlag('flag1')

Other features