-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwavegroup.js
More file actions
38 lines (30 loc) · 766 Bytes
/
wavegroup.js
File metadata and controls
38 lines (30 loc) · 766 Bytes
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 { Wave } from "./wave.js";
export class WaveGroup {
constructor() {
this.totalWaves = 3;
this.totalPoints = 6;
// 웨이브 레이아웃 색상
this.color = ['rgba(0,199,235,0.4)', 'rgba(0,146,199,0.4)', 'rgba(0,87,158,0.4)'];
this.waves = [];
for (let i = 0; i < this.totalWaves; i++) {
const wave = new Wave(
i,
this.totalPoints,
this.color[i],
);
this.waves[i] = wave;
}
}
resize(stageWidth, stageHeight) {
for (let i = 0; i < this.totalWaves; i++) {
const wave = this.waves[i];
wave.resize(stageWidth, stageHeight);
}
}
draw(ctx) {
for (let i = 0; i < this.totalWaves; i++) {
const wave = this.waves[i];
wave.draw(ctx);
}
}
}