/
Initialization.ts
81 lines (67 loc) · 2.36 KB
/
Initialization.ts
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
import { judgeLine } from '../judgeLine.js'
import { note } from '../note.js'
import { particle } from '../particle.js'
import { skin } from '../skin.js'
import { archetypes } from './index.js'
export class Initialization extends Archetype {
preprocess() {
const noteRadius = 0.2
const judgeLineY = -0.6
const t = screen.t + noteRadius
const b = judgeLineY
const h = t - b
const transform = Mat.identity.scale(h, -h).translate(0, t)
skin.transform.set(transform)
particle.transform.set(transform)
judgeLine.l = screen.l / h
judgeLine.r = screen.r / h
note.radius = noteRadius / h
ui.menu.set({
anchor: screen.rect.lt.add(new Vec(0.05, -0.05)),
pivot: { x: 0, y: 1 },
size: new Vec(0.15, 0.15).mul(ui.configuration.menu.scale),
rotation: 0,
alpha: ui.configuration.menu.alpha,
horizontalAlign: HorizontalAlign.Center,
background: true,
})
ui.judgment.set({
anchor: { x: 0, y: -0.4 },
pivot: { x: 0.5, y: 0 },
size: new Vec(0, 0.15).mul(ui.configuration.judgment.scale),
rotation: 0,
alpha: ui.configuration.judgment.alpha,
horizontalAlign: HorizontalAlign.Center,
background: false,
})
ui.combo.value.set({
anchor: { x: screen.r * 0.7, y: 0 },
pivot: { x: 0.5, y: 0 },
size: new Vec(0, 0.2).mul(ui.configuration.combo.scale),
rotation: 0,
alpha: ui.configuration.combo.alpha,
horizontalAlign: HorizontalAlign.Center,
background: false,
})
ui.combo.text.set({
anchor: { x: screen.r * 0.7, y: 0 },
pivot: { x: 0.5, y: 1 },
size: new Vec(0, 0.12).mul(ui.configuration.combo.scale),
rotation: 0,
alpha: ui.configuration.combo.alpha,
horizontalAlign: HorizontalAlign.Center,
background: false,
})
for (const archetype of Object.values(archetypes)) {
if (!('globalPreprocess' in archetype)) continue
archetype.globalPreprocess()
}
}
spawnOrder() {
return 0
}
updateSequential() {
archetypes.InputManager.spawn({})
this.despawn = true
}
}