evotars 0.0.2 → 0.0.3
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.
- package/dist/app.d.ts +19 -0
- package/dist/config/config.d.ts +22 -0
- package/dist/config/constants.d.ts +1 -0
- package/dist/entities/EmoteSpitter.d.ts +15 -0
- package/dist/entities/Evotar.d.ts +79 -0
- package/dist/entities/Message.d.ts +27 -0
- package/dist/entities/Name.d.ts +14 -0
- package/dist/entities/SpriteContainer.d.ts +16 -0
- package/dist/entities/TrailEffect.d.ts +15 -0
- package/dist/evotars.d.ts +14 -0
- package/dist/evotars.js +789 -0
- package/dist/evotars.umd.cjs +1 -0
- package/dist/helpers/timer.d.ts +14 -0
- package/dist/helpers/types.d.ts +10 -0
- package/dist/index.d.ts +1 -0
- package/dist/services/assetsLoader.d.ts +14 -0
- package/dist/services/evotarsManager.d.ts +30 -0
- package/dist/services/soundService.d.ts +12 -0
- package/dist/services/spriteProvider.d.ts +33 -0
- package/dist/types/dto/action.d.ts +49 -0
- package/{src/types/dto/chatter.ts → dist/types/dto/chatter.d.ts} +2 -2
- package/dist/types/dto/event.d.ts +9 -0
- package/dist/types/dto/message.d.ts +8 -0
- package/dist/types/dto/settings.d.ts +5 -0
- package/dist/types/dto/user.d.ts +12 -0
- package/package.json +30 -3
- package/.editorconfig +0 -13
- package/.prettierrc.json +0 -3
- package/index.html +0 -13
- package/index.ts +0 -1
- package/public/fonts/Rubik.ttf +0 -0
- package/public/sounds/jump.mp3 +0 -0
- package/public/sprites/agent/agent.json +0 -166
- package/public/sprites/agent/agent.png +0 -0
- package/public/sprites/cat/cat.json +0 -231
- package/public/sprites/cat/cat.png +0 -0
- package/public/sprites/dude/dude.json +0 -231
- package/public/sprites/dude/dude.png +0 -0
- package/public/sprites/girl/girl.json +0 -231
- package/public/sprites/girl/girl.png +0 -0
- package/public/sprites/nerd/nerd.json +0 -231
- package/public/sprites/nerd/nerd.png +0 -0
- package/public/sprites/senior/senior.json +0 -231
- package/public/sprites/senior/senior.png +0 -0
- package/public/sprites/sith/sith.json +0 -166
- package/public/sprites/sith/sith.png +0 -0
- package/src/app.ts +0 -63
- package/src/config/config.ts +0 -133
- package/src/config/constants.ts +0 -1
- package/src/dudes.ts +0 -71
- package/src/entities/Dude.ts +0 -453
- package/src/entities/DudeEmoteSpitter.ts +0 -60
- package/src/entities/DudeMessage.ts +0 -163
- package/src/entities/DudeName.ts +0 -39
- package/src/entities/DudeSpriteContainer.ts +0 -68
- package/src/entities/DudeTrailEffect.ts +0 -72
- package/src/helpers/timer.ts +0 -43
- package/src/helpers/types.ts +0 -11
- package/src/index.ts +0 -1
- package/src/main.ts +0 -75
- package/src/services/assetsLoader.ts +0 -27
- package/src/services/dudesManager.ts +0 -305
- package/src/services/soundService.ts +0 -28
- package/src/services/spriteProvider.ts +0 -93
- package/src/styles.css +0 -16
- package/src/types/dto/action.ts +0 -68
- package/src/types/dto/event.ts +0 -9
- package/src/types/dto/message.ts +0 -8
- package/src/types/dto/settings.ts +0 -5
- package/src/types/dto/user.ts +0 -13
- package/tsconfig.json +0 -23
- /package/{src/types/dto/index.ts → dist/types/dto/index.d.ts} +0 -0
- /package/{src/types/index.ts → dist/types/index.d.ts} +0 -0
|
@@ -1,231 +0,0 @@
|
|
|
1
|
-
{ "frames": {
|
|
2
|
-
"senior_Body_0": {
|
|
3
|
-
"frame": { "x": 0, "y": 0, "w": 32, "h": 32 },
|
|
4
|
-
"rotated": false,
|
|
5
|
-
"trimmed": false,
|
|
6
|
-
"spriteSourceSize": { "x": 0, "y": 0, "w": 32, "h": 32 },
|
|
7
|
-
"sourceSize": { "w": 32, "h": 32 },
|
|
8
|
-
"duration": 300
|
|
9
|
-
},
|
|
10
|
-
"senior_Body_1": {
|
|
11
|
-
"frame": { "x": 32, "y": 0, "w": 32, "h": 32 },
|
|
12
|
-
"rotated": false,
|
|
13
|
-
"trimmed": false,
|
|
14
|
-
"spriteSourceSize": { "x": 0, "y": 0, "w": 32, "h": 32 },
|
|
15
|
-
"sourceSize": { "w": 32, "h": 32 },
|
|
16
|
-
"duration": 300
|
|
17
|
-
},
|
|
18
|
-
"senior_Body_2": {
|
|
19
|
-
"frame": { "x": 64, "y": 0, "w": 32, "h": 32 },
|
|
20
|
-
"rotated": false,
|
|
21
|
-
"trimmed": false,
|
|
22
|
-
"spriteSourceSize": { "x": 0, "y": 0, "w": 32, "h": 32 },
|
|
23
|
-
"sourceSize": { "w": 32, "h": 32 },
|
|
24
|
-
"duration": 300
|
|
25
|
-
},
|
|
26
|
-
"senior_Body_3": {
|
|
27
|
-
"frame": { "x": 96, "y": 0, "w": 32, "h": 32 },
|
|
28
|
-
"rotated": false,
|
|
29
|
-
"trimmed": false,
|
|
30
|
-
"spriteSourceSize": { "x": 0, "y": 0, "w": 32, "h": 32 },
|
|
31
|
-
"sourceSize": { "w": 32, "h": 32 },
|
|
32
|
-
"duration": 100
|
|
33
|
-
},
|
|
34
|
-
"senior_Body_4": {
|
|
35
|
-
"frame": { "x": 128, "y": 0, "w": 32, "h": 32 },
|
|
36
|
-
"rotated": false,
|
|
37
|
-
"trimmed": false,
|
|
38
|
-
"spriteSourceSize": { "x": 0, "y": 0, "w": 32, "h": 32 },
|
|
39
|
-
"sourceSize": { "w": 32, "h": 32 },
|
|
40
|
-
"duration": 100
|
|
41
|
-
},
|
|
42
|
-
"senior_Body_5": {
|
|
43
|
-
"frame": { "x": 160, "y": 0, "w": 32, "h": 32 },
|
|
44
|
-
"rotated": false,
|
|
45
|
-
"trimmed": false,
|
|
46
|
-
"spriteSourceSize": { "x": 0, "y": 0, "w": 32, "h": 32 },
|
|
47
|
-
"sourceSize": { "w": 32, "h": 32 },
|
|
48
|
-
"duration": 100
|
|
49
|
-
},
|
|
50
|
-
"senior_Body_6": {
|
|
51
|
-
"frame": { "x": 192, "y": 0, "w": 32, "h": 32 },
|
|
52
|
-
"rotated": false,
|
|
53
|
-
"trimmed": false,
|
|
54
|
-
"spriteSourceSize": { "x": 0, "y": 0, "w": 32, "h": 32 },
|
|
55
|
-
"sourceSize": { "w": 32, "h": 32 },
|
|
56
|
-
"duration": 100
|
|
57
|
-
},
|
|
58
|
-
"senior_Body_7": {
|
|
59
|
-
"frame": { "x": 224, "y": 0, "w": 32, "h": 32 },
|
|
60
|
-
"rotated": false,
|
|
61
|
-
"trimmed": false,
|
|
62
|
-
"spriteSourceSize": { "x": 0, "y": 0, "w": 32, "h": 32 },
|
|
63
|
-
"sourceSize": { "w": 32, "h": 32 },
|
|
64
|
-
"duration": 100
|
|
65
|
-
},
|
|
66
|
-
"senior_Body_8": {
|
|
67
|
-
"frame": { "x": 256, "y": 0, "w": 32, "h": 32 },
|
|
68
|
-
"rotated": false,
|
|
69
|
-
"trimmed": false,
|
|
70
|
-
"spriteSourceSize": { "x": 0, "y": 0, "w": 32, "h": 32 },
|
|
71
|
-
"sourceSize": { "w": 32, "h": 32 },
|
|
72
|
-
"duration": 100
|
|
73
|
-
},
|
|
74
|
-
"senior_Body_9": {
|
|
75
|
-
"frame": { "x": 288, "y": 0, "w": 32, "h": 32 },
|
|
76
|
-
"rotated": false,
|
|
77
|
-
"trimmed": false,
|
|
78
|
-
"spriteSourceSize": { "x": 0, "y": 0, "w": 32, "h": 32 },
|
|
79
|
-
"sourceSize": { "w": 32, "h": 32 },
|
|
80
|
-
"duration": 300
|
|
81
|
-
},
|
|
82
|
-
"senior_Body_10": {
|
|
83
|
-
"frame": { "x": 320, "y": 0, "w": 32, "h": 32 },
|
|
84
|
-
"rotated": false,
|
|
85
|
-
"trimmed": false,
|
|
86
|
-
"spriteSourceSize": { "x": 0, "y": 0, "w": 32, "h": 32 },
|
|
87
|
-
"sourceSize": { "w": 32, "h": 32 },
|
|
88
|
-
"duration": 300
|
|
89
|
-
},
|
|
90
|
-
"senior_Body_11": {
|
|
91
|
-
"frame": { "x": 352, "y": 0, "w": 32, "h": 32 },
|
|
92
|
-
"rotated": false,
|
|
93
|
-
"trimmed": false,
|
|
94
|
-
"spriteSourceSize": { "x": 0, "y": 0, "w": 32, "h": 32 },
|
|
95
|
-
"sourceSize": { "w": 32, "h": 32 },
|
|
96
|
-
"duration": 300
|
|
97
|
-
},
|
|
98
|
-
"senior_Body_12": {
|
|
99
|
-
"frame": { "x": 384, "y": 0, "w": 32, "h": 32 },
|
|
100
|
-
"rotated": false,
|
|
101
|
-
"trimmed": false,
|
|
102
|
-
"spriteSourceSize": { "x": 0, "y": 0, "w": 32, "h": 32 },
|
|
103
|
-
"sourceSize": { "w": 32, "h": 32 },
|
|
104
|
-
"duration": 1000
|
|
105
|
-
},
|
|
106
|
-
"senior_Eyes_0": {
|
|
107
|
-
"frame": { "x": 0, "y": 32, "w": 32, "h": 32 },
|
|
108
|
-
"rotated": false,
|
|
109
|
-
"trimmed": false,
|
|
110
|
-
"spriteSourceSize": { "x": 0, "y": 0, "w": 32, "h": 32 },
|
|
111
|
-
"sourceSize": { "w": 32, "h": 32 },
|
|
112
|
-
"duration": 300
|
|
113
|
-
},
|
|
114
|
-
"senior_Eyes_1": {
|
|
115
|
-
"frame": { "x": 32, "y": 32, "w": 32, "h": 32 },
|
|
116
|
-
"rotated": false,
|
|
117
|
-
"trimmed": false,
|
|
118
|
-
"spriteSourceSize": { "x": 0, "y": 0, "w": 32, "h": 32 },
|
|
119
|
-
"sourceSize": { "w": 32, "h": 32 },
|
|
120
|
-
"duration": 300
|
|
121
|
-
},
|
|
122
|
-
"senior_Eyes_2": {
|
|
123
|
-
"frame": { "x": 64, "y": 32, "w": 32, "h": 32 },
|
|
124
|
-
"rotated": false,
|
|
125
|
-
"trimmed": false,
|
|
126
|
-
"spriteSourceSize": { "x": 0, "y": 0, "w": 32, "h": 32 },
|
|
127
|
-
"sourceSize": { "w": 32, "h": 32 },
|
|
128
|
-
"duration": 300
|
|
129
|
-
},
|
|
130
|
-
"senior_Eyes_3": {
|
|
131
|
-
"frame": { "x": 96, "y": 32, "w": 32, "h": 32 },
|
|
132
|
-
"rotated": false,
|
|
133
|
-
"trimmed": false,
|
|
134
|
-
"spriteSourceSize": { "x": 0, "y": 0, "w": 32, "h": 32 },
|
|
135
|
-
"sourceSize": { "w": 32, "h": 32 },
|
|
136
|
-
"duration": 100
|
|
137
|
-
},
|
|
138
|
-
"senior_Eyes_4": {
|
|
139
|
-
"frame": { "x": 128, "y": 32, "w": 32, "h": 32 },
|
|
140
|
-
"rotated": false,
|
|
141
|
-
"trimmed": false,
|
|
142
|
-
"spriteSourceSize": { "x": 0, "y": 0, "w": 32, "h": 32 },
|
|
143
|
-
"sourceSize": { "w": 32, "h": 32 },
|
|
144
|
-
"duration": 100
|
|
145
|
-
},
|
|
146
|
-
"senior_Eyes_5": {
|
|
147
|
-
"frame": { "x": 160, "y": 32, "w": 32, "h": 32 },
|
|
148
|
-
"rotated": false,
|
|
149
|
-
"trimmed": false,
|
|
150
|
-
"spriteSourceSize": { "x": 0, "y": 0, "w": 32, "h": 32 },
|
|
151
|
-
"sourceSize": { "w": 32, "h": 32 },
|
|
152
|
-
"duration": 100
|
|
153
|
-
},
|
|
154
|
-
"senior_Eyes_6": {
|
|
155
|
-
"frame": { "x": 192, "y": 32, "w": 32, "h": 32 },
|
|
156
|
-
"rotated": false,
|
|
157
|
-
"trimmed": false,
|
|
158
|
-
"spriteSourceSize": { "x": 0, "y": 0, "w": 32, "h": 32 },
|
|
159
|
-
"sourceSize": { "w": 32, "h": 32 },
|
|
160
|
-
"duration": 100
|
|
161
|
-
},
|
|
162
|
-
"senior_Eyes_7": {
|
|
163
|
-
"frame": { "x": 224, "y": 32, "w": 32, "h": 32 },
|
|
164
|
-
"rotated": false,
|
|
165
|
-
"trimmed": false,
|
|
166
|
-
"spriteSourceSize": { "x": 0, "y": 0, "w": 32, "h": 32 },
|
|
167
|
-
"sourceSize": { "w": 32, "h": 32 },
|
|
168
|
-
"duration": 100
|
|
169
|
-
},
|
|
170
|
-
"senior_Eyes_8": {
|
|
171
|
-
"frame": { "x": 256, "y": 32, "w": 32, "h": 32 },
|
|
172
|
-
"rotated": false,
|
|
173
|
-
"trimmed": false,
|
|
174
|
-
"spriteSourceSize": { "x": 0, "y": 0, "w": 32, "h": 32 },
|
|
175
|
-
"sourceSize": { "w": 32, "h": 32 },
|
|
176
|
-
"duration": 100
|
|
177
|
-
},
|
|
178
|
-
"senior_Eyes_9": {
|
|
179
|
-
"frame": { "x": 288, "y": 32, "w": 32, "h": 32 },
|
|
180
|
-
"rotated": false,
|
|
181
|
-
"trimmed": false,
|
|
182
|
-
"spriteSourceSize": { "x": 0, "y": 0, "w": 32, "h": 32 },
|
|
183
|
-
"sourceSize": { "w": 32, "h": 32 },
|
|
184
|
-
"duration": 300
|
|
185
|
-
},
|
|
186
|
-
"senior_Eyes_10": {
|
|
187
|
-
"frame": { "x": 320, "y": 32, "w": 32, "h": 32 },
|
|
188
|
-
"rotated": false,
|
|
189
|
-
"trimmed": false,
|
|
190
|
-
"spriteSourceSize": { "x": 0, "y": 0, "w": 32, "h": 32 },
|
|
191
|
-
"sourceSize": { "w": 32, "h": 32 },
|
|
192
|
-
"duration": 300
|
|
193
|
-
},
|
|
194
|
-
"senior_Eyes_11": {
|
|
195
|
-
"frame": { "x": 352, "y": 32, "w": 32, "h": 32 },
|
|
196
|
-
"rotated": false,
|
|
197
|
-
"trimmed": false,
|
|
198
|
-
"spriteSourceSize": { "x": 0, "y": 0, "w": 32, "h": 32 },
|
|
199
|
-
"sourceSize": { "w": 32, "h": 32 },
|
|
200
|
-
"duration": 300
|
|
201
|
-
},
|
|
202
|
-
"senior_Eyes_12": {
|
|
203
|
-
"frame": { "x": 384, "y": 32, "w": 32, "h": 32 },
|
|
204
|
-
"rotated": false,
|
|
205
|
-
"trimmed": false,
|
|
206
|
-
"spriteSourceSize": { "x": 0, "y": 0, "w": 32, "h": 32 },
|
|
207
|
-
"sourceSize": { "w": 32, "h": 32 },
|
|
208
|
-
"duration": 1000
|
|
209
|
-
}
|
|
210
|
-
},
|
|
211
|
-
"meta": {
|
|
212
|
-
"app": "https://www.aseprite.org/",
|
|
213
|
-
"version": "1.x-dev",
|
|
214
|
-
"image": "senior.png",
|
|
215
|
-
"format": "RGBA8888",
|
|
216
|
-
"size": { "w": 416, "h": 64 },
|
|
217
|
-
"scale": "1",
|
|
218
|
-
"frameTags": [
|
|
219
|
-
{ "name": "Idle", "from": 0, "to": 2, "direction": "forward", "color": "#000000ff" },
|
|
220
|
-
{ "name": "Jump", "from": 3, "to": 3, "direction": "forward", "color": "#000000ff" },
|
|
221
|
-
{ "name": "Fall", "from": 4, "to": 4, "direction": "forward", "color": "#000000ff" },
|
|
222
|
-
{ "name": "Land", "from": 5, "to": 5, "direction": "forward", "color": "#000000ff" },
|
|
223
|
-
{ "name": "Run", "from": 6, "to": 8, "direction": "forward", "color": "#000000ff" },
|
|
224
|
-
{ "name": "Die", "from": 9, "to": 12, "direction": "forward", "color": "#000000ff" }
|
|
225
|
-
],
|
|
226
|
-
"layers": [
|
|
227
|
-
{ "name": "Body", "opacity": 255, "blendMode": "normal" },
|
|
228
|
-
{ "name": "Eyes", "opacity": 255, "blendMode": "normal" }
|
|
229
|
-
]
|
|
230
|
-
}
|
|
231
|
-
}
|
|
Binary file
|
|
@@ -1,166 +0,0 @@
|
|
|
1
|
-
{ "frames": {
|
|
2
|
-
"sith_Body_0": {
|
|
3
|
-
"frame": { "x": 0, "y": 0, "w": 32, "h": 32 },
|
|
4
|
-
"rotated": false,
|
|
5
|
-
"trimmed": false,
|
|
6
|
-
"spriteSourceSize": { "x": 0, "y": 0, "w": 32, "h": 32 },
|
|
7
|
-
"sourceSize": { "w": 32, "h": 32 },
|
|
8
|
-
"duration": 300
|
|
9
|
-
},
|
|
10
|
-
"sith_Body_1": {
|
|
11
|
-
"frame": { "x": 32, "y": 0, "w": 32, "h": 32 },
|
|
12
|
-
"rotated": false,
|
|
13
|
-
"trimmed": false,
|
|
14
|
-
"spriteSourceSize": { "x": 0, "y": 0, "w": 32, "h": 32 },
|
|
15
|
-
"sourceSize": { "w": 32, "h": 32 },
|
|
16
|
-
"duration": 300
|
|
17
|
-
},
|
|
18
|
-
"sith_Body_2": {
|
|
19
|
-
"frame": { "x": 64, "y": 0, "w": 32, "h": 32 },
|
|
20
|
-
"rotated": false,
|
|
21
|
-
"trimmed": false,
|
|
22
|
-
"spriteSourceSize": { "x": 0, "y": 0, "w": 32, "h": 32 },
|
|
23
|
-
"sourceSize": { "w": 32, "h": 32 },
|
|
24
|
-
"duration": 300
|
|
25
|
-
},
|
|
26
|
-
"sith_Body_3": {
|
|
27
|
-
"frame": { "x": 96, "y": 0, "w": 32, "h": 32 },
|
|
28
|
-
"rotated": false,
|
|
29
|
-
"trimmed": false,
|
|
30
|
-
"spriteSourceSize": { "x": 0, "y": 0, "w": 32, "h": 32 },
|
|
31
|
-
"sourceSize": { "w": 32, "h": 32 },
|
|
32
|
-
"duration": 100
|
|
33
|
-
},
|
|
34
|
-
"sith_Body_4": {
|
|
35
|
-
"frame": { "x": 128, "y": 0, "w": 32, "h": 32 },
|
|
36
|
-
"rotated": false,
|
|
37
|
-
"trimmed": false,
|
|
38
|
-
"spriteSourceSize": { "x": 0, "y": 0, "w": 32, "h": 32 },
|
|
39
|
-
"sourceSize": { "w": 32, "h": 32 },
|
|
40
|
-
"duration": 100
|
|
41
|
-
},
|
|
42
|
-
"sith_Body_5": {
|
|
43
|
-
"frame": { "x": 160, "y": 0, "w": 32, "h": 32 },
|
|
44
|
-
"rotated": false,
|
|
45
|
-
"trimmed": false,
|
|
46
|
-
"spriteSourceSize": { "x": 0, "y": 0, "w": 32, "h": 32 },
|
|
47
|
-
"sourceSize": { "w": 32, "h": 32 },
|
|
48
|
-
"duration": 100
|
|
49
|
-
},
|
|
50
|
-
"sith_Body_6": {
|
|
51
|
-
"frame": { "x": 192, "y": 0, "w": 32, "h": 32 },
|
|
52
|
-
"rotated": false,
|
|
53
|
-
"trimmed": false,
|
|
54
|
-
"spriteSourceSize": { "x": 0, "y": 0, "w": 32, "h": 32 },
|
|
55
|
-
"sourceSize": { "w": 32, "h": 32 },
|
|
56
|
-
"duration": 100
|
|
57
|
-
},
|
|
58
|
-
"sith_Body_7": {
|
|
59
|
-
"frame": { "x": 224, "y": 0, "w": 32, "h": 32 },
|
|
60
|
-
"rotated": false,
|
|
61
|
-
"trimmed": false,
|
|
62
|
-
"spriteSourceSize": { "x": 0, "y": 0, "w": 32, "h": 32 },
|
|
63
|
-
"sourceSize": { "w": 32, "h": 32 },
|
|
64
|
-
"duration": 100
|
|
65
|
-
},
|
|
66
|
-
"sith_Body_8": {
|
|
67
|
-
"frame": { "x": 256, "y": 0, "w": 32, "h": 32 },
|
|
68
|
-
"rotated": false,
|
|
69
|
-
"trimmed": false,
|
|
70
|
-
"spriteSourceSize": { "x": 0, "y": 0, "w": 32, "h": 32 },
|
|
71
|
-
"sourceSize": { "w": 32, "h": 32 },
|
|
72
|
-
"duration": 100
|
|
73
|
-
},
|
|
74
|
-
"sith_Eyes_0": {
|
|
75
|
-
"frame": { "x": 0, "y": 32, "w": 32, "h": 32 },
|
|
76
|
-
"rotated": false,
|
|
77
|
-
"trimmed": false,
|
|
78
|
-
"spriteSourceSize": { "x": 0, "y": 0, "w": 32, "h": 32 },
|
|
79
|
-
"sourceSize": { "w": 32, "h": 32 },
|
|
80
|
-
"duration": 300
|
|
81
|
-
},
|
|
82
|
-
"sith_Eyes_1": {
|
|
83
|
-
"frame": { "x": 32, "y": 32, "w": 32, "h": 32 },
|
|
84
|
-
"rotated": false,
|
|
85
|
-
"trimmed": false,
|
|
86
|
-
"spriteSourceSize": { "x": 0, "y": 0, "w": 32, "h": 32 },
|
|
87
|
-
"sourceSize": { "w": 32, "h": 32 },
|
|
88
|
-
"duration": 300
|
|
89
|
-
},
|
|
90
|
-
"sith_Eyes_2": {
|
|
91
|
-
"frame": { "x": 64, "y": 32, "w": 32, "h": 32 },
|
|
92
|
-
"rotated": false,
|
|
93
|
-
"trimmed": false,
|
|
94
|
-
"spriteSourceSize": { "x": 0, "y": 0, "w": 32, "h": 32 },
|
|
95
|
-
"sourceSize": { "w": 32, "h": 32 },
|
|
96
|
-
"duration": 300
|
|
97
|
-
},
|
|
98
|
-
"sith_Eyes_3": {
|
|
99
|
-
"frame": { "x": 96, "y": 32, "w": 32, "h": 32 },
|
|
100
|
-
"rotated": false,
|
|
101
|
-
"trimmed": false,
|
|
102
|
-
"spriteSourceSize": { "x": 0, "y": 0, "w": 32, "h": 32 },
|
|
103
|
-
"sourceSize": { "w": 32, "h": 32 },
|
|
104
|
-
"duration": 100
|
|
105
|
-
},
|
|
106
|
-
"sith_Eyes_4": {
|
|
107
|
-
"frame": { "x": 128, "y": 32, "w": 32, "h": 32 },
|
|
108
|
-
"rotated": false,
|
|
109
|
-
"trimmed": false,
|
|
110
|
-
"spriteSourceSize": { "x": 0, "y": 0, "w": 32, "h": 32 },
|
|
111
|
-
"sourceSize": { "w": 32, "h": 32 },
|
|
112
|
-
"duration": 100
|
|
113
|
-
},
|
|
114
|
-
"sith_Eyes_5": {
|
|
115
|
-
"frame": { "x": 160, "y": 32, "w": 32, "h": 32 },
|
|
116
|
-
"rotated": false,
|
|
117
|
-
"trimmed": false,
|
|
118
|
-
"spriteSourceSize": { "x": 0, "y": 0, "w": 32, "h": 32 },
|
|
119
|
-
"sourceSize": { "w": 32, "h": 32 },
|
|
120
|
-
"duration": 100
|
|
121
|
-
},
|
|
122
|
-
"sith_Eyes_6": {
|
|
123
|
-
"frame": { "x": 192, "y": 32, "w": 32, "h": 32 },
|
|
124
|
-
"rotated": false,
|
|
125
|
-
"trimmed": false,
|
|
126
|
-
"spriteSourceSize": { "x": 0, "y": 0, "w": 32, "h": 32 },
|
|
127
|
-
"sourceSize": { "w": 32, "h": 32 },
|
|
128
|
-
"duration": 100
|
|
129
|
-
},
|
|
130
|
-
"sith_Eyes_7": {
|
|
131
|
-
"frame": { "x": 224, "y": 32, "w": 32, "h": 32 },
|
|
132
|
-
"rotated": false,
|
|
133
|
-
"trimmed": false,
|
|
134
|
-
"spriteSourceSize": { "x": 0, "y": 0, "w": 32, "h": 32 },
|
|
135
|
-
"sourceSize": { "w": 32, "h": 32 },
|
|
136
|
-
"duration": 100
|
|
137
|
-
},
|
|
138
|
-
"sith_Eyes_8": {
|
|
139
|
-
"frame": { "x": 256, "y": 32, "w": 32, "h": 32 },
|
|
140
|
-
"rotated": false,
|
|
141
|
-
"trimmed": false,
|
|
142
|
-
"spriteSourceSize": { "x": 0, "y": 0, "w": 32, "h": 32 },
|
|
143
|
-
"sourceSize": { "w": 32, "h": 32 },
|
|
144
|
-
"duration": 100
|
|
145
|
-
}
|
|
146
|
-
},
|
|
147
|
-
"meta": {
|
|
148
|
-
"app": "https://www.aseprite.org/",
|
|
149
|
-
"version": "1.x-dev",
|
|
150
|
-
"image": "sith.png",
|
|
151
|
-
"format": "RGBA8888",
|
|
152
|
-
"size": { "w": 288, "h": 64 },
|
|
153
|
-
"scale": "1",
|
|
154
|
-
"frameTags": [
|
|
155
|
-
{ "name": "Idle", "from": 0, "to": 2, "direction": "forward", "color": "#000000ff" },
|
|
156
|
-
{ "name": "Jump", "from": 3, "to": 3, "direction": "forward", "color": "#000000ff" },
|
|
157
|
-
{ "name": "Fall", "from": 4, "to": 4, "direction": "forward", "color": "#000000ff" },
|
|
158
|
-
{ "name": "Land", "from": 5, "to": 5, "direction": "forward", "color": "#000000ff" },
|
|
159
|
-
{ "name": "Run", "from": 6, "to": 8, "direction": "forward", "color": "#000000ff" }
|
|
160
|
-
],
|
|
161
|
-
"layers": [
|
|
162
|
-
{ "name": "Body", "opacity": 255, "blendMode": "normal" },
|
|
163
|
-
{ "name": "Eyes", "opacity": 255, "blendMode": "normal" }
|
|
164
|
-
]
|
|
165
|
-
}
|
|
166
|
-
}
|
|
Binary file
|
package/src/app.ts
DELETED
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import * as PIXI from "pixi.js";
|
|
2
|
-
import { Dude } from "./entities/Dude";
|
|
3
|
-
import { timers } from "./helpers/timer";
|
|
4
|
-
import { assetsLoader } from "./services/assetsLoader";
|
|
5
|
-
import { dudesManager } from "./services/dudesManager";
|
|
6
|
-
import { SoundManifest, soundService } from "./services/soundService";
|
|
7
|
-
import { SettingsEntity } from "./types";
|
|
8
|
-
|
|
9
|
-
export type AppOptions = {
|
|
10
|
-
manifest: PIXI.AssetsManifest;
|
|
11
|
-
sound: SoundManifest;
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
export class App {
|
|
15
|
-
public stage: PIXI.Container = new PIXI.Container();
|
|
16
|
-
public dudes: Record<string, Dude> = {};
|
|
17
|
-
|
|
18
|
-
public chatterIds: string[] = [];
|
|
19
|
-
|
|
20
|
-
public settings: SettingsEntity = {};
|
|
21
|
-
|
|
22
|
-
public renderer!: PIXI.Renderer;
|
|
23
|
-
|
|
24
|
-
public async init(options: AppOptions, element: HTMLElement): Promise<void> {
|
|
25
|
-
await assetsLoader.load(options.manifest);
|
|
26
|
-
soundService.init(options.sound);
|
|
27
|
-
|
|
28
|
-
this.renderer = new PIXI.Renderer({
|
|
29
|
-
width: element.clientWidth,
|
|
30
|
-
height: element.clientHeight,
|
|
31
|
-
backgroundAlpha: 0,
|
|
32
|
-
});
|
|
33
|
-
|
|
34
|
-
element.appendChild(this.renderer.view as HTMLCanvasElement);
|
|
35
|
-
|
|
36
|
-
window.onresize = (): void => {
|
|
37
|
-
this.renderer.resize(element.clientWidth, element.clientHeight);
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
this.stage.sortableChildren = true;
|
|
41
|
-
|
|
42
|
-
dudesManager.subscribe({
|
|
43
|
-
onAdd: (dude: Dude) => this.stage.addChild(dude.container),
|
|
44
|
-
onDelete: (dude: Dude) => {
|
|
45
|
-
this.stage.removeChild(dude.container);
|
|
46
|
-
this.stage.removeChild(dude.trail.container);
|
|
47
|
-
},
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
public updateSettings(data: SettingsEntity): void {
|
|
52
|
-
this.settings = data;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
public update(): void {
|
|
56
|
-
timers.tick();
|
|
57
|
-
dudesManager.update();
|
|
58
|
-
|
|
59
|
-
this.renderer.render(this.stage);
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
export const app = new App();
|
package/src/config/config.ts
DELETED
|
@@ -1,133 +0,0 @@
|
|
|
1
|
-
export type Sprites = {
|
|
2
|
-
[key: string]: SpriteConfig;
|
|
3
|
-
};
|
|
4
|
-
|
|
5
|
-
export type Config = {
|
|
6
|
-
sprites: Sprites;
|
|
7
|
-
};
|
|
8
|
-
|
|
9
|
-
export type SpriteConfig = {
|
|
10
|
-
name: string;
|
|
11
|
-
w: number;
|
|
12
|
-
h: number;
|
|
13
|
-
collider: {
|
|
14
|
-
x: number;
|
|
15
|
-
y: number;
|
|
16
|
-
w: number;
|
|
17
|
-
h: number;
|
|
18
|
-
};
|
|
19
|
-
pivot: {
|
|
20
|
-
x: number;
|
|
21
|
-
y: number;
|
|
22
|
-
};
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
export const config: Config = {
|
|
26
|
-
sprites: {
|
|
27
|
-
sith: {
|
|
28
|
-
name: 'sith',
|
|
29
|
-
w: 32,
|
|
30
|
-
h: 32,
|
|
31
|
-
collider: {
|
|
32
|
-
x: 8,
|
|
33
|
-
y: 5,
|
|
34
|
-
w: 16,
|
|
35
|
-
h: 20,
|
|
36
|
-
},
|
|
37
|
-
pivot: {
|
|
38
|
-
x: 0,
|
|
39
|
-
y: 9,
|
|
40
|
-
},
|
|
41
|
-
},
|
|
42
|
-
agent: {
|
|
43
|
-
name: 'agent',
|
|
44
|
-
w: 32,
|
|
45
|
-
h: 32,
|
|
46
|
-
collider: {
|
|
47
|
-
x: 8,
|
|
48
|
-
y: 7,
|
|
49
|
-
w: 16,
|
|
50
|
-
h: 18,
|
|
51
|
-
},
|
|
52
|
-
pivot: {
|
|
53
|
-
x: 0,
|
|
54
|
-
y: 9,
|
|
55
|
-
},
|
|
56
|
-
},
|
|
57
|
-
nerd: {
|
|
58
|
-
name: 'nerd',
|
|
59
|
-
w: 32,
|
|
60
|
-
h: 32,
|
|
61
|
-
collider: {
|
|
62
|
-
x: 8,
|
|
63
|
-
y: 7,
|
|
64
|
-
w: 16,
|
|
65
|
-
h: 18,
|
|
66
|
-
},
|
|
67
|
-
pivot: {
|
|
68
|
-
x: 0,
|
|
69
|
-
y: 9,
|
|
70
|
-
},
|
|
71
|
-
},
|
|
72
|
-
girl: {
|
|
73
|
-
name: 'girl',
|
|
74
|
-
w: 32,
|
|
75
|
-
h: 32,
|
|
76
|
-
collider: {
|
|
77
|
-
x: 8,
|
|
78
|
-
y: 5,
|
|
79
|
-
w: 16,
|
|
80
|
-
h: 20,
|
|
81
|
-
},
|
|
82
|
-
pivot: {
|
|
83
|
-
x: 0,
|
|
84
|
-
y: 9,
|
|
85
|
-
},
|
|
86
|
-
},
|
|
87
|
-
cat: {
|
|
88
|
-
name: 'cat',
|
|
89
|
-
w: 32,
|
|
90
|
-
h: 32,
|
|
91
|
-
collider: {
|
|
92
|
-
x: 8,
|
|
93
|
-
y: 4,
|
|
94
|
-
w: 16,
|
|
95
|
-
h: 21,
|
|
96
|
-
},
|
|
97
|
-
pivot: {
|
|
98
|
-
x: 0,
|
|
99
|
-
y: 9,
|
|
100
|
-
},
|
|
101
|
-
},
|
|
102
|
-
senior: {
|
|
103
|
-
name: 'senior',
|
|
104
|
-
w: 32,
|
|
105
|
-
h: 32,
|
|
106
|
-
collider: {
|
|
107
|
-
x: 8,
|
|
108
|
-
y: 4,
|
|
109
|
-
w: 16,
|
|
110
|
-
h: 21,
|
|
111
|
-
},
|
|
112
|
-
pivot: {
|
|
113
|
-
x: 0,
|
|
114
|
-
y: 9,
|
|
115
|
-
},
|
|
116
|
-
},
|
|
117
|
-
sponge: {
|
|
118
|
-
name: 'sponge',
|
|
119
|
-
w: 32,
|
|
120
|
-
h: 32,
|
|
121
|
-
collider: {
|
|
122
|
-
x: 8,
|
|
123
|
-
y: 7,
|
|
124
|
-
w: 16,
|
|
125
|
-
h: 18,
|
|
126
|
-
},
|
|
127
|
-
pivot: {
|
|
128
|
-
x: 0,
|
|
129
|
-
y: 9,
|
|
130
|
-
},
|
|
131
|
-
},
|
|
132
|
-
},
|
|
133
|
-
};
|
package/src/config/constants.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export const FIXED_DELTA_TIME = 0.02 * 1000;
|
package/src/dudes.ts
DELETED
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
MessageEntity,
|
|
3
|
-
RaidData,
|
|
4
|
-
SettingsEntity,
|
|
5
|
-
TwitchChatterEntity,
|
|
6
|
-
UserActionEntity,
|
|
7
|
-
} from "./types";
|
|
8
|
-
import { AppOptions, app } from "./app";
|
|
9
|
-
import { dudesManager } from "./services/dudesManager";
|
|
10
|
-
|
|
11
|
-
export class Dudes {
|
|
12
|
-
private isRendered = false;
|
|
13
|
-
|
|
14
|
-
constructor(private readonly root: HTMLElement) {}
|
|
15
|
-
|
|
16
|
-
processMessage = (data: MessageEntity) => dudesManager.processMessage(data);
|
|
17
|
-
|
|
18
|
-
processAction = (data: UserActionEntity) => dudesManager.processAction(data);
|
|
19
|
-
|
|
20
|
-
processChatters = (data: TwitchChatterEntity[]) =>
|
|
21
|
-
dudesManager.processChatters(data);
|
|
22
|
-
|
|
23
|
-
processRaid = (data: RaidData) => dudesManager.processRaid(data);
|
|
24
|
-
|
|
25
|
-
updateSettings(data: SettingsEntity) {
|
|
26
|
-
app.updateSettings(data);
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
async run(options: AppOptions) {
|
|
30
|
-
if (this.isRendered) {
|
|
31
|
-
return;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
this.isRendered = true;
|
|
35
|
-
|
|
36
|
-
const init = async (): Promise<void> => {
|
|
37
|
-
await app.init(options, this.root);
|
|
38
|
-
|
|
39
|
-
let lastTime = performance.now();
|
|
40
|
-
let lastFrame = -1;
|
|
41
|
-
|
|
42
|
-
const maxFps = 60;
|
|
43
|
-
|
|
44
|
-
const minElapsedMS = 1000 / maxFps;
|
|
45
|
-
const maxElapsedMS = 100;
|
|
46
|
-
|
|
47
|
-
requestAnimationFrame(animate);
|
|
48
|
-
|
|
49
|
-
function animate(currentTime = performance.now()): void {
|
|
50
|
-
let elapsedMS = currentTime - lastTime;
|
|
51
|
-
|
|
52
|
-
if (elapsedMS > maxElapsedMS) {
|
|
53
|
-
elapsedMS = maxElapsedMS;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
const delta = (currentTime - lastFrame) | 0;
|
|
57
|
-
|
|
58
|
-
if (delta > minElapsedMS) {
|
|
59
|
-
lastFrame = currentTime - (delta % minElapsedMS);
|
|
60
|
-
lastTime = currentTime;
|
|
61
|
-
|
|
62
|
-
app.update();
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
requestAnimationFrame(animate);
|
|
66
|
-
}
|
|
67
|
-
};
|
|
68
|
-
|
|
69
|
-
await init();
|
|
70
|
-
}
|
|
71
|
-
}
|