Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
SSAPP2502
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
SSAPP2502
Commits
d744c78f
Commit
d744c78f
authored
Aug 03, 2025
by
Tt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
敲碎
parent
35d3e306
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
55 deletions
+18
-55
SSAPP2501.ts
assets/SSAPP2501/scene/SSAPP2501.ts
+18
-49
SSAPP2501_Game.ts
assets/SSAPP2501/scene/tool/SSAPP2501_Game.ts
+0
-6
No files found.
assets/SSAPP2501/scene/SSAPP2501.ts
View file @
d744c78f
...
...
@@ -301,7 +301,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
this
.
layout
.
removeAllChildren
();
const
len
=
5
;
this
.
needScroll
=
true
;
//
this.needScroll = true;
const
visibleData
=
pageData
.
slice
(
0
,
len
);
this
.
pendingCandyData
=
pageData
.
slice
(
len
);
visibleData
.
forEach
((
data
,
index
)
=>
{
...
...
@@ -333,7 +333,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
* 移除了喷水动画相关代码
* @param e 事件对象或包含target属性的模拟事件对象
*/
private
current
Fire
Node
:
CandyNode
;
private
current
Touch
Node
:
CandyNode
;
async
onTouchItemNode
(
e
)
{
if
(
this
.
touching
)
return
;
this
.
touching
=
true
;
...
...
@@ -341,7 +341,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
// 保存触摸数据
this
.
touchData
=
candyNode
.
data
;
this
.
touchData
.
parent
=
candyNode
;
this
.
current
Fire
Node
=
candyNode
;
this
.
current
Touch
Node
=
candyNode
;
// 获取糖果节点的位置和背景节点
const
bgFullNode
=
candyNode
.
getChildByName
(
'
bg_full
'
);
...
...
@@ -386,44 +386,14 @@ export default class SceneComponent extends MyCocosSceneComponent {
this
.
showCard
(
true
,
'
init
'
);
}
onFireSuccess
()
{
const
fireNode
=
this
.
currentFireNode
;
// 更新糖果背景状态:隐藏bg_full,显示bg_broken
const
bgFullNode
=
fireNode
.
getChildByName
(
'
bg_full
'
);
const
bgBrokenNode
=
fireNode
.
getChildByName
(
'
bg_broken
'
);
if
(
bgFullNode
)
{
bgFullNode
.
active
=
false
;
}
if
(
bgBrokenNode
)
{
bgBrokenNode
.
active
=
true
;
}
// 如果不需要滚动,则直接从活跃列表中移除并隐藏节点
if
(
!
this
.
needScroll
)
{
// 从活跃火苗列表中移除当前火苗
const
index
=
this
.
activeFireNodes
.
indexOf
(
fireNode
);
if
(
index
!==
-
1
)
{
this
.
activeFireNodes
.
splice
(
index
,
1
);
}
// 隐藏对应的fire节点
fireNode
.
active
=
false
;
}
else
{
// 如果需要滚动,标记节点为已点击但保持显示状态
// 将节点设置为不可交互,防止重复点击
fireNode
.
off
(
cc
.
Node
.
EventType
.
TOUCH_END
,
this
.
onTouchItemNode
,
this
);
}
// 移除了与页面a和页面b相关的逻辑
// 移除了与消防车冲水动画相关的代码
onRecordSuccess
()
{
const
fireNode
=
this
.
currentTouchNode
;
const
index
=
this
.
activeFireNodes
.
indexOf
(
fireNode
);
if
(
index
!==
-
1
)
this
.
activeFireNodes
.
splice
(
index
,
1
);
fireNode
.
active
=
false
;
this
.
touching
=
false
;
// 重置无操作计时器
this
.
inactiveTimer
=
0
;
// 检查当前页面是否所有火苗都已处理完毕
if
(
this
.
activeFireNodes
.
length
===
0
)
{
// 延迟一段时间后检查是否需要切换到下一页
...
...
@@ -433,8 +403,8 @@ export default class SceneComponent extends MyCocosSceneComponent {
},
1.0
);
// 延迟1秒,给用户时间看到当前页面的完成状态
}
}
on
Fire
Fail
()
{
const
fireNode
=
this
.
current
Fire
Node
;
on
Record
Fail
()
{
const
fireNode
=
this
.
current
Touch
Node
;
// 将火苗节点重新添加到活跃列表中,以便再次尝试
if
(
fireNode
&&
!
this
.
activeFireNodes
.
includes
(
fireNode
))
{
...
...
@@ -570,7 +540,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
showCard
(
show
:
boolean
=
true
,
recordState
:
string
=
'
init
'
)
{
if
(
show
)
{
// 显示卡片
const
currentData
=
this
.
current
Fire
Node
.
data
;
const
currentData
=
this
.
current
Touch
Node
.
data
;
console
.
log
(
'
showCard
'
,
currentData
)
this
.
layout_speak
.
active
=
true
;
...
...
@@ -672,7 +642,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
private
renderProgressLabel
(
label_progress
)
{
// 获取当前正确答题的数量和总题目数量
// 使用player.right表示录音返回结果不是tryagain的答题数据数量
const
correctAnswers
=
Game
.
getIns
().
player
.
right
;
const
correctAnswers
=
Game
.
getIns
().
player
.
voices
.
length
;
const
totalQuestions
=
Game
.
getIns
().
total
;
// 设置进度文本 (正确答题数量)/(总数)
pg
.
view
.
setString
(
label_progress
,
`
${
correctAnswers
+
1
}
/
${
totalQuestions
}
`
);
...
...
@@ -742,16 +712,16 @@ export default class SceneComponent extends MyCocosSceneComponent {
// 获取最后一次录音数据
const
lastVoice
=
Game
.
getIns
().
player
.
getLastVoice
();
// 如果有录音数据,则使用其分数
if
(
lastVoice
&&
lastVoice
.
result
)
{
if
(
lastVoice
&&
lastVoice
.
result
&&
lastVoice
.
questionId
==
this
.
touchData
.
id
)
{
const
score
=
lastVoice
.
result
.
overall
;
if
(
score
>=
10
)
{
this
.
on
Fire
Success
();
this
.
on
Record
Success
();
}
else
{
this
.
on
Fire
Fail
();
this
.
on
Record
Fail
();
}
}
else
{
// 如果没有录音数据,默认失败
this
.
on
Fire
Fail
();
this
.
on
Record
Fail
();
}
}
...
...
@@ -862,7 +832,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
"
fluency
"
:
84
,
"
integrity
"
:
100
,
"
kernel_version
"
:
"
3.7.1
"
,
"
overall
"
:
8
,
"
overall
"
:
6
8
,
"
pronunciation
"
:
88
,
"
resource_version
"
:
"
2.3.11
"
,
"
rhythm
"
:
46
,
...
...
@@ -989,7 +959,6 @@ export default class SceneComponent extends MyCocosSceneComponent {
}
// 增加正确计数
Game
.
getIns
().
player
.
addRight
();
this
.
tryAgain
=
false
;
// 如果有父节点(火苗节点),隐藏它
...
...
@@ -1020,7 +989,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
this
.
showCard
(
false
);
this
.
updateTips
(
null
);
this
.
recordTouching
=
false
;
this
.
on
Fire
Fail
();
this
.
on
Record
Fail
();
return
;
}
}
else
{
...
...
assets/SSAPP2501/scene/tool/SSAPP2501_Game.ts
View file @
d744c78f
...
...
@@ -75,12 +75,6 @@ class Role {
addError
(
score
:
number
=
1
)
{
this
.
error
+=
score
;
}
/**
* 增加正确次数
*/
addRight
()
{
this
.
right
+=
1
;
}
/**
* 添加语音记录
* @param obj 语音对象
...
...
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