Difference between revisions of "Script Classes for Adventure Games/Feature Class"
Line 44: | Line 44: | ||
{| | {| | ||
− | + | !width= "125" align= "left"|SENTENCE!!POSSIBLE MATCHING SPECS | |
|- | |- | ||
− | | | + | |"look"||'look[/!*]' or 'look' |
|- | |- | ||
− | | | + | |"get the food"||'get/food' or 'get' |
|- | |- | ||
− | | | + | |"hit the small tree"||'hit/tree<small' |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
|- | |- | ||
− | | | + | | ||'hit/tree[<small] |
|- | |- | ||
− | | | + | | ||'hit[/tree[<small]] |
+ | |- | ||
+ | | ||'hit' | ||
+ | |- | ||
+ | |"hit the small green||'hit/tree/ax' | ||
+ | |- | ||
+ | |tree with the ax"||'hit/tree<(green<small)/ax<with' | ||
+ | |- | ||
+ | |"burn it" = "burn tree"|| | ||
+ | |- | ||
+ | |after last sentence||'burn/tree' | ||
+ | |- | ||
+ | |"when do fairies sleep?"||'(sleep<do<fairies)<when' | ||
+ | |- | ||
+ | |"what time is it?"||'is<what<time' | ||
|} | |} | ||
Revision as of 00:11, 22 December 2015
Chapter:
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
Index
The Feature Class
The Feature class is simply a location on the the screen that has . handleEvent method. This is used when an object that should have . response to events is drawn into the picture. If the global variable useSortedFeatures is TRUE all elements of the cast and features will receive the event in the order of their proximity to ego.
SENTENCE | POSSIBLE MATCHING SPECS |
---|---|
"look" | 'look[/!*]' or 'look' |
"get the food" | 'get/food' or 'get' |
"hit the small tree" | 'hit/tree<small' |
'hit/tree[<small] | |
'hit[/tree[<small]] | |
'hit' | |
"hit the small green | 'hit/tree/ax' |
tree with the ax" | 'hit/tree<(green<small)/ax<with' |
"burn it" = "burn tree" | |
after last sentence | 'burn/tree' |
"when do fairies sleep?" | '(sleep<do<fairies)<when' |
"what time is it?" | 'is<what<time' |
The x property should be set to the x coordinate of the object on the screen. The y property should be set to the y coordinate of the objects projection onto the ground if it is elevated, otherwise it's y coordinate on the screen. If the object is elevated above the ground then the amount of elevation should be placed in the z property.
Methods
handleEvent:event
All elements of the EventHandler features receive the handleEvent message. If the feature is to receive events it should be added to the current rooms features list via the rooms setFeatures method. (i.e.) (curRoom setFeature:myFeature) This is generally done in the init method of a room. If the global variable useSortedFeatures is TRUE all elements of the features list and the cast will receive the handleEvent message in the order of their proximity to ego.
- Notes
< Previous: The Timer Class Next: The View Class >