diff options
author | Mike Buland <eichlan@xagasoft.com> | 2011-12-11 23:00:45 -0700 |
---|---|---|
committer | Mike Buland <eichlan@xagasoft.com> | 2011-12-11 23:00:45 -0700 |
commit | ac58dc8822b154a2ce51cc1b1317bc5e57ebf655 (patch) | |
tree | d9f7c95785720d1c1a3fce92c080e3021328c3ef /demo.stage | |
parent | 7c90fe68b557d32b65955ffd18e2e79585a7282b (diff) | |
download | stage-ac58dc8822b154a2ce51cc1b1317bc5e57ebf655.tar.gz stage-ac58dc8822b154a2ce51cc1b1317bc5e57ebf655.tar.bz2 stage-ac58dc8822b154a2ce51cc1b1317bc5e57ebf655.tar.xz stage-ac58dc8822b154a2ce51cc1b1317bc5e57ebf655.zip |
I think I've narrowed down how commands will work
It's kinda' cool for the most part, there will have to be some ways of
referencing them later. Basically, there are global commands and
situation commands. With any luck, it'll just work.
Diffstat (limited to 'demo.stage')
-rw-r--r-- | demo.stage | 36 |
1 files changed, 33 insertions, 3 deletions
@@ -2,6 +2,37 @@ | |||
2 | game | 2 | game |
3 | { | 3 | { |
4 | title = "Demo game"; | 4 | title = "Demo game"; |
5 | |||
6 | command: "take" item | ||
7 | { | ||
8 | if item in situation.items then | ||
9 | { | ||
10 | player.inventory += item; | ||
11 | situation.items -= item; | ||
12 | display('''You pickup the ''' + item + | ||
13 | ''' and put it in your pocket.'''); | ||
14 | } | ||
15 | else | ||
16 | { | ||
17 | display('''You don't see anything like that here.'''); | ||
18 | } | ||
19 | } | ||
20 | |||
21 | command: "use" item | ||
22 | { | ||
23 | if not item in player.inventory then | ||
24 | { | ||
25 | display('''You don't have anything like that in your pocket.'''); | ||
26 | } | ||
27 | else | ||
28 | { | ||
29 | } | ||
30 | } | ||
31 | } | ||
32 | |||
33 | situation <<main>> | ||
34 | { | ||
35 | player.inventory = []; | ||
5 | } | 36 | } |
6 | 37 | ||
7 | function hello() | 38 | function hello() |
@@ -10,9 +41,8 @@ function hello() | |||
10 | 41 | ||
11 | situation <<start>> | 42 | situation <<start>> |
12 | { | 43 | { |
13 | // set situation end; | 44 | display('''You are here, there is a wrench sitting on the table.'''); |
14 | // push situation somethingElse; | 45 | global.command("use", |
15 | |||
16 | } | 46 | } |
17 | 47 | ||
18 | situation <<end>> | 48 | situation <<end>> |