You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: example/APPENDIX.md
+15-10Lines changed: 15 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -85,27 +85,30 @@ This was done to better scale the level to the avatar sprite, which makes its fi
85
85
```
86
86
init
87
87
if kitchen_to_foyer
88
-
sprite_frames 1 0 1H 2H 3H 2H 1H 4H 5H 4H
89
-
sprite 1 288 128
90
88
clear_state near_door
91
89
clear_state kitchen_to_foyer
90
+
set_state near_kitchen
91
+
end_if
92
+
if near_kitchen
93
+
sprite_frames 1 0 1H 2H 3H 2H 1H 4H 5H 4H
94
+
sprite 1 288 128
92
95
end_if
93
96
if lr_to_foyer
94
-
sprite_frames 1 0 1 2 3 2 1 4 5 4
95
-
sprite 1 18 128
96
97
clear_state lr_to_foyer
97
98
set_state near_door
98
99
end_if
99
100
if front_to_foyer
100
-
sprite_frames 1 0 1 2 3 2 1 4 5 4
101
-
sprite 1 18 128
102
101
clear_state front_to_foyer
103
102
set_state near_door
104
103
end_if
104
+
if near_door
105
+
sprite_frames 1 0 1 2 3 2 1 4 5 4
106
+
sprite 1 18 128
107
+
end_if
105
108
end_anim
106
109
```
107
110
108
-
The **init** sequence consists entirely of conditional sub-sequences, so there is no animation that is guaranteed to run during this level. Each sub-sequence is based on a state that indicates which level we came from. The first time we reach this level it is from the kitchen, so ```kitchen_to_foyer``` will be true. So, the avatar sprite (index 1) is placed by the doorway to the kitchen and facing left. Sprite frames 1-5 are the avatar facing left, so the defined sequence has all of those frames flipped horizontally. The other two sub-sequences start the avatar from the opposite end of the foyer, within reach of both doors. Here you can see that in each case the sprite is set to use the left-facing frames and the ```near_door``` state is set to true so that the player can immediately open either door, but would have to walk across the foyer to get back to the kitchen.
111
+
The **init** sequence consists entirely of conditional sub-sequences, so there is no animation that is guaranteed to run during this level. Each sub-sequence is based on a state that indicates which level we came from. The first time we reach this level it is from the kitchen, so ```kitchen_to_foyer``` will be true, and then ```near_kitchen``` will be set to true. So, the avatar sprite (index 1) is placed by the doorway to the kitchen and facing left. Sprite frames 1-5 are the avatar facing left, so the defined sequence has all of those frames flipped horizontally. The other two sub-sequences start the avatar from the opposite end of the foyer, within reach of both doors. Here you can see that in each case the sprite is set to use the left-facing frames and the ```near_door``` state is set to true so that the player can immediately open either door, but would have to walk across the foyer to get back to the kitchen.
109
112
110
113
```
111
114
first
@@ -178,7 +181,8 @@ This trigger is also for the living room door, but this time for "looking" at it
178
181
179
182
```
180
183
tool_trigger walk 0 8 5 18
181
-
if_not near_door
184
+
if near_kitchen
185
+
clear_state near_kitchen
182
186
sprite_move 1 4 135 -2 0
183
187
wait 255
184
188
wait 255
@@ -188,11 +192,12 @@ end_if
188
192
end_anim
189
193
```
190
194
191
-
This trigger is for "walking" to the left end of the foyer. The trigger area included both the doors, but also has some previously unclaimed space between them, so the "walk" cursor will automatically appear when the mouse is moved there. The whole area can be used for the trigger if the "walk" tool is explicitly selected. First, it checks to make sure the avatar is not already near the door, then kicks off the animation to walk there 2 pixels at a time every 4 jiffys. This takes a while to accomplish all 135 steps, so three **wait** instructions are needed to wait a grand total of 525 jiffys, or 8.75 seconds. Then the ```near_door``` state is set to true so that the player can open one of the doors. If the avatar is already near the door when this trigger occurs, nothing happens, as the whole sequence is taken up with the ```if_not near_door``` sub-sequence.
195
+
This trigger is for "walking" to the left end of the foyer. The trigger area included both the doors, but also has some previously unclaimed space between them, so the "walk" cursor will automatically appear when the mouse is moved there. The whole area can be used for the trigger if the "walk" tool is explicitly selected. First, it checks to make sure the avatar is near the kitchen, then kicks off the animation to walk there 2 pixels at a time every 4 jiffys. This takes a while to accomplish all 135 steps, so three **wait** instructions are needed to wait a grand total of 525 jiffys, or 8.75 seconds. Then the ```near_door``` state is set to true so that the player can open one of the doors. If the avatar is already near the door when this trigger occurs, nothing happens, as the whole sequence is taken up with the ```if_not near_door``` sub-sequence.
0 commit comments