# Flags management (/start/flags)



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 <DynamicLink href="/start/storage#set-a-variable-in-the-game-storage">saving a boolean in game storage</DynamicLink>.

Set [#set]

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

* `name`: The flag name.
* `value`: The flag value.

```typescript
import { storage } from '@drincs/pixi-vn'

storage.setFlag('flag1', true)
```

Get [#get]

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

* `name`: The flag name.

```typescript
import { storage } from '@drincs/pixi-vn'

const flag1 = storage.getFlag('flag1')
```

Other features [#other-features]

<Accordions>
  <Accordion title="class_boolean_property" id="class-boolean-property">
    If you are creating a class with a boolean property, you can connect it to a flag. This way, the property will automatically reflect the flag's value.

    This can simplify your code and make it more readable.

    ```typescript
    import { storage } from '@drincs/pixi-vn'

    class ButtonClass {
        private _disabled: boolean | string
        get disabled() {
            if (typeof this._disabled === 'string') {
                return storage.getFlag(this._disabled)
            }
            return this._disabled
        }
        set disabled(value: boolean | string) {
            this._disabled = value
        }
    }
    ```

    ```typescript
    // Button to go to school
    const goToSchoolButton = new ButtonClass()
    goToSchoolButton.disabled = 'weekend'

    function afterNewDay() {
        storage.setFlag('weekend', 
            // Check if it is Saturday or Sunday
        )
    }
    ```
  </Accordion>
</Accordions>
