Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
SSIWB2504
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
template admin
SSIWB2504
Commits
45810069
Commit
45810069
authored
Aug 15, 2025
by
Tt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(play): 修复双模态下音频播放和鱼动画问题
parent
fd3bd85f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
6 deletions
+13
-6
play.component.ts
src/app/play/play.component.ts
+13
-6
No files found.
src/app/play/play.component.ts
View file @
45810069
...
@@ -50,7 +50,7 @@ import { FormData, Position, PositionMap, Stage, Question } from './interfaces';
...
@@ -50,7 +50,7 @@ import { FormData, Position, PositionMap, Stage, Question } from './interfaces';
let
defaultFormData
:
FormData
=
{
let
defaultFormData
:
FormData
=
{
"
score
"
:
0
,
"
score
"
:
0
,
"
title
"
:
""
,
"
title
"
:
""
,
"
doubleModal
"
:
tru
e
,
"
doubleModal
"
:
fals
e
,
"
questionText
"
:
""
,
"
questionType
"
:
"
read
"
,
"
questionTextAudio
"
:
""
,
"
questionText
"
:
""
,
"
questionType
"
:
"
read
"
,
"
questionTextAudio
"
:
""
,
"
bgAudio
"
:
""
,
"
bgAudio
"
:
""
,
"
questions
"
:
[
"
questions
"
:
[
...
@@ -972,8 +972,14 @@ export class PlayComponent implements OnInit, OnDestroy {
...
@@ -972,8 +972,14 @@ export class PlayComponent implements OnInit, OnDestroy {
this
.
m_lastFishTime
=
0
;
// 重置上次生成鱼的时间,使下一帧立即生成鱼
this
.
m_lastFishTime
=
0
;
// 重置上次生成鱼的时间,使下一帧立即生成鱼
// 每一个stage开始的时候播放一次正确问题的音频
// 每一个stage开始的时候播放一次正确问题的音频
if
(
currentQuestion
.
correctQuestion
&&
currentQuestion
.
correctQuestion
.
audio
&&
(
this
.
g_formData
.
doubleModal
||
this
.
currentStageIndex
!==
0
))
{
if
(
currentQuestion
.
correctQuestion
&&
currentQuestion
.
correctQuestion
.
audio
)
{
this
.
g_cartoon
.
playAudio
(
currentQuestion
.
correctQuestion
.
audio
);
if
((
this
.
g_formData
.
doubleModal
||
this
.
currentStageIndex
!==
0
))
{
setTimeout
(()
=>
{
this
.
g_cartoon
.
playAudio
(
currentQuestion
.
correctQuestion
.
audio
);
},
500
);
}
else
{
this
.
g_cartoon
.
playAudio
(
currentQuestion
.
correctQuestion
.
audio
);
}
}
}
}
}
...
@@ -1570,6 +1576,7 @@ export class PlayComponent implements OnInit, OnDestroy {
...
@@ -1570,6 +1576,7 @@ export class PlayComponent implements OnInit, OnDestroy {
this
.
cat_right
=
this
.
createCat
(
'
right
'
);
// 创建右侧猫
this
.
cat_right
=
this
.
createCat
(
'
right
'
);
// 创建右侧猫
}
else
{
}
else
{
this
.
cat_center
=
this
.
createCat
(
'
center
'
);
// 创建中间猫
this
.
cat_center
=
this
.
createCat
(
'
center
'
);
// 创建中间猫
this
.
currentPlayer
=
'
center
'
;
}
}
}
}
...
@@ -1586,7 +1593,7 @@ export class PlayComponent implements OnInit, OnDestroy {
...
@@ -1586,7 +1593,7 @@ export class PlayComponent implements OnInit, OnDestroy {
this
.
cat_left
[
"
child_mao_hui_zuo
"
].
ref
.
visible
=
false
;
this
.
cat_left
[
"
child_mao_hui_zuo
"
].
ref
.
visible
=
false
;
this
.
cat_left
[
"
child_mao_hui_pa
"
].
ref
.
visible
=
false
;
this
.
cat_left
[
"
child_mao_hui_pa
"
].
ref
.
visible
=
false
;
this
.
cat_left
[
"
child_gan
"
].
ref
.
visible
=
true
;
this
.
cat_left
[
"
child_gan
"
].
ref
.
visible
=
true
;
}
else
{
}
else
if
(
this
.
currentPlayer
==
'
right
'
)
{
this
.
cat_right
[
"
child_mao_ju_zuo
"
].
ref
.
visible
=
false
;
this
.
cat_right
[
"
child_mao_ju_zuo
"
].
ref
.
visible
=
false
;
this
.
cat_right
[
"
child_mao_ju_pa
"
].
ref
.
visible
=
false
;
this
.
cat_right
[
"
child_mao_ju_pa
"
].
ref
.
visible
=
false
;
this
.
cat_right
[
"
child_mao_hui_zuo
"
].
ref
.
visible
=
true
;
this
.
cat_right
[
"
child_mao_hui_zuo
"
].
ref
.
visible
=
true
;
...
@@ -1628,7 +1635,7 @@ export class PlayComponent implements OnInit, OnDestroy {
...
@@ -1628,7 +1635,7 @@ export class PlayComponent implements OnInit, OnDestroy {
tempFish
.
ref
.
y
=
fishGlobalY
;
tempFish
.
ref
.
y
=
fishGlobalY
;
// 3. 获取水桶的全局位置
// 3. 获取水桶的全局位置
const
tong
=
this
.
getCurrentCat
()[
this
.
currentPlayer
==
'
left
'
?
'
child_tong_left
'
:
'
child_tong_righ
t
'
];
const
tong
=
this
.
getCurrentCat
()[
this
.
currentPlayer
==
'
right
'
?
'
child_tong_right
'
:
'
child_tong_lef
t
'
];
const
tongGlobalX
=
this
.
getCurrentCat
().
ref
.
x
+
tong
.
ref
.
x
;
const
tongGlobalX
=
this
.
getCurrentCat
().
ref
.
x
+
tong
.
ref
.
x
;
const
tongGlobalY
=
this
.
getCurrentCat
().
ref
.
y
+
tong
.
ref
.
y
;
const
tongGlobalY
=
this
.
getCurrentCat
().
ref
.
y
+
tong
.
ref
.
y
;
...
@@ -1649,7 +1656,7 @@ export class PlayComponent implements OnInit, OnDestroy {
...
@@ -1649,7 +1656,7 @@ export class PlayComponent implements OnInit, OnDestroy {
// 动画完成后移除临时小鱼
// 动画完成后移除临时小鱼
this
.
m_renderArr
=
this
.
m_renderArr
.
filter
(
item
=>
item
!==
tempFish
.
ref
);
this
.
m_renderArr
=
this
.
m_renderArr
.
filter
(
item
=>
item
!==
tempFish
.
ref
);
tempFish
.
ref
.
visible
=
false
;
tempFish
.
ref
.
visible
=
false
;
this
.
playShuiHuaAnimation
(
this
.
getCurrentCat
()[
this
.
currentPlayer
==
'
left
'
?
'
child_tong_left_shui_hua
'
:
'
child_tong_righ
t_shui_hua
'
]);
this
.
playShuiHuaAnimation
(
this
.
getCurrentCat
()[
this
.
currentPlayer
==
'
right
'
?
'
child_tong_right_shui_hua
'
:
'
child_tong_lef
t_shui_hua
'
]);
this
.
saveFishSuccess
(
fish
);
this
.
saveFishSuccess
(
fish
);
},
},
TWEEN
.
Easing
.
Quadratic
.
Out
// 使用缓动函数使动画更平滑
TWEEN
.
Easing
.
Quadratic
.
Out
// 使用缓动函数使动画更平滑
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment