game.title = "Demo game"; game.author = "Mike Buland"; game.version = 1; game.revision = 0; game.start = <>; global { command: "eat" object { display(object); } // You should always have a global exit, quit, escape, something for // dev-testing at least. command: "exit" { exit(); } } function square( x ) { return( x*x ); } function sillyDisplay( txt, extra ) { display("!~! " + txt + " !~!"); if extra then { display("And then some extra!"); } else { display("...no extra for you"); } } function myGoto( txt ) { display( txt ); goto( txt ); } function getThing() { display( situation.thing ); } situation <> { command: "go" "home" { display("Home would be nice..."); } command: "go" elsewhere { display("You don't know how to go " + elsewhere ); } setup { stuff = [5, 10, "bob"]; display( stuff ); exit(); } enter { display('''This is the enter part of the start situation'''); } } situation <> { command: "eat" object { display("You can't eat " + object ); } command: "eat" object "now" { display("Alright, fine, eat " + object + " now..." ); } setup { situation.thing = "Just a thing"; } enter { getThing(); display('''Entered stuff''' + player.name); count = 0; while count < 5 do { display('thing to count!'); count += 1; } } }