# Boolean Flags (0 / 1 Switches) > Use simple 0/1 variables to track doors unlocked, bosses defeated, invulnerability, or pause state. Boolean Flags (0 / 1 Switches) — Use simple 0/1 variables to track doors unlocked, bosses defeated, invulnerability, or pause state. ## Core approach A flag variable remembers whether an event has already happened so scripts can react without duplicating scenes. - Name flags clearly: "has_key", "is_paused", "boss_defeated". - Reset every flag to 0 under the green flag. - Toggle a flag cleanly with "set flag to (1 - flag)". ## Pro tip & next steps Flags are the secret to clean adventure games and multi-phase bosses. - [All Techniques](/en/techniques/): Browse more English guides in this section. - [Scratch Block Dictionary](/en/dictionary/): Look up any Scratch 3.0 block with examples. Updated: 2026-11-23 Author: [Takamasa Suzuki](https://scratch.gmnavi.jp/about/author/) Japanese Edition: https://scratch.gmnavi.jp/techniques/flags/ [Scratch Daizen (English)](https://scratch.gmnavi.jp/en/)