Commit e7dff08f authored by Tt's avatar Tt

fix(play): 调整猫咪动画位置并延迟闪光效果

parent 8cd9f868
......@@ -1749,34 +1749,38 @@ export class PlayComponent implements OnInit, OnDestroy {
catWave.ref.scaleX = this.g_mapScale;
catWave.ref.scaleY = this.g_mapScale;
catWave.ref.x = fishX;
catWave.ref.y = 525 * this.g_mapScale;
catWave.ref.y = 600 * this.g_mapScale;
moveItem(catWave.ref, fishX, 525 * this.g_mapScale, 0.1);
// 渲染猫咪元素,确保在光束和鱼之间
this.render(catWave.ref, zIndexMap.cat + 9.5);
// 创建闪光旋转效果
const shanGuang = this.g_cartoon.createCartoonElement('shan_guang', 'MySprite');
shanGuang.ref.init(this.g_cartoon.images.get('shan_guang'));
shanGuang.ref.scaleX = this.g_mapScale;
shanGuang.ref.scaleY = this.g_mapScale;
shanGuang.ref.x = fishX;
shanGuang.ref.y = 525 * this.g_mapScale;
this.render(shanGuang.ref, zIndexMap.cat + 9.2); // 在猫咪动画后面
let keepRotating = true;
const rotateShanGuang = () => {
if (!keepRotating) {
return;
}
rotateItem(shanGuang.ref, 360, 3, () => {
if (keepRotating) {
shanGuang.ref.rotation = 0;
const timeoutId = setTimeout(rotateShanGuang, 0);
this.m_setTimeoutIDs.push(timeoutId);
setTimeout(() => {
// 创建闪光旋转效果
const shanGuang = this.g_cartoon.createCartoonElement('shan_guang', 'MySprite');
shanGuang.ref.init(this.g_cartoon.images.get('shan_guang'));
shanGuang.ref.scaleX = this.g_mapScale;
shanGuang.ref.scaleY = this.g_mapScale;
shanGuang.ref.x = fishX;
shanGuang.ref.y = 525 * this.g_mapScale;
this.render(shanGuang.ref, zIndexMap.cat + 9.2); // 在猫咪动画后面
let keepRotating = true;
const rotateShanGuang = () => {
if (!keepRotating) {
return;
}
});
};
rotateShanGuang();
rotateItem(shanGuang.ref, 360, 3, () => {
if (keepRotating) {
shanGuang.ref.rotation = 0;
const timeoutId = setTimeout(rotateShanGuang, 0);
this.m_setTimeoutIDs.push(timeoutId);
}
});
};
rotateShanGuang();
}, 100);
// 创建猫咪帧动画函数
const playCatAnimation = () => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment