hascii 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,292 @@
1
+ # yaml-language-server: $schema=../hascii.schema.json
2
+ meta:
3
+ title: SNAKE
4
+ frame: 10
5
+ bg: 2
6
+ art:
7
+ - "\e[42m \e[0m"
8
+ - "\e[42m \e[92m#####\e[42m \e[91m*\e[42m \e[0m"
9
+ - "\e[42m \e[92m#\e[42m \e[0m"
10
+ - "\e[42m \e[92m##\e[42m \e[0m"
11
+ - "\e[42m \e[0m"
12
+ description: Eat the food and grow longer.
13
+ init:
14
+ hx: 40
15
+ hy: 10
16
+ dir: 0
17
+ bx:
18
+ - 38
19
+ - 36
20
+ - 34
21
+ by:
22
+ - 10
23
+ - 10
24
+ - 10
25
+ fx: 50
26
+ fy: 10
27
+ score: 0
28
+ tick: 0
29
+ ate: 0
30
+ dead: 0
31
+ update:
32
+ - if:
33
+ and:
34
+ - dead
35
+ - btnPressed.a
36
+ set:
37
+ dead: 0
38
+ hx: 40
39
+ hy: 10
40
+ dir: 0
41
+ bx:
42
+ - 38
43
+ - 36
44
+ - 34
45
+ by:
46
+ - 10
47
+ - 10
48
+ - 10
49
+ fx: 50
50
+ fy: 10
51
+ score: 0
52
+ tick: 0
53
+ - if:
54
+ not: dead
55
+ then:
56
+ - set:
57
+ tick:
58
+ add:
59
+ - tick
60
+ - 1
61
+ - if:
62
+ and:
63
+ - btnPressed.right
64
+ - not:
65
+ eq:
66
+ - dir
67
+ - 2
68
+ set:
69
+ dir: 0
70
+ - if:
71
+ and:
72
+ - btnPressed.down
73
+ - not:
74
+ eq:
75
+ - dir
76
+ - 3
77
+ set:
78
+ dir: 1
79
+ - if:
80
+ and:
81
+ - btnPressed.left
82
+ - not:
83
+ eq:
84
+ - dir
85
+ - 0
86
+ set:
87
+ dir: 2
88
+ - if:
89
+ and:
90
+ - btnPressed.up
91
+ - not:
92
+ eq:
93
+ - dir
94
+ - 1
95
+ set:
96
+ dir: 3
97
+ - if:
98
+ eq:
99
+ - mod:
100
+ - tick
101
+ - 3
102
+ - 0
103
+ then:
104
+ - push:
105
+ to: bx
106
+ item: hx
107
+ - push:
108
+ to: by
109
+ item: hy
110
+ - if:
111
+ eq:
112
+ - dir
113
+ - 0
114
+ set:
115
+ hx:
116
+ add:
117
+ - hx
118
+ - 2
119
+ - if:
120
+ eq:
121
+ - dir
122
+ - 1
123
+ set:
124
+ hy:
125
+ add:
126
+ - hy
127
+ - 1
128
+ - if:
129
+ eq:
130
+ - dir
131
+ - 2
132
+ set:
133
+ hx:
134
+ sub:
135
+ - hx
136
+ - 2
137
+ - if:
138
+ eq:
139
+ - dir
140
+ - 3
141
+ set:
142
+ hy:
143
+ sub:
144
+ - hy
145
+ - 1
146
+ - if:
147
+ gte:
148
+ - hx
149
+ - 80
150
+ set:
151
+ hx: 0
152
+ - if:
153
+ lt:
154
+ - hx
155
+ - 0
156
+ set:
157
+ hx: 78
158
+ - if:
159
+ gte:
160
+ - hy
161
+ - 22
162
+ set:
163
+ hy: 0
164
+ - if:
165
+ lt:
166
+ - hy
167
+ - 0
168
+ set:
169
+ hy: 21
170
+ - each: bx
171
+ as: sx
172
+ index: i
173
+ do:
174
+ - if:
175
+ and:
176
+ - eq:
177
+ - hx
178
+ - sx
179
+ - eq:
180
+ - hy
181
+ - at:
182
+ - by
183
+ - i
184
+ then:
185
+ - set:
186
+ dead: 1
187
+ - sfx:
188
+ wave: noi
189
+ freq: 200
190
+ length: 0.3
191
+ volume: 40
192
+ - if:
193
+ and:
194
+ - eq:
195
+ - hx
196
+ - fx
197
+ - eq:
198
+ - hy
199
+ - fy
200
+ then:
201
+ - set:
202
+ score:
203
+ add:
204
+ - score
205
+ - 10
206
+ fx:
207
+ mul:
208
+ - 2
209
+ - floor:
210
+ rnd:
211
+ - 0
212
+ - 39
213
+ fy:
214
+ floor:
215
+ rnd:
216
+ - 0
217
+ - 21
218
+ ate: 1
219
+ - sfx:
220
+ wave: tri
221
+ freq: 1200
222
+ length: 0.08
223
+ volume: 15
224
+ effect: pitchDown
225
+ - if:
226
+ not: ate
227
+ then:
228
+ - filter:
229
+ list: bx
230
+ as: _
231
+ cond:
232
+ gt:
233
+ - i
234
+ - 0
235
+ - filter:
236
+ list: by
237
+ as: _
238
+ cond:
239
+ gt:
240
+ - i
241
+ - 0
242
+ - set:
243
+ ate: 0
244
+ draw:
245
+ - fill: 0
246
+ - cls: null
247
+ - noStroke: null
248
+ - stroke: 11
249
+ - print:
250
+ - "SCORE:"
251
+ - 2
252
+ - 0
253
+ - print:
254
+ - score
255
+ - 9
256
+ - 0
257
+ - fill: 9
258
+ - rect:
259
+ - fx
260
+ - fy
261
+ - 2
262
+ - 1
263
+ - fill: 2
264
+ - each: bx
265
+ as: x
266
+ index: i
267
+ do:
268
+ - rect:
269
+ - x
270
+ - at:
271
+ - by
272
+ - i
273
+ - 2
274
+ - 1
275
+ - fill: 10
276
+ - rect:
277
+ - hx
278
+ - hy
279
+ - 2
280
+ - 1
281
+ - if: dead
282
+ then:
283
+ - stroke: 9
284
+ - print:
285
+ - GAME OVER
286
+ - 35
287
+ - 10
288
+ - stroke: 7
289
+ - print:
290
+ - Press Z to restart
291
+ - 30
292
+ - 12