Script Classes for Adventure Games/Feature Class
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.
In file: | actor.sc |
Inherits from: | Object |
Inherited by: | View |
PicView |
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 >