@@ -4,7 +4,7 @@ import { Rectangle } from "../../../dataStruct/shape/Rectangle";
4
4
import { Vector } from "../../../dataStruct/Vector" ;
5
5
import { StageStyleManager } from "../../stageStyle/StageStyleManager" ;
6
6
import { EffectObject } from "../effectObject" ;
7
- import { ZapLineEffect } from "./ZapLineEffect " ;
7
+ import { TechLineEffect } from "./TechLineEffect " ;
8
8
9
9
export class EntityCreateLineEffect extends EffectObject {
10
10
constructor (
@@ -14,85 +14,87 @@ export class EntityCreateLineEffect extends EffectObject {
14
14
super ( timeProgress ) ;
15
15
// 子特效
16
16
this . subEffects = [ ] ;
17
+ const initLen = 20 ;
18
+ const segmentCount = 50 ;
19
+ const preChange = - 1 ;
20
+ // const effectColor = StageStyleManager.currentStyle.CollideBoxSelectedColor;
21
+ const effectColor = StageStyleManager . currentStyle . StageObjectBorderColor ;
22
+ const rotateDegrees = 90 ;
17
23
// 顶部线
18
- for ( let i = 0 ; i < 10 ; i ++ ) {
24
+ for ( let i = 0 ; i < 5 ; i ++ ) {
19
25
const topStartLocation = new Vector (
20
26
Random . randomFloat ( this . rect . left , this . rect . right ) ,
21
27
this . rect . top ,
22
28
) ;
23
- const topEndLocation = topStartLocation . add (
24
- topStartLocation . subtract ( this . rect . center ) . multiply ( 100 ) ,
25
- ) ;
26
- const zapLineEffect = new ZapLineEffect (
29
+ const topEndLocation = topStartLocation . add ( new Vector ( 0 , - 1000 ) ) ;
30
+ const zapLineEffect = new TechLineEffect (
27
31
topStartLocation ,
28
32
topEndLocation ,
29
- 50 ,
30
- 20 ,
31
- 45 ,
32
- StageStyleManager . currentStyle . StageObjectBorderColor ,
33
+ segmentCount ,
34
+ initLen ,
35
+ preChange ,
36
+ rotateDegrees ,
37
+ effectColor ,
33
38
this . timeProgress . clone ( ) ,
34
39
2 ,
35
40
) ;
36
41
this . subEffects . push ( zapLineEffect ) ;
37
42
}
38
43
// 底部线
39
- for ( let i = 0 ; i < 10 ; i ++ ) {
44
+ for ( let i = 0 ; i < 5 ; i ++ ) {
40
45
const bottomStartLocation = new Vector (
41
46
Random . randomFloat ( this . rect . left , this . rect . right ) ,
42
47
this . rect . bottom ,
43
48
) ;
44
- const bottomEndLocation = bottomStartLocation . add (
45
- bottomStartLocation . subtract ( this . rect . center ) . multiply ( 100 ) ,
46
- ) ;
47
- const zapLineEffect = new ZapLineEffect (
49
+ const bottomEndLocation = bottomStartLocation . add ( new Vector ( 0 , 1000 ) ) ;
50
+ const zapLineEffect = new TechLineEffect (
48
51
bottomStartLocation ,
49
52
bottomEndLocation ,
50
- 50 ,
51
- 20 ,
52
- 45 ,
53
- StageStyleManager . currentStyle . StageObjectBorderColor ,
53
+ segmentCount ,
54
+ initLen ,
55
+ preChange ,
56
+ rotateDegrees ,
57
+ effectColor ,
54
58
this . timeProgress . clone ( ) ,
55
59
2 ,
56
60
) ;
57
61
this . subEffects . push ( zapLineEffect ) ;
58
62
}
59
63
// 左侧线
60
- for ( let i = 0 ; i < 10 ; i ++ ) {
64
+ for ( let i = 0 ; i < 5 ; i ++ ) {
61
65
const leftStartLocation = new Vector (
62
66
this . rect . left ,
63
67
Random . randomFloat ( this . rect . top , this . rect . bottom ) ,
64
68
) ;
65
- const leftEndLocation = leftStartLocation . add (
66
- leftStartLocation . subtract ( this . rect . center ) . multiply ( 100 ) ,
67
- ) ;
68
- const zapLineEffect = new ZapLineEffect (
69
+ const leftEndLocation = leftStartLocation . add ( new Vector ( - 1000 , 0 ) ) ;
70
+ const zapLineEffect = new TechLineEffect (
69
71
leftStartLocation ,
70
72
leftEndLocation ,
71
- 50 ,
72
- 20 ,
73
- 45 ,
74
- StageStyleManager . currentStyle . StageObjectBorderColor ,
73
+ segmentCount ,
74
+ initLen ,
75
+ preChange ,
76
+ rotateDegrees ,
77
+ effectColor ,
75
78
this . timeProgress . clone ( ) ,
76
79
2 ,
77
80
) ;
78
81
this . subEffects . push ( zapLineEffect ) ;
79
82
}
80
83
// 右侧线
81
- for ( let i = 0 ; i < 10 ; i ++ ) {
84
+ for ( let i = 0 ; i < 5 ; i ++ ) {
82
85
const rightStartLocation = new Vector (
83
86
this . rect . right ,
84
87
Random . randomFloat ( this . rect . top , this . rect . bottom ) ,
85
88
) ;
86
- const rightEndLocation = rightStartLocation . add (
87
- rightStartLocation . subtract ( this . rect . center ) . multiply ( 100 ) ,
88
- ) ;
89
- const zapLineEffect = new ZapLineEffect (
89
+ const rightEndLocation = rightStartLocation . add ( new Vector ( 1000 , 0 ) ) ;
90
+ const zapLineEffect = new TechLineEffect (
90
91
rightStartLocation ,
91
92
rightEndLocation ,
92
- 50 ,
93
- 20 ,
94
- 45 ,
95
- StageStyleManager . currentStyle . StageObjectBorderColor ,
93
+ segmentCount ,
94
+ initLen ,
95
+ preChange ,
96
+ rotateDegrees ,
97
+ effectColor ,
96
98
this . timeProgress . clone ( ) ,
97
99
2 ,
98
100
) ;
0 commit comments