Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
ngt10_tydh
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
ngt10_tydh
Commits
ca0b8e93
Commit
ca0b8e93
authored
Nov 25, 2022
by
yu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增无对错
parent
b4de7d17
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
81 additions
and
24 deletions
+81
-24
ngt10_tydh.fire
assets/ngt10_tydh/scene/ngt10_tydh.fire
+1
-1
ngt10_tydh.ts
assets/ngt10_tydh/scene/ngt10_tydh.ts
+63
-14
ngt10_layout_mouse1.ts
assets/ngt10_tydh/scene/small/ngt10_layout_mouse1.ts
+1
-1
Game.ts
assets/ngt10_tydh/scene/tool/Game.ts
+7
-3
defaultData.ts
assets/ngt10_tydh/script/defaultData.ts
+9
-5
No files found.
assets/ngt10_tydh/scene/ngt10_tydh.fire
View file @
ca0b8e93
...
...
@@ -9471,7 +9471,7 @@
},
{
"__type__": "cc.Node",
"_name": "
New Sprite(Splash)
",
"_name": "
mask
",
"_objFlags": 0,
"_parent": {
"__id__": 200
...
...
assets/ngt10_tydh/scene/ngt10_tydh.ts
View file @
ca0b8e93
import
{
asyncDelay
,
onHomeworkFinish
}
from
"
../script/util
"
;
import
{
MyCocosSceneComponent
}
from
"
../script/MyCocosSceneComponent
"
;
import
Game
,
{
GAME_STATE
}
from
"
./tool/Game
"
;
import
Game
,
{
GAME_STATE
,
Item
}
from
"
./tool/Game
"
;
import
pg
from
"
./tool/pg
"
;
const
{
ccclass
,
property
}
=
cc
.
_decorator
;
...
...
@@ -56,10 +56,12 @@ export default class SceneComponent extends MyCocosSceneComponent {
}
_cantouch
=
null
;
public
isFinish
:
boolean
;
private
tryData
:
Array
<
Item
>
;
initData
()
{
// 所有全局变量 默认都是null
this
.
_cantouch
=
true
;
this
.
isFinish
=
false
;
this
.
tryData
=
[];
Game
.
getIns
().
init
(
this
.
data
);
Game
.
getIns
().
reset
();
}
...
...
@@ -137,6 +139,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
pic
.
on
(
cc
.
Node
.
EventType
.
TOUCH_END
,
this
.
showBigPic
,
this
);
this
.
showLayoutImg
()
}
cc
.
find
(
"
btn_voice
"
,
this
.
node
).
active
=
question
.
audio
!=
""
;
}
private
showRecordWord
(
word
)
{
...
...
@@ -247,6 +250,8 @@ export default class SceneComponent extends MyCocosSceneComponent {
private
labaIntervalId
;
private
showLaba
(
show
=
false
)
{
let
question
=
Game
.
getIns
().
getCurrentPage
();
if
(
question
.
audio
==
""
)
return
;
this
.
btn_laba
.
active
=
false
;
let
btn_kaba2
=
cc
.
find
(
"
btn_voice2
"
,
this
.
img_laba
);
let
btn_kaba3
=
cc
.
find
(
"
btn_voice3
"
,
this
.
img_laba
);
...
...
@@ -267,7 +272,6 @@ export default class SceneComponent extends MyCocosSceneComponent {
clearInterval
(
this
.
labaIntervalId
);
}
},
150
);
let
question
=
Game
.
getIns
().
getCurrentPage
();
pg
.
audio
.
playAudioByUrl
(
question
.
audio
).
then
(()
=>
{
stop
=
true
;
show
&&
this
.
showTip
();
...
...
@@ -300,18 +304,34 @@ export default class SceneComponent extends MyCocosSceneComponent {
this
.
btn_record
.
active
=
true
;
this
.
img_record
.
active
=
false
;
this
.
showRecordWord
(
data
.
text
)
if
(
data
.
text
.
split
(
"
"
).
join
(
""
)
==
Game
.
getIns
().
getCurrentPage
().
word
.
split
(
"
"
).
join
(
""
))
{
this
.
playLocalAudio
(
"
right
"
).
then
(()
=>
{
this
.
playLocalAudio
(
"
diaoluo
"
);
});
pg
.
event
.
emit
(
"
box2d_next
"
)
pg
.
event
.
emit
(
"
mouse_10_add
"
);
Game
.
getIns
().
player
.
addRight
();
}
else
{
this
.
playLocalAudio
(
"
error
"
).
then
(()
=>
{
pg
.
event
.
emit
(
"
mouse_10_add_error
"
);
})
Game
.
getIns
().
player
.
addError
();
let
question
=
Game
.
getIns
().
getCurrentPage
();
if
(
!
question
.
isRecord
)
{
if
(
data
.
text
.
split
(
"
"
).
join
(
""
)
==
question
.
word
.
split
(
"
"
).
join
(
""
)
||
question
.
noWord
)
{
this
.
playLocalAudio
(
"
right
"
).
then
(()
=>
{
this
.
playLocalAudio
(
"
diaoluo
"
);
});
pg
.
event
.
emit
(
"
box2d_next
"
)
pg
.
event
.
emit
(
"
mouse_10_add
"
);
Game
.
getIns
().
player
.
addRight
();
}
else
{
//提示失败
this
.
playLocalAudio
(
"
error
"
).
then
(()
=>
{
pg
.
event
.
emit
(
"
mouse_10_add_error
"
);
})
Game
.
getIns
().
player
.
addError
();
this
.
tryData
.
push
(
question
);
this
.
showErrorNPC
();
}
question
.
isRecord
=
true
;
}
else
if
(
this
.
tryData
.
some
(
td
=>
td
.
page
==
question
.
page
))
{
if
(
data
.
text
.
split
(
"
"
).
join
(
""
)
==
question
.
word
.
split
(
"
"
).
join
(
""
))
{
this
.
playLocalAudio
(
"
right
"
).
then
(()
=>
{
});
}
else
{
this
.
playLocalAudio
(
"
error
"
).
then
(()
=>
{
})
}
pg
.
event
.
emit
(
"
mouse_10_num_game_end
"
)
}
}
...
...
@@ -390,7 +410,36 @@ export default class SceneComponent extends MyCocosSceneComponent {
});
}
private
showErrorNPC
()
{
let
start_ske
=
cc
.
find
(
"
layout_start/start_ske
"
,
this
.
node
);
let
mask
=
cc
.
find
(
"
mask
"
,
this
.
layout_start
);
mask
.
opacity
=
1
;
this
.
layout_start
.
active
=
true
;
pg
.
load
.
loadDB
(
start_ske
,
{
ske
:
Game
.
getIns
().
aniEnter
.
ske
.
url
,
tex
:
Game
.
getIns
().
aniEnter
.
tex
.
url
,
png
:
Game
.
getIns
().
aniEnter
.
png
.
url
}).
then
((
animationName
)
=>
{
if
(
animationName
&&
animationName
!=
""
)
{
let
db
=
start_ske
.
getComponent
(
dragonBones
.
ArmatureDisplay
);
let
anis
=
db
.
getAnimationNames
(
db
.
armatureName
);
db
.
playAnimation
(
anis
[
0
],
0
);
cc
.
tween
(
start_ske
).
by
(
0.5
,
{
x
:
-
500
}).
call
(()
=>
{
pg
.
audio
.
playAudioByUrl
(
Game
.
getIns
().
errorAudio
).
then
(()
=>
{
cc
.
tween
(
start_ske
).
delay
(
0.2
).
by
(
0.5
,
{
x
:
500
}).
call
(()
=>
{
this
.
layout_start
.
active
=
false
;
this
.
showTip
();
this
.
showRecordWord
(
""
);
}).
start
();
});
}).
start
();
}
else
{
this
.
layout_start
.
active
=
false
;
this
.
showTip
();
this
.
showRecordWord
(
""
);
}
})
}
private
initStart
()
{
let
mask
=
cc
.
find
(
"
mask
"
,
this
.
layout_start
);
mask
.
opacity
=
110
;
//生成橘子
pg
.
event
.
emit
(
'
box2d_init
'
,
Game
.
getIns
().
getTotalPageNum
());
this
.
layout_start
.
active
=
true
;
...
...
assets/ngt10_tydh/scene/small/ngt10_layout_mouse1.ts
View file @
ca0b8e93
...
...
@@ -126,7 +126,7 @@ export default class Ngt_star_10 extends cc.Component {
star
.
x
=
0
;
star
.
y
=
0
;
star
.
scale
=
1
/
bigStarBg
.
scale
;
pg
.
event
.
emit
(
"
mouse_10_num_game_end
"
)
//
pg.event.emit("mouse_10_num_game_end")
}
showBigStar
(
isRight
)
{
if
(
!
this
.
bigStarArr
||
this
.
bigStarArr
.
length
<=
0
)
{
...
...
assets/ngt10_tydh/scene/tool/Game.ts
View file @
ca0b8e93
...
...
@@ -48,14 +48,16 @@ export class Item {
public
word
;
public
picUrl
;
public
type
;
public
noWord
;
public
text
:
string
;
public
is
Click
:
boolean
;
public
is
Record
:
boolean
;
constructor
(
data
,
page
)
{
this
.
audio
=
data
.
audio
;
this
.
audio
=
data
.
audio
||
""
;
this
.
text
=
data
.
text
;
this
.
word
=
data
.
word
.
toLowerCase
();
this
.
type
=
data
.
type
;
this
.
duration
=
data
.
time
;
this
.
noWord
=
data
.
noWord
==
"
0
"
;
this
.
picUrl
=
data
.
image
;
this
.
page
=
page
;
...
...
@@ -66,7 +68,7 @@ export class Item {
// this.optionList.sort(function () {
// return (0.5 - Math.random());
// });
this
.
is
Click
=
false
;
this
.
is
Record
=
false
;
}
}
class
Role
{
...
...
@@ -150,11 +152,13 @@ export default class Game {
public
dispelCount
;
public
aniEnter
;
public
startAudio
:
string
;
public
errorAudio
:
string
;
// public questionText: string;
public
init
(
data
)
{
// this.question = { text: data.questionText, audio: data.questionTextAudio };
this
.
title
=
data
.
title
;
this
.
startAudio
=
data
.
startAudio
||
""
;
this
.
errorAudio
=
data
.
errorAudio
||
""
;
// this.questionText = data.questionText;
this
.
start
=
false
;
this
.
lists
=
[];
...
...
assets/ngt10_tydh/script/defaultData.ts
View file @
ca0b8e93
...
...
@@ -14,18 +14,20 @@ export const defaultData = {
}
},
"
tipSwitch
"
:
1
,
"
startAudio
"
:
"
http://staging-teach.cdn.ireadabc.com/36067f9e2415d59fa37c3795a3929087_l.mp3
"
,
"
startAudio
"
:
""
,
// "http://staging-teach.cdn.ireadabc.com/36067f9e2415d59fa37c3795a3929087_l.mp3",
"
errorAudio
"
:
"
http://staging-teach.cdn.ireadabc.com/36067f9e2415d59fa37c3795a3929087_l.mp3
"
,
"
audioName
"
:
"
bear_3.mp3
"
,
"
title
"
:
"
听音对话
"
,
"
questions
"
:
[
{
"
type
"
:
"
txt
"
,
"
audio
"
:
"
http://staging-teach.cdn.ireadabc.com/449e65975d358514cc3494f9f67bc012_l.mp3
"
,
"
audio
"
:
"
"
,
// "
http://staging-teach.cdn.ireadabc.com/449e65975d358514cc3494f9f67bc012_l.mp3",
"
text
"
:
"
what are you kettle ?
"
,
"
image
"
:
""
,
"
time
"
:
10
,
"
audioName
"
:
"
cape.mp3
"
,
"
word
"
:
"
Oh no
"
"
word
"
:
"
Oh no
"
,
"
noWord
"
:
"
0
"
},
{
"
type
"
:
"
img
"
,
...
...
@@ -34,7 +36,8 @@ export const defaultData = {
"
image
"
:
"
http://staging-teach.cdn.ireadabc.com/95c760f287a3c55bacc6c12ea47259ea.jpg
"
,
"
time
"
:
10
,
"
audioName
"
:
"
bear_2.mp3
"
,
"
word
"
:
"
join
"
"
word
"
:
"
join
"
,
"
noWord
"
:
"
1
"
},
{
"
type
"
:
"
txt
"
,
...
...
@@ -43,7 +46,8 @@ export const defaultData = {
"
image
"
:
""
,
"
time
"
:
20
,
"
audioName
"
:
"
bear_3.mp3
"
,
"
word
"
:
"
why
"
"
word
"
:
"
why
"
,
"
noWord
"
:
"
0
"
}
]
}
\ 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