Commit 8cd9f868 authored by Tt's avatar Tt

feat(动画效果): 添加闪光旋转效果并移除鱼雨延迟

parent 7f337bd1
......@@ -858,10 +858,9 @@ export class PlayComponent implements OnInit, OnDestroy {
this.updateCat();
this.startNextQuestion();
setTimeout(() => {
this.showFishRain('center');
}, 500);
// setTimeout(() => {
// this.showFishRain('center');
// }, 500);
}
nextBattle(playTime) {
......@@ -1755,6 +1754,30 @@ export class PlayComponent implements OnInit, OnDestroy {
// 渲染猫咪元素,确保在光束和鱼之间
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);
}
});
};
rotateShanGuang();
// 创建猫咪帧动画函数
const playCatAnimation = () => {
if (currentCatFrame <= maxFrame) {
......
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