/
frozen.ts
38 lines (31 loc) · 1.07 KB
/
frozen.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
import { noteDisplay } from '../../components/noteDisplay.js'
import { instruction } from '../../instruction.js'
import { segment } from '../../segment.js'
export const noteFrozen = {
enter() {
noteDisplay.showFrozen()
instruction.texts.tap.show()
},
update() {
const angle = Math.remapClamped(0.25, 0.75, Math.PI / 6, Math.PI / 3, segment.time % 1)
const a = Math.unlerpClamped(0.5, 0.25, Math.abs((segment.time % 1) - 0.5))
const position = new Vec(0, -1)
.rotate(Math.PI / 3)
.mul(0.25 * ui.configuration.instruction.scale)
.translate(0, -0.6)
instruction.icons.hand.paint(
new Vec(0, 1)
.rotate(angle)
.mul(0.25 * ui.configuration.instruction.scale)
.add(position),
0.25 * ui.configuration.instruction.scale,
(180 * angle) / Math.PI,
0,
a * ui.configuration.instruction.alpha,
)
},
exit() {
noteDisplay.clear()
instruction.texts.clear()
},
}