|
@@ -7,6 +7,7 @@ import wheelImage from '@/assets/RoundaboutImage/2-09.png';
|
7
|
7
|
import cageImage from '@/assets/RoundaboutImage/2-13.png';
|
8
|
8
|
import pedestalImage from '@/assets/RoundaboutImage/2-14.png'
|
9
|
9
|
import countImage from '@/assets/RoundaboutImage/计数.png'
|
|
10
|
+import lightImage from '@/assets/RoundaboutImage/round.png'
|
10
|
11
|
import ropeImage1 from '@/assets/RoundaboutImage/2-15.png'
|
11
|
12
|
import ropeImage2 from '@/assets/RoundaboutImage/2-16.png'
|
12
|
13
|
import ropeImage3 from '@/assets/RoundaboutImage/2-17.png'
|
|
@@ -90,6 +91,7 @@ export default function game({ el, center, onError, onSuccess, onBingo }) {
|
90
|
91
|
|
91
|
92
|
// 绘制转盘
|
92
|
93
|
const wheelArc = two.makeCircle(center.x, center.y, 0);
|
|
94
|
+ const lightArc = two.makeCircle(center.x, center.y, 0);
|
93
|
95
|
const drawRoundAbout = () => {
|
94
|
96
|
const { x, y } = center
|
95
|
97
|
|
|
@@ -102,6 +104,18 @@ export default function game({ el, center, onError, onSuccess, onBingo }) {
|
102
|
104
|
wheelArc.scale = scale;
|
103
|
105
|
})
|
104
|
106
|
|
|
107
|
+ // 绘制光圈
|
|
108
|
+ const lightTexture = two.makeTexture(lightImage);
|
|
109
|
+ lightArc.noStroke();
|
|
110
|
+ lightArc.fill = lightTexture;
|
|
111
|
+ lightTexture.bind('load', () => {
|
|
112
|
+ lightArc.radius = lightTexture.image.naturalWidth / 2;
|
|
113
|
+ lightArc.scale = scale;
|
|
114
|
+ })
|
|
115
|
+ lightArc.bind('update', () => {
|
|
116
|
+ console.log('-----------lightArc----------')
|
|
117
|
+ })
|
|
118
|
+
|
105
|
119
|
// 绘制辅助扇形区域
|
106
|
120
|
const arcList = Array(cageNum).fill().map((_, inx) => {
|
107
|
121
|
const startAngle = 2 * inx * perAngle - offsetAngle; // 实际效果图是圆形有固定大小的, 不能直接从 0° 开始, 需要从 0 - offset 开始
|
|
@@ -135,6 +149,11 @@ export default function game({ el, center, onError, onSuccess, onBingo }) {
|
135
|
149
|
}
|
136
|
150
|
const roundAbout = drawRoundAbout()
|
137
|
151
|
|
|
152
|
+ // 成功之后的特效
|
|
153
|
+ const successEffect = () => {
|
|
154
|
+
|
|
155
|
+ }
|
|
156
|
+
|
138
|
157
|
// 旋转
|
139
|
158
|
const rotate = () => {
|
140
|
159
|
rotateAngle += rotateSpeed
|