Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
F
fireballoon
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
fireballoon
Commits
558892ae
Commit
558892ae
authored
May 26, 2022
by
yu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
倒计时,测评分数
parent
1669d13f
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
560 additions
and
39 deletions
+560
-39
AsapCondensed-Bold.ttf
assets/fireballoon/fonts/AsapCondensed-Bold.ttf
+0
-0
AsapCondensed-Bold.ttf.meta
assets/fireballoon/fonts/AsapCondensed-Bold.ttf.meta
+5
-0
fireballoon.fire
assets/fireballoon/scene/fireballoon.fire
+358
-38
fireballoon.ts
assets/fireballoon/scene/fireballoon.ts
+161
-1
bg_countdown.png
assets/fireballoon/textures/fireballoon/bg_countdown.png
+0
-0
bg_countdown.png.meta
...ts/fireballoon/textures/fireballoon/bg_countdown.png.meta
+36
-0
No files found.
assets/fireballoon/fonts/AsapCondensed-Bold.ttf
0 → 100644
View file @
558892ae
File added
assets/fireballoon/fonts/AsapCondensed-Bold.ttf.meta
0 → 100644
View file @
558892ae
{
"ver": "1.1.0",
"uuid": "e8b4fbb1-1dc1-427b-b27a-9cf2ccfefe93",
"subMetas": {}
}
\ No newline at end of file
assets/fireballoon/scene/fireballoon.fire
View file @
558892ae
This diff is collapsed.
Click to expand it.
assets/fireballoon/scene/fireballoon.ts
View file @
558892ae
...
@@ -81,6 +81,8 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -81,6 +81,8 @@ export default class SceneComponent extends MyCocosSceneComponent {
layout_tip
:
cc
.
Node
=
null
;
layout_tip
:
cc
.
Node
=
null
;
@
property
(
cc
.
Node
)
@
property
(
cc
.
Node
)
item_gun
:
cc
.
Node
=
null
;
item_gun
:
cc
.
Node
=
null
;
@
property
(
cc
.
Node
)
bg_countdown
:
cc
.
Node
=
null
;
@
property
(
cc
.
Node
)
@
property
(
cc
.
Node
)
item_left
:
cc
.
Node
=
null
;
item_left
:
cc
.
Node
=
null
;
...
@@ -96,9 +98,14 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -96,9 +98,14 @@ export default class SceneComponent extends MyCocosSceneComponent {
}
}
private
layout_start
:
cc
.
Node
;
private
layout_start
:
cc
.
Node
;
private
audioId
:
any
;
private
audioId
:
any
;
private
countDown
:
number
=
999999
;
private
timeCount
:
number
;
private
startCount
=
20
;
async
initView
()
{
async
initView
()
{
cc
.
audioEngine
.
stopAllEffects
();
cc
.
audioEngine
.
stopAllEffects
();
this
.
layout_start
=
pg
.
view
.
find
(
this
,
"
layout_start
"
);
this
.
layout_start
=
pg
.
view
.
find
(
this
,
"
layout_start
"
);
this
.
bg_countdown
=
pg
.
view
.
find
(
this
.
layout_speak
,
"
bg_countdown
"
);
let
touch
=
pg
.
view
.
find
(
this
,
"
layout_start/touch
"
);
let
touch
=
pg
.
view
.
find
(
this
,
"
layout_start/touch
"
);
this
.
layout_start
.
active
=
true
;
this
.
layout_start
.
active
=
true
;
...
@@ -447,11 +454,43 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -447,11 +454,43 @@ export default class SceneComponent extends MyCocosSceneComponent {
}
}
update
(
dt
)
{
update
(
dt
)
{
if
(
Game
.
getIns
().
state
!=
GAME_STATE
.
RUNNING
)
return
;
if
(
Game
.
getIns
().
state
!=
GAME_STATE
.
RUNNING
)
return
;
this
.
updateTime
(
dt
);
if
(
this
.
touching
)
return
;
if
(
this
.
touching
)
return
;
if
(
this
.
fishLen
<
5
)
this
.
count
++
;
if
(
this
.
fishLen
<
5
)
this
.
count
++
;
let
fish
=
this
.
getFishByCount
(
this
.
count
);
let
fish
=
this
.
getFishByCount
(
this
.
count
);
if
(
fish
)
this
.
fishs
.
push
(
fish
);
if
(
fish
)
this
.
fishs
.
push
(
fish
);
}
}
updateTime
(
dt
)
{
let
time
=
cc
.
find
(
"
time
"
,
this
.
bg_countdown
);
let
time2
=
cc
.
find
(
"
time2
"
,
this
.
bg_countdown
);
if
(
this
.
countDown
<=
0
)
{
this
.
onTouchRecordEnd
();
this
.
bg_countdown
.
active
=
false
;
cc
.
Tween
.
stopAllByTarget
(
time2
)
return
;
}
this
.
countDown
=
this
.
countDown
-
dt
;
if
(
this
.
countDown
<
6
)
{
let
count
=
Math
.
floor
(
this
.
countDown
);
time
.
active
=
false
;
time2
.
active
=
true
;
time2
.
getComponent
(
cc
.
Label
).
string
=
""
+
parseInt
(
""
+
this
.
countDown
);
if
(
count
!=
this
.
timeCount
)
{
this
.
timeCount
=
count
;
cc
.
tween
(
time2
)
.
to
(
0.3
,
{
scale
:
1.1
})
.
to
(
0.3
,
{
scale
:
1
})
.
to
(
0.3
,
{
scale
:
0.9
})
.
start
()
}
}
else
{
time2
.
active
=
false
;
time
.
active
=
true
;
time
.
getComponent
(
cc
.
Label
).
string
=
""
+
parseInt
(
""
+
this
.
countDown
);
}
}
updateTips
(
state
?:
TIPS_STATE
)
{
updateTips
(
state
?:
TIPS_STATE
)
{
if
(
!
state
)
{
if
(
!
state
)
{
this
.
layout_tip
.
active
=
false
;
this
.
layout_tip
.
active
=
false
;
...
@@ -514,6 +553,8 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -514,6 +553,8 @@ export default class SceneComponent extends MyCocosSceneComponent {
btn_stop
.
active
=
true
;
btn_stop
.
active
=
true
;
ske
.
getComponent
(
dragonBones
.
ArmatureDisplay
).
timeScale
=
1
;
ske
.
getComponent
(
dragonBones
.
ArmatureDisplay
).
timeScale
=
1
;
cc
.
audioEngine
.
stopAllEffects
();
cc
.
audioEngine
.
stopAllEffects
();
this
.
bg_countdown
.
active
=
true
;
this
.
countDown
=
this
.
startCount
;
let
end
=
pg
.
view
.
find
(
this
,
"
end
"
);
let
end
=
pg
.
view
.
find
(
this
,
"
end
"
);
let
bg_tryagain
=
pg
.
view
.
find
(
end
,
"
bg_tryagain
"
)
let
bg_tryagain
=
pg
.
view
.
find
(
end
,
"
bg_tryagain
"
)
...
@@ -531,6 +572,9 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -531,6 +572,9 @@ export default class SceneComponent extends MyCocosSceneComponent {
ske
.
getComponent
(
dragonBones
.
ArmatureDisplay
).
timeScale
=
10000
;
ske
.
getComponent
(
dragonBones
.
ArmatureDisplay
).
timeScale
=
10000
;
btn_stop
.
active
=
false
;
btn_stop
.
active
=
false
;
btn_start
.
active
=
false
;
btn_start
.
active
=
false
;
this
.
bg_countdown
.
active
=
false
;
this
.
countDown
=
999999
;
let
testData
=
{
let
testData
=
{
"
dtLastResponse
"
:
"
2021-09-17 13:36:26:109
"
,
"
dtLastResponse
"
:
"
2021-09-17 13:36:26:109
"
,
"
refText
"
:
"
I haven't found anything out about him yet.
"
,
"
refText
"
:
"
I haven't found anything out about him yet.
"
,
...
@@ -547,6 +591,103 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -547,6 +591,103 @@ export default class SceneComponent extends MyCocosSceneComponent {
"
duration
"
:
"
6.779
"
,
"
duration
"
:
"
6.779
"
,
"
rear_tone
"
:
"
fall
"
,
"
rear_tone
"
:
"
fall
"
,
"
speed
"
:
96
,
"
speed
"
:
96
,
"
words
"
:
[
{
"
phonemes
"
:
[
{
"
phoneme
"
:
"
w
"
,
"
pronunciation
"
:
55
,
"
span
"
:
{
"
end
"
:
95
,
"
start
"
:
88
}
},
{
"
phoneme
"
:
"
ɛ
"
,
"
pronunciation
"
:
100
,
"
span
"
:
{
"
end
"
:
107
,
"
start
"
:
95
}
},
{
"
phoneme
"
:
"
r
"
,
"
pronunciation
"
:
99
,
"
span
"
:
{
"
end
"
:
123
,
"
start
"
:
107
}
}
],
"
phonics
"
:
[
{
"
overall
"
:
85
,
"
phoneme
"
:
[
"
w
"
,
"
ɛ
"
,
"
r
"
],
"
spell
"
:
"
Where
"
}
],
"
scores
"
:
{
"
overall
"
:
80
,
"
pronunciation
"
:
92
},
"
span
"
:
{
"
end
"
:
123
,
"
start
"
:
88
},
"
word
"
:
"
Where
"
},
{
"
phonemes
"
:
[
{
"
phoneme
"
:
"
w
"
,
"
pronunciation
"
:
55
,
"
span
"
:
{
"
end
"
:
95
,
"
start
"
:
88
}
},
{
"
phoneme
"
:
"
ɛ
"
,
"
pronunciation
"
:
100
,
"
span
"
:
{
"
end
"
:
107
,
"
start
"
:
95
}
},
{
"
phoneme
"
:
"
r
"
,
"
pronunciation
"
:
99
,
"
span
"
:
{
"
end
"
:
123
,
"
start
"
:
107
}
}
],
"
phonics
"
:
[
{
"
overall
"
:
85
,
"
phoneme
"
:
[
"
w
"
,
"
ɛ
"
,
"
r
"
],
"
spell
"
:
"
Where
"
}
],
"
scores
"
:
{
"
overall
"
:
10
,
"
pronunciation
"
:
92
},
"
span
"
:
{
"
end
"
:
123
,
"
start
"
:
88
},
"
word
"
:
"
Where
"
}
]
},
},
"
tokenId
"
:
"
6144295408558b08dd000001
"
,
"
tokenId
"
:
"
6144295408558b08dd000001
"
,
"
applicationId
"
:
"
154838659000009e
"
"
applicationId
"
:
"
154838659000009e
"
...
@@ -563,12 +704,20 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -563,12 +704,20 @@ export default class SceneComponent extends MyCocosSceneComponent {
async
recrodEnd
(
data
)
{
async
recrodEnd
(
data
)
{
Game
.
getIns
().
player
.
addVoice
(
data
);
Game
.
getIns
().
player
.
addVoice
(
data
);
let
score
=
data
.
result
.
overall
;
let
score
=
data
.
result
.
overall
;
if
(
score
>=
70
)
{
let
isSuccess
=
this
.
checkWords
(
data
);
if
(
score
>=
70
&&
isSuccess
)
{
//提示成功
//提示成功
this
.
updateTips
(
TIPS_STATE
.
GOOD
);
this
.
updateTips
(
TIPS_STATE
.
GOOD
);
Game
.
getIns
().
player
.
addRight
();
Game
.
getIns
().
player
.
addRight
();
this
.
touchFishs
.
push
(
this
.
touchData
);
this
.
touchFishs
.
push
(
this
.
touchData
);
this
.
tryAgain
=
false
;
this
.
tryAgain
=
false
;
await
pg
.
time
.
delay
(
3
);
this
.
playCard
(
null
);
this
.
updateLayoutSpeak
(
true
);
this
.
updateTips
(
null
);
this
.
touching
=
false
;
Game
.
getIns
().
state
=
GAME_STATE
.
OVER
return
pg
.
event
.
emit
(
"
game_time_over
"
);
}
else
{
}
else
{
//提示失败
//提示失败
if
(
this
.
tryData
.
some
(
td
=>
td
.
id
==
this
.
touchData
.
id
))
{
if
(
this
.
tryData
.
some
(
td
=>
td
.
id
==
this
.
touchData
.
id
))
{
...
@@ -611,6 +760,17 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -611,6 +760,17 @@ export default class SceneComponent extends MyCocosSceneComponent {
cc
.
audioEngine
.
setFinishCallback
(
id
,
()
=>
{
resolve
(
id
);
});
cc
.
audioEngine
.
setFinishCallback
(
id
,
()
=>
{
resolve
(
id
);
});
})
})
}
}
private
checkWords
(
data
)
{
let
words
=
data
.
result
.
words
;
let
isSuccess
=
true
;
for
(
const
key
in
words
)
{
if
(
Object
.
prototype
.
hasOwnProperty
.
call
(
words
,
key
))
{
const
element
=
words
[
key
];
if
(
element
.
scores
.
overall
<=
40
)
return
isSuccess
=
false
;
}
}
return
isSuccess
;
}
}
}
assets/fireballoon/textures/fireballoon/bg_countdown.png
0 → 100644
View file @
558892ae
4.36 KB
assets/fireballoon/textures/fireballoon/bg_countdown.png.meta
0 → 100644
View file @
558892ae
{
"ver": "2.3.5",
"uuid": "67361827-5c47-490e-a223-95d13d0d6a31",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 106,
"height": 88,
"platformSettings": {},
"subMetas": {
"bg_countdown": {
"ver": "1.0.4",
"uuid": "a3f08beb-caa8-41fc-b029-3834d5436616",
"rawTextureUuid": "67361827-5c47-490e-a223-95d13d0d6a31",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 106,
"height": 88,
"rawWidth": 106,
"rawHeight": 88,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
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