Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
ns16_mole
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
ns16_mole
Commits
e4bbc241
Commit
e4bbc241
authored
Oct 18, 2022
by
Tt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改正确后的流程逻辑
parent
0184c1c6
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
64 additions
and
43 deletions
+64
-43
layout_mole.ts
assets/ns16_mole/scene/game/layout_mole.ts
+26
-23
ns16_mole.fire
assets/ns16_mole/scene/ns16_mole.fire
+36
-20
ns16_mole.ts
assets/ns16_mole/scene/ns16_mole.ts
+2
-0
No files found.
assets/ns16_mole/scene/game/layout_mole.ts
View file @
e4bbc241
...
@@ -182,7 +182,7 @@ export default class NewClass extends cc.Component {
...
@@ -182,7 +182,7 @@ export default class NewClass extends cc.Component {
let
img_add
=
pg
.
view
.
find
(
item
,
'
img_add
'
)
let
img_add
=
pg
.
view
.
find
(
item
,
'
img_add
'
)
pg
.
view
.
visible
(
img_add
,
true
);
pg
.
view
.
visible
(
img_add
,
true
);
img_add
.
position
=
cc
.
v3
(
cc
.
v2
(
135
,
70
));
img_add
.
position
=
cc
.
v3
(
cc
.
v2
(
135
,
70
));
cc
.
tween
(
img_add
).
by
(
0.5
,
{
y
:
80
}).
delay
(
3
).
call
(()
=>
{
cc
.
tween
(
img_add
).
by
(
0.5
,
{
y
:
80
}).
delay
(
1
).
call
(()
=>
{
pg
.
view
.
visible
(
img_add
,
false
);
pg
.
view
.
visible
(
img_add
,
false
);
resolve
(
""
)
resolve
(
""
)
}).
start
();
}).
start
();
...
@@ -213,7 +213,7 @@ export default class NewClass extends cc.Component {
...
@@ -213,7 +213,7 @@ export default class NewClass extends cc.Component {
let
mouse_wrong
=
pg
.
view
.
find
(
item
,
"
mask/mouse_wrong
"
);
let
mouse_wrong
=
pg
.
view
.
find
(
item
,
"
mask/mouse_wrong
"
);
// 点击之后判断对错。
// 点击之后判断对错。
if
(
data
.
right
)
{
if
(
data
.
right
)
{
this
.
playLocalAudio
(
'
right
'
);
this
.
right
.
push
(
data
);
this
.
right
.
push
(
data
);
let
isOver
=
this
.
right
.
length
>=
Game
.
getIns
().
getCurrentPageRight
()
let
isOver
=
this
.
right
.
length
>=
Game
.
getIns
().
getCurrentPageRight
()
if
(
isOver
)
{
if
(
isOver
)
{
...
@@ -228,28 +228,31 @@ export default class NewClass extends cc.Component {
...
@@ -228,28 +228,31 @@ export default class NewClass extends cc.Component {
this
.
robotAddOne
();
this
.
robotAddOne
();
}
}
let
startPos
=
cc
.
v2
(
10
,
-
114
);
let
startPos
=
cc
.
v2
(
10
,
-
114
);
this
.
playLocalAudio
(
'
right
'
)
this
.
playAddOne
(
item
).
then
(()
=>
{
this
.
playAddOne
(
item
).
then
(()
=>
{
if
(
isOver
)
{
pg
.
audio
.
playAudioByUrlThen
(
data
.
audioUrl
).
then
(()
=>
{
this
.
scaleTo0
();
if
(
isOver
)
{
}
else
{
this
.
scaleTo0
();
let
orgPos
=
cc
.
v2
(
mouse_right
);
}
else
{
cc
.
tween
(
mouse_normal
).
to
(
0.5
,
{
y
:
startPos
.
y
}).
call
(()
=>
{
}).
start
();
let
orgPos
=
cc
.
v2
(
mouse_right
);
cc
.
tween
(
mouse_right
).
delay
(
1.5
).
to
(
0.5
,
{
y
:
startPos
.
y
}).
call
(()
=>
{
cc
.
tween
(
mouse_normal
).
to
(
0.5
,
{
y
:
startPos
.
y
}).
call
(()
=>
{
}).
start
();
mouse_right
.
x
=
orgPos
.
x
;
cc
.
tween
(
mouse_right
).
delay
(
0.5
).
to
(
0.5
,
{
y
:
startPos
.
y
}).
call
(()
=>
{
mouse_right
.
y
=
orgPos
.
y
;
mouse_right
.
x
=
orgPos
.
x
;
mouse_right
.
active
=
false
;
mouse_right
.
y
=
orgPos
.
y
;
item
.
data
.
touching
=
false
;
mouse_right
.
active
=
false
;
item
.
data
=
null
item
.
data
.
touching
=
false
;
}).
start
();
item
.
data
=
null
}
}).
start
();
if
(
isRobot
)
{
}
Game
.
getIns
().
robot
.
addScore
();
if
(
isRobot
)
{
}
else
{
Game
.
getIns
().
robot
.
addScore
();
Game
.
getIns
().
player
.
addScore
();
}
else
{
}
Game
.
getIns
().
player
.
addScore
();
if
(
isOver
)
{
}
return
pg
.
event
.
emit
(
"
game_time_over
"
);
if
(
isOver
)
{
}
return
pg
.
event
.
emit
(
"
game_time_over
"
);
}
})
})
})
}
else
{
}
else
{
this
.
playLocalAudio
(
'
error
'
);
this
.
playLocalAudio
(
'
error
'
);
...
...
assets/ns16_mole/scene/ns16_mole.fire
View file @
e4bbc241
...
@@ -275,7 +275,7 @@
...
@@ -275,7 +275,7 @@
"__id__": 16
"__id__": 16
}
}
],
],
"_active":
fals
e,
"_active":
tru
e,
"_components": [],
"_components": [],
"_prefab": null,
"_prefab": null,
"_opacity": 255,
"_opacity": 255,
...
@@ -419,7 +419,7 @@
...
@@ -419,7 +419,7 @@
"_contentSize": {
"_contentSize": {
"__type__": "cc.Size",
"__type__": "cc.Size",
"width": 0,
"width": 0,
"height":
0
"height":
50.4
},
},
"_anchorPoint": {
"_anchorPoint": {
"__type__": "cc.Vec2",
"__type__": "cc.Vec2",
...
@@ -463,7 +463,11 @@
...
@@ -463,7 +463,11 @@
"__id__": 7
"__id__": 7
},
},
"_enabled": true,
"_enabled": true,
"_materials": [],
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_dstBlendFactor": 771,
"_string": "",
"_string": "",
...
@@ -512,7 +516,7 @@
...
@@ -512,7 +516,7 @@
"_contentSize": {
"_contentSize": {
"__type__": "cc.Size",
"__type__": "cc.Size",
"width": 0,
"width": 0,
"height":
0
"height":
50.4
},
},
"_anchorPoint": {
"_anchorPoint": {
"__type__": "cc.Vec2",
"__type__": "cc.Vec2",
...
@@ -556,7 +560,11 @@
...
@@ -556,7 +560,11 @@
"__id__": 9
"__id__": 9
},
},
"_enabled": true,
"_enabled": true,
"_materials": [],
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_dstBlendFactor": 771,
"_string": "",
"_string": "",
...
@@ -605,7 +613,7 @@
...
@@ -605,7 +613,7 @@
"_contentSize": {
"_contentSize": {
"__type__": "cc.Size",
"__type__": "cc.Size",
"width": 0,
"width": 0,
"height":
0
"height":
50.4
},
},
"_anchorPoint": {
"_anchorPoint": {
"__type__": "cc.Vec2",
"__type__": "cc.Vec2",
...
@@ -649,7 +657,11 @@
...
@@ -649,7 +657,11 @@
"__id__": 11
"__id__": 11
},
},
"_enabled": true,
"_enabled": true,
"_materials": [],
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_dstBlendFactor": 771,
"_string": "",
"_string": "",
...
@@ -804,7 +816,11 @@
...
@@ -804,7 +816,11 @@
"__id__": 14
"__id__": 14
},
},
"_enabled": true,
"_enabled": true,
"_materials": [],
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_dstBlendFactor": 771,
"_spriteFrame": {
"_spriteFrame": {
...
@@ -4177,8 +4193,8 @@
...
@@ -4177,8 +4193,8 @@
},
},
"_contentSize": {
"_contentSize": {
"__type__": "cc.Size",
"__type__": "cc.Size",
"width": 1
60
,
"width": 1
39.74
,
"height":
50.4
"height":
75.6
},
},
"_anchorPoint": {
"_anchorPoint": {
"__type__": "cc.Vec2",
"__type__": "cc.Vec2",
...
@@ -4245,7 +4261,7 @@
...
@@ -4245,7 +4261,7 @@
"_N$horizontalAlign": 1,
"_N$horizontalAlign": 1,
"_N$verticalAlign": 1,
"_N$verticalAlign": 1,
"_N$fontFamily": "Arial",
"_N$fontFamily": "Arial",
"_N$overflow":
2
,
"_N$overflow":
0
,
"_N$cacheMode": 0,
"_N$cacheMode": 0,
"_id": "98V92Z1ClMVrrUKmZB8Vzo"
"_id": "98V92Z1ClMVrrUKmZB8Vzo"
},
},
...
@@ -4539,8 +4555,8 @@
...
@@ -4539,8 +4555,8 @@
},
},
"_contentSize": {
"_contentSize": {
"__type__": "cc.Size",
"__type__": "cc.Size",
"width": 1
60
,
"width": 1
39.74
,
"height":
50.4
"height":
75.6
},
},
"_anchorPoint": {
"_anchorPoint": {
"__type__": "cc.Vec2",
"__type__": "cc.Vec2",
...
@@ -4607,7 +4623,7 @@
...
@@ -4607,7 +4623,7 @@
"_N$horizontalAlign": 1,
"_N$horizontalAlign": 1,
"_N$verticalAlign": 1,
"_N$verticalAlign": 1,
"_N$fontFamily": "Arial",
"_N$fontFamily": "Arial",
"_N$overflow":
2
,
"_N$overflow":
0
,
"_N$cacheMode": 0,
"_N$cacheMode": 0,
"_id": "49s1h6X8tJtpXkR3LzYS43"
"_id": "49s1h6X8tJtpXkR3LzYS43"
},
},
...
@@ -4831,8 +4847,8 @@
...
@@ -4831,8 +4847,8 @@
},
},
"_contentSize": {
"_contentSize": {
"__type__": "cc.Size",
"__type__": "cc.Size",
"width": 1
60
,
"width": 1
36.38
,
"height":
50.4
"height":
75.6
},
},
"_anchorPoint": {
"_anchorPoint": {
"__type__": "cc.Vec2",
"__type__": "cc.Vec2",
...
@@ -4883,8 +4899,8 @@
...
@@ -4883,8 +4899,8 @@
],
],
"_srcBlendFactor": 770,
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_dstBlendFactor": 771,
"_string": "
Label
",
"_string": "
apple
",
"_N$string": "
Label
",
"_N$string": "
apple
",
"_fontSize": 60,
"_fontSize": 60,
"_lineHeight": 60,
"_lineHeight": 60,
"_enableWrapText": true,
"_enableWrapText": true,
...
@@ -4899,7 +4915,7 @@
...
@@ -4899,7 +4915,7 @@
"_N$horizontalAlign": 1,
"_N$horizontalAlign": 1,
"_N$verticalAlign": 1,
"_N$verticalAlign": 1,
"_N$fontFamily": "Arial",
"_N$fontFamily": "Arial",
"_N$overflow":
2
,
"_N$overflow":
0
,
"_N$cacheMode": 0,
"_N$cacheMode": 0,
"_id": "e5MQB3C9NDMaLIX5ihC7yy"
"_id": "e5MQB3C9NDMaLIX5ihC7yy"
},
},
...
@@ -7029,7 +7045,7 @@
...
@@ -7029,7 +7045,7 @@
"__id__": 158
"__id__": 158
}
}
],
],
"_active":
tru
e,
"_active":
fals
e,
"_components": [],
"_components": [],
"_prefab": null,
"_prefab": null,
"_opacity": 255,
"_opacity": 255,
...
...
assets/ns16_mole/scene/ns16_mole.ts
View file @
e4bbc241
...
@@ -125,8 +125,10 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -125,8 +125,10 @@ export default class SceneComponent extends MyCocosSceneComponent {
}
}
let
totalNumber
=
Game
.
getIns
().
totalNumber
;
let
totalNumber
=
Game
.
getIns
().
totalNumber
;
if
(
Game
.
getIns
().
singleGame
)
{
if
(
Game
.
getIns
().
singleGame
)
{
this
.
log
(
"
player:
"
+
JSON
.
stringify
({
player
,
totalNumber
}));
onHomeworkFinish
({
player
,
totalNumber
})
onHomeworkFinish
({
player
,
totalNumber
})
}
else
{
}
else
{
this
.
log
(
"
player:
"
+
JSON
.
stringify
({
player
,
robot
,
totalNumber
}));
onHomeworkFinish
({
player
,
robot
,
totalNumber
})
onHomeworkFinish
({
player
,
robot
,
totalNumber
})
}
}
this
.
log
(
"
player:
"
+
JSON
.
stringify
(
player
));
this
.
log
(
"
player:
"
+
JSON
.
stringify
(
player
));
...
...
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