UNPKG

yarn-spinner-runner-ts

Version:

TypeScript parser, compiler, and runtime for Yarn Spinner 3.x with React adapter [NPM package](https://www.npmjs.com/package/yarn-spinner-runner-ts)

26 lines (19 loc) 590 B
## Logic and Variables (Yarn Spinner) Source: [docs.yarnspinner.dev Logic and Variables](https://docs.yarnspinner.dev/write-yarn-scripts/scripting-fundamentals/logic-and-variables) ### What it covers - Declaring and using variables; reading and writing from the game. - Basic expressions for conditions and assignments. - Interpolating values in lines. ### Examples ```yarn title: Start --- <<set hasKey = true>> <<set score = 10 + 5>> {if hasKey} Narrator: You unlock the door. Score: {score} {else} Narrator: The door is locked. {endif} === ```