Objects
/* This is a comment, something that you can use to write notes about how your code works so it's easier to understand when you come back to it. It won't show up on the page. */
<<set $player = {
name: "Ashley",
money: 100,
class: "Wizard",
isInvisible: false,
}>>
<<textbox "$player.name" $player.name>>
[[Player Summary]]Name: $player.name
Class: $player.class
Money: $player.money
Player is invisible: $player.isInvisible
[[Change name]]
[[Change class to rogue]]
[[Change class to wizard]]
[[Add money]]
[[Toggle invisibility]]<<textbox "$player.name" $player.name>>
[[Player Summary]] <<set $player.class = "rogue">>
Your class is now rogue.
[[Player Summary]] <<set $player["class"] = "wizard">>
Your class is now wizard.
[[Player Summary]] <<set $money = $player.money + 1>>
Your balance is now $player.money.
[[Player Summary]] /* an ! means "not", which makes a true or false value its opposite. !false is the same as true. !true is the same as false. */
<<set $player.isInvisible = !$player.isInvisible>>
You are now invisible.
[[Player Summary]]