Replaced images to use the new font and some improvements
commited
commit
4ec918b23eb920026aa449ac593da14ba0ae43c3
... | ... | @@ -1,16 +1,16 @@ |
1 | 1 | Stores the input value into a variable. Think of a variable as a container with a nametag that can only store one value at a time. If you were to set another value to a variable, it will overwrite the previous value of that variable. |
2 | 2 | |
3 | [[/uploads/Set_Variable.png]] |
|
3 | [[uploads/Set_Variable1.png | width=336px, alt=Set Variable]] |
|
4 | 4 | |
5 | 5 | You can get/output the value from a variable with the same name using the [[Get Variable]] block. |
6 | 6 | |
7 | [[/uploads/Screenshot_20210110-203324_Fancade.jpg]] |
|
7 | [[uploads/Screenshot_2021_1022_011555_com.martinmagni.fancade.png]] |
|
8 | 8 | |
9 | 9 | ### Globals |
10 | 10 | |
11 | 11 | Let's say you have a script inside a block that sets a variable to 1. And you have a script outside of the block to inspect that variable. |
12 | 12 | |
13 | [[/uploads/Screenshot_20210110-211009_Photos.jpg]] |
|
13 | [[/uploads/20211022_012115.png]] |
|
14 | 14 | |
15 | 15 | As you can see, we've set the variable to 1, but the Get Variable block outputs 0 as if we never set the variable in the first place. |
16 | 16 | |
... | ... | @@ -20,15 +20,17 @@ If we want a variable to share information to another variable in different plac |
20 | 20 | |
21 | 21 | Note that two variables with the same name with one being a global will not count as the same variables (e.g Number and $Number are not the same). |
22 | 22 | |
23 | [[/uploads/20210110_210438.jpg]] |
|
23 | [[uploads/Screenshot_2021_1022_012758_com.martinmagni.fancade.png]] |
|
24 | 24 | |
25 | 25 | ### Saved variables |
26 | 26 | |
27 | 27 | Saved variables were added in Fancade 1.6. Like global variables, you can make a saved variable by pressing the Local/Global/Saved button on the keyboard where you type the variable's name. Saved variables gain a `!` at the start of their name. |
28 | 28 | |
29 | [[uploads/Screenshot_2021_1022_012641_com.martinmagni.fancade.png]] |
|
30 | ||
29 | 31 | As the name implies, saved variables persist their value from one game session to the next. This is true whether the user ends the game by winning, dying, or simply pausing and returning to the menu. |
30 | 32 | |
31 | Additionally, saved variables are shared across all levels in the same game. This allows a player's actions in one level to affect their gameplay in other levels, and to keep track of purchases from the [[Menu Item|Blocks/Menu Item]] block. |
|
33 | Additionally, saved variables are shared across all levels in the same game. This allows a player's actions in one level to affect their gameplay in other levels, and to keep track of purchases from the [Menu Item](https://www.fancade.com/wiki/Blocks/Menu%20Item.md) block. |
|
32 | 34 | |
33 | 35 | Saved variables currently only work with number variables. |
34 | 36 |