Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
NS02
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
NS02
Commits
bff22858
Commit
bff22858
authored
Dec 27, 2021
by
Tt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fabu
parent
5cb77a3c
Changes
13
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
108 additions
and
386 deletions
+108
-386
NS02.meta
assets/NS02.meta
+15
-1
NS02.ts
assets/NS02/scene/NS02.ts
+27
-23
NS022.ts
assets/NS02/scene/NS022.ts
+0
-303
NS022.ts.meta
assets/NS02/scene/NS022.ts.meta
+0
-9
chess.ts
assets/NS02/scene/chess.ts
+5
-1
hand_ani.ts
assets/NS02/scene/hand_ani.ts
+12
-11
movements.ts
assets/NS02/scene/movements.ts
+1
-3
pg.ts
assets/NS02/scene/pg.ts
+0
-2
speak.ts
assets/NS02/scene/speak.ts
+24
-21
start.ts
assets/NS02/scene/start.ts
+12
-4
touzi.ts
assets/NS02/scene/touzi.ts
+6
-2
text_tip.png
assets/NS02/textures/text_tip.png
+0
-0
text_tip.png.meta
assets/NS02/textures/text_tip.png.meta
+6
-6
No files found.
assets/NS02.meta
View file @
bff22858
{"ver":"1.1.2","uuid":"c35bb2f6-f24a-4850-ae44-643f2fdc7541","isBundle":false,"bundleName":"","priority":1,"compressionType":{},"optimizeHotUpdate":{},"inlineSpriteFrames":{},"isRemoteBundle":{"ios":false,"android":false},"subMetas":{}}
{
\ No newline at end of file
"ver": "1.1.2",
"uuid": "c35bb2f6-f24a-4850-ae44-643f2fdc7541",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {
"ios": false,
"android": false
},
"subMetas": {}
}
\ No newline at end of file
assets/NS02/scene/NS02.ts
View file @
bff22858
...
@@ -40,6 +40,10 @@ export default class NewClass extends MyCocosSceneComponent {
...
@@ -40,6 +40,10 @@ export default class NewClass extends MyCocosSceneComponent {
this
.
initView
();
this
.
initView
();
this
.
initEvent
();
this
.
initEvent
();
}
}
protected
onDestroy
():
void
{
cc
.
Tween
.
stopAll
();
this
.
unscheduleAllCallbacks
();
}
_cantouch
=
null
;
_cantouch
=
null
;
initData
()
{
initData
()
{
...
@@ -68,9 +72,7 @@ export default class NewClass extends MyCocosSceneComponent {
...
@@ -68,9 +72,7 @@ export default class NewClass extends MyCocosSceneComponent {
this
.
robotPoint
=
0
;
this
.
robotPoint
=
0
;
this
.
turnRobot
=
Math
.
random
()
<
0.5
;
this
.
turnRobot
=
Math
.
random
()
<
0.5
;
this
.
initChess
();
this
.
initChess
();
setTimeout
(()
=>
{
this
.
scheduleOnce
(
this
.
startTouzi
,
2.1
);
this
.
startTouzi
();
},
2100
);
}
}
onSpeakScueess
()
{
onSpeakScueess
()
{
//执行后续的动作。
//执行后续的动作。
...
@@ -177,7 +179,7 @@ export default class NewClass extends MyCocosSceneComponent {
...
@@ -177,7 +179,7 @@ export default class NewClass extends MyCocosSceneComponent {
}
}
return
return
}
}
setTimeout
(()
=>
{
this
.
scheduleOnce
(()
=>
{
let
cell
=
map
[
this
.
playerPoint
];
let
cell
=
map
[
this
.
playerPoint
];
let
val
=
cell
.
value
;
let
val
=
cell
.
value
;
let
type
=
Number
(
cell
.
type
);
let
type
=
Number
(
cell
.
type
);
...
@@ -186,9 +188,7 @@ export default class NewClass extends MyCocosSceneComponent {
...
@@ -186,9 +188,7 @@ export default class NewClass extends MyCocosSceneComponent {
pg
.
event
.
emit
(
"
speak_open
"
,
cell
)
pg
.
event
.
emit
(
"
speak_open
"
,
cell
)
break
;
break
;
case
CELLTYPE
.
DELAY_TIME
:
case
CELLTYPE
.
DELAY_TIME
:
setTimeout
(()
=>
{
this
.
scheduleOnce
(
this
.
turnNext
,
5
);
this
.
turnNext
();
},
5000
);
break
;
break
;
case
CELLTYPE
.
MOVE_ADD
:
case
CELLTYPE
.
MOVE_ADD
:
this
.
moveChess
(
Number
(
val
)).
then
(()
=>
{
this
.
moveChess
(
Number
(
val
)).
then
(()
=>
{
...
@@ -211,7 +211,7 @@ export default class NewClass extends MyCocosSceneComponent {
...
@@ -211,7 +211,7 @@ export default class NewClass extends MyCocosSceneComponent {
this
.
turnNext
();
this
.
turnNext
();
break
;
break
;
}
}
},
100
);
},
0.1
)
}
}
//-----------------------------TOUZI-------------------------------
//-----------------------------TOUZI-------------------------------
initTouzi
()
{
initTouzi
()
{
...
@@ -224,7 +224,7 @@ export default class NewClass extends MyCocosSceneComponent {
...
@@ -224,7 +224,7 @@ export default class NewClass extends MyCocosSceneComponent {
this
.
stopTouzi
();
this
.
stopTouzi
();
}
}
lastPointId
:
number
;
lastPointId
:
number
;
stopTouzi
(
runNum
=
0
)
{
stopTouzi
()
{
pg
.
audio
.
stopAudio
(
this
.
touziAudio
);
pg
.
audio
.
stopAudio
(
this
.
touziAudio
);
let
touzi_ani
=
pg
.
view
.
find
(
this
,
"
touzi_ani
"
);
let
touzi_ani
=
pg
.
view
.
find
(
this
,
"
touzi_ani
"
);
let
icon
=
pg
.
view
.
find
(
touzi_ani
,
"
icon
"
);
let
icon
=
pg
.
view
.
find
(
touzi_ani
,
"
icon
"
);
...
@@ -233,12 +233,15 @@ export default class NewClass extends MyCocosSceneComponent {
...
@@ -233,12 +233,15 @@ export default class NewClass extends MyCocosSceneComponent {
let
btn_stop
=
pg
.
view
.
find
(
touzi_ani
,
"
btn_stop
"
);
let
btn_stop
=
pg
.
view
.
find
(
touzi_ani
,
"
btn_stop
"
);
pg
.
view
.
visible
(
btn_stop
,
false
);
pg
.
view
.
visible
(
btn_stop
,
false
);
this
.
lastPointId
=
this
.
playerPoint
+
1
;
this
.
lastPointId
=
this
.
playerPoint
+
1
;
if
(
!
runNum
)
{
let
runNum
=
1
;
runNum
=
1
+
Math
.
floor
(
Math
.
random
()
*
6
);
let
rand
=
Math
.
random
();
if
(
this
.
turnRobot
)
runNum
=
1
+
Math
.
floor
(
Math
.
random
()
*
5
);
if
(
this
.
turnRobot
)
{
runNum
=
1
+
Math
.
floor
(
rand
*
5
);
}
else
{
runNum
=
1
+
Math
.
floor
(
rand
*
6
);
}
}
pg
.
view
.
visible
(
hand
,
false
);
pg
.
view
.
visible
(
hand
,
false
);
clearTimeout
(
this
.
stopHandTimer
);
this
.
unschedule
(
this
.
handVisible
);
touzi
.
stopAni
(
runNum
).
then
(()
=>
{
touzi
.
stopAni
(
runNum
).
then
(()
=>
{
pg
.
view
.
visible
(
touzi_ani
,
false
);
pg
.
view
.
visible
(
touzi_ani
,
false
);
pg
.
event
.
emit
(
"
player_point_update
"
,
{
isRobot
:
this
.
turnRobot
,
num
:
runNum
});
pg
.
event
.
emit
(
"
player_point_update
"
,
{
isRobot
:
this
.
turnRobot
,
num
:
runNum
});
...
@@ -247,7 +250,6 @@ export default class NewClass extends MyCocosSceneComponent {
...
@@ -247,7 +250,6 @@ export default class NewClass extends MyCocosSceneComponent {
})
})
})
})
}
}
private
stopHandTimer
:
number
;
private
touziAudio
:
number
;
private
touziAudio
:
number
;
startTouzi
()
{
startTouzi
()
{
let
touzi_ani
=
pg
.
view
.
find
(
this
,
"
touzi_ani
"
);
let
touzi_ani
=
pg
.
view
.
find
(
this
,
"
touzi_ani
"
);
...
@@ -255,22 +257,24 @@ export default class NewClass extends MyCocosSceneComponent {
...
@@ -255,22 +257,24 @@ export default class NewClass extends MyCocosSceneComponent {
let
touzi
=
icon
.
getComponent
(
"
touzi
"
);
let
touzi
=
icon
.
getComponent
(
"
touzi
"
);
let
hand
=
pg
.
view
.
find
(
touzi_ani
,
"
hand
"
);
let
hand
=
pg
.
view
.
find
(
touzi_ani
,
"
hand
"
);
let
btn_stop
=
pg
.
view
.
find
(
touzi_ani
,
"
btn_stop
"
);
let
btn_stop
=
pg
.
view
.
find
(
touzi_ani
,
"
btn_stop
"
);
pg
.
view
.
visible
(
btn_stop
,
true
);
pg
.
view
.
visible
(
touzi_ani
,
true
);
pg
.
view
.
visible
(
touzi_ani
,
true
);
touzi
.
startAni
();
touzi
.
startAni
();
if
(
this
.
turnRobot
)
{
if
(
this
.
turnRobot
)
{
setTimeout
(()
=>
{
this
.
scheduleOnce
(
this
.
stopTouzi
,
1
);
this
.
stopTouzi
();
},
300
+
Math
.
random
()
*
200
);
}
else
{
}
else
{
this
.
stopHandTimer
=
setTimeout
(()
=>
{
pg
.
view
.
visible
(
btn_stop
,
true
);
pg
.
view
.
visible
(
hand
,
true
);
this
.
scheduleOnce
(
this
.
handVisible
,
5
);
},
5000
);
}
}
pg
.
hw
.
playLocalAudio
(
"
touzi
"
,
true
).
then
((
id
:
number
)
=>
{
pg
.
hw
.
playLocalAudio
(
"
touzi
"
,
true
).
then
((
id
:
number
)
=>
{
this
.
touziAudio
=
id
;
this
.
touziAudio
=
id
;
})
})
}
}
handVisible
()
{
let
touzi_ani
=
pg
.
view
.
find
(
this
,
"
touzi_ani
"
);
let
hand
=
pg
.
view
.
find
(
touzi_ani
,
"
hand
"
);
pg
.
view
.
visible
(
hand
,
true
);
}
//----------------------------OVER-------------------
//----------------------------OVER-------------------
gameOver
()
{
gameOver
()
{
let
state
=
pg
.
view
.
find
(
this
,
"
state
"
);
let
state
=
pg
.
view
.
find
(
this
,
"
state
"
);
...
@@ -285,11 +289,11 @@ export default class NewClass extends MyCocosSceneComponent {
...
@@ -285,11 +289,11 @@ export default class NewClass extends MyCocosSceneComponent {
pg
.
view
.
visible
(
bg_win
,
false
);
pg
.
view
.
visible
(
bg_win
,
false
);
pg
.
view
.
visible
(
bg_lose
,
true
);
pg
.
view
.
visible
(
bg_lose
,
true
);
}
}
setTimeout
(()
=>
{
this
.
scheduleOnce
(()
=>
{
pg
.
view
.
visible
(
bg_win
,
false
);
pg
.
view
.
visible
(
bg_win
,
false
);
pg
.
view
.
visible
(
bg_lose
,
false
);
pg
.
view
.
visible
(
bg_lose
,
false
);
pg
.
event
.
emit
(
"
game_over
"
);
pg
.
event
.
emit
(
"
game_over
"
);
},
5
000
);
},
5
)
// onHomeworkFinish最后需要添加作业完成
// onHomeworkFinish最后需要添加作业完成
onHomeworkFinish
();
onHomeworkFinish
();
}
}
...
...
assets/NS02/scene/NS022.ts
deleted
100644 → 0
View file @
5cb77a3c
This diff is collapsed.
Click to expand it.
assets/NS02/scene/NS022.ts.meta
deleted
100644 → 0
View file @
5cb77a3c
{
"ver": "1.0.8",
"uuid": "408a67f8-65fa-4cf1-8cf2-83e20e1a0fd5",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}
\ No newline at end of file
assets/NS02/scene/chess.ts
View file @
bff22858
...
@@ -23,6 +23,10 @@ export default class NewClass extends cc.Component {
...
@@ -23,6 +23,10 @@ export default class NewClass extends cc.Component {
// LIFE-CYCLE CALLBACKS:
// LIFE-CYCLE CALLBACKS:
onLoad
()
{
onLoad
()
{
}
}
protected
onDestroy
():
void
{
cc
.
Tween
.
stopAll
();
this
.
unscheduleAllCallbacks
();
}
private
lastPoints
:
Array
<
Point
>
;
private
lastPoints
:
Array
<
Point
>
;
run
(
points
:
Array
<
Point
>
)
{
run
(
points
:
Array
<
Point
>
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
...
@@ -36,7 +40,7 @@ export default class NewClass extends cc.Component {
...
@@ -36,7 +40,7 @@ export default class NewClass extends cc.Component {
let
pos
=
posArray
[
i
];
let
pos
=
posArray
[
i
];
movementList
.
push
({
movementList
.
push
({
id
:
i
,
id
:
i
,
time
:
0.
2
,
time
:
0.
4
,
x
:
pos
.
x
,
x
:
pos
.
x
,
y
:
pos
.
y
,
y
:
pos
.
y
,
audionode
:
"
star
"
audionode
:
"
star
"
...
...
assets/NS02/scene/hand_ani.ts
View file @
bff22858
...
@@ -18,26 +18,27 @@ export default class NewClass extends cc.Component {
...
@@ -18,26 +18,27 @@ export default class NewClass extends cc.Component {
// LIFE-CYCLE CALLBACKS:
// LIFE-CYCLE CALLBACKS:
private
aning
;
onLoad
()
{
onLoad
()
{
this
.
showAni
();
this
.
aning
=
false
;
}
protected
onDestroy
():
void
{
cc
.
Tween
.
stopAll
();
this
.
unscheduleAllCallbacks
();
}
}
showAni
()
{
showAni
()
{
if
(
this
.
aning
)
return
;
if
(
this
.
node
&&
this
.
node
.
active
)
{
if
(
this
.
node
&&
this
.
node
.
active
)
{
this
.
node
.
x
+=
400
;
this
.
node
.
x
+=
400
;
this
.
node
.
y
-=
200
;
this
.
node
.
y
-=
200
;
cc
.
tween
(
this
.
node
).
by
(
0.3
,
{
x
:
-
400
,
y
:
200
}).
call
(()
=>
{
this
.
aning
=
true
;
setTimeout
(()
=>
{
cc
.
tween
(
this
.
node
).
by
(
0.3
,
{
x
:
-
400
,
y
:
200
}).
delay
(
1.5
).
call
(()
=>
{
this
.
showAni
();
this
.
aning
=
false
;
},
1500
);
}).
start
();
}
else
{
setTimeout
(()
=>
{
this
.
showAni
();
this
.
showAni
();
}
,
100
);
}
).
start
(
);
}
}
}
}
update
(
dt
)
{
update
(
dt
)
{
this
.
showAni
();
}
}
}
}
assets/NS02/scene/movements.ts
View file @
bff22858
...
@@ -48,9 +48,7 @@ class Movement {
...
@@ -48,9 +48,7 @@ class Movement {
this
.
loadCCNode
(
tween
,
moment
);
this
.
loadCCNode
(
tween
,
moment
);
});
});
tween
.
call
(()
=>
{
tween
.
call
(()
=>
{
setTimeout
(()
=>
{
setTimeout
(()
=>
{
resolve
(
''
);
},
0
);
resolve
(
''
);
},
0
);
})
})
tween
.
start
();
tween
.
start
();
});
});
...
...
assets/NS02/scene/pg.ts
View file @
bff22858
...
@@ -225,13 +225,11 @@ let pg = {
...
@@ -225,13 +225,11 @@ let pg = {
let
spriteFrame
=
new
cc
.
SpriteFrame
(
texture
);
let
spriteFrame
=
new
cc
.
SpriteFrame
(
texture
);
component
.
spriteFrame
=
spriteFrame
;
component
.
spriteFrame
=
spriteFrame
;
node
.
net_url
=
res
;
node
.
net_url
=
res
;
// setTimeout(() => {
if
(
!
cc
.
isValid
(
node
))
return
pg
.
logger
.
i
(
"
节点已销毁
"
);
if
(
!
cc
.
isValid
(
node
))
return
pg
.
logger
.
i
(
"
节点已销毁
"
);
if
(
!
node
)
return
pg
.
logger
.
w
(
"
节点已销毁
"
);
if
(
!
node
)
return
pg
.
logger
.
w
(
"
节点已销毁
"
);
node
.
width
=
w
;
node
.
width
=
w
;
node
.
height
=
h
;
node
.
height
=
h
;
node
.
active
=
true
;
node
.
active
=
true
;
// }, 30);
resolve
({
w
:
nw
,
h
:
nh
});
resolve
({
w
:
nw
,
h
:
nh
});
})
})
})
})
...
...
assets/NS02/scene/speak.ts
View file @
bff22858
...
@@ -51,6 +51,10 @@ export default class NewClass extends cc.Component {
...
@@ -51,6 +51,10 @@ export default class NewClass extends cc.Component {
})
})
}
}
protected
onDestroy
():
void
{
cc
.
Tween
.
stopAll
();
this
.
unscheduleAllCallbacks
();
}
private
tryCount
:
number
;
private
tryCount
:
number
;
private
val
:
string
;
private
val
:
string
;
open
(
cell
)
{
open
(
cell
)
{
...
@@ -86,7 +90,7 @@ export default class NewClass extends cc.Component {
...
@@ -86,7 +90,7 @@ export default class NewClass extends cc.Component {
pg
.
view
.
visible
(
this
.
btn_audio_stop
,
false
);
pg
.
view
.
visible
(
this
.
btn_audio_stop
,
false
);
let
win
:
any
=
window
;
let
win
:
any
=
window
;
if
(
!
win
.
courseware
)
{
if
(
!
win
.
courseware
)
{
setTimeout
(()
=>
{
this
.
scheduleOnce
(()
=>
{
let
data
=
{
let
data
=
{
"
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.
"
,
...
@@ -108,7 +112,7 @@ export default class NewClass extends cc.Component {
...
@@ -108,7 +112,7 @@ export default class NewClass extends cc.Component {
"
applicationId
"
:
"
154838659000009e
"
"
applicationId
"
:
"
154838659000009e
"
};
};
this
.
onRealStop
(
data
.
result
.
overall
);
this
.
onRealStop
(
data
.
result
.
overall
);
},
100
);
},
0.1
)
}
else
{
}
else
{
win
.
courseware
&&
win
.
courseware
.
stopTest
((
data
:
any
)
=>
{
win
.
courseware
&&
win
.
courseware
.
stopTest
((
data
:
any
)
=>
{
data
=
JSON
.
parse
(
data
);
data
=
JSON
.
parse
(
data
);
...
@@ -118,44 +122,43 @@ export default class NewClass extends cc.Component {
...
@@ -118,44 +122,43 @@ export default class NewClass extends cc.Component {
}
}
onRealStop
(
score
)
{
onRealStop
(
score
)
{
pg
.
view
.
playDBAnimation
(
this
.
speak_ske
,
"
newAnimation
"
,
1
);
let
db
=
pg
.
view
.
playDBAnimation
(
this
.
speak_ske
,
"
newAnimation
"
,
1
);
pg
.
view
.
visible
(
this
.
text_tip
,
false
);
db
.
once
(
dragonBones
.
EventObject
.
COMPLETE
,
()
=>
{
pg
.
view
.
visible
(
this
.
btn_audio_start
,
false
);
pg
.
view
.
visible
(
this
.
text_tip
,
false
);
pg
.
view
.
visible
(
this
.
btn_audio_stop
,
false
);
pg
.
view
.
visible
(
this
.
btn_audio_start
,
false
);
pg
.
view
.
visible
(
this
.
speak_ske
,
false
);
pg
.
view
.
visible
(
this
.
btn_audio_stop
,
false
);
pg
.
view
.
visible
(
this
.
bg_goodjob
,
false
);
pg
.
view
.
visible
(
this
.
speak_ske
,
false
);
pg
.
view
.
visible
(
this
.
bg_tryagain
,
false
);
pg
.
view
.
visible
(
this
.
bg_goodjob
,
false
);
pg
.
view
.
visible
(
this
.
bg_tryagain
,
false
);
setTimeout
(()
=>
{
// let score = Math.random() * 100 - 50;
pg
.
hw
.
playLocalAudio
(
"
goodjob
"
);
if
(
score
>
50
)
{
if
(
score
>
50
)
{
pg
.
hw
.
playLocalAudio
(
"
goodjob
"
);
pg
.
view
.
visible
(
this
.
bg_goodjob
,
true
);
pg
.
view
.
visible
(
this
.
bg_goodjob
,
true
);
setTimeout
(()
=>
{
this
.
scheduleOnce
(()
=>
{
this
.
close
();
this
.
close
();
pg
.
event
.
emit
(
"
speak_success
"
);
pg
.
event
.
emit
(
"
speak_success
"
);
},
2
000
);
},
2
.5
)
}
else
{
}
else
{
if
(
this
.
tryCount
>=
1
)
{
if
(
this
.
tryCount
>=
1
)
{
pg
.
view
.
visible
(
this
.
bg_tryagain
,
true
);
pg
.
view
.
visible
(
this
.
bg_tryagain
,
true
);
pg
.
hw
.
playLocalAudio
(
"
tryagain
"
);
pg
.
hw
.
playLocalAudio
(
"
tryagain
"
);
this
.
tryCount
++
;
this
.
tryCount
++
;
//需要处理提供两次机会。重置一次到open状态
//需要处理提供两次机会。重置一次到open状态
setTimeout
(()
=>
{
this
.
scheduleOnce
(()
=>
{
this
.
close
();
this
.
close
();
pg
.
event
.
emit
(
"
speak_fail
"
);
pg
.
event
.
emit
(
"
speak_fail
"
);
},
2000
);
},
2.5
)
}
else
{
}
else
{
pg
.
view
.
visible
(
this
.
bg_tryagain
,
true
);
pg
.
view
.
visible
(
this
.
bg_tryagain
,
true
);
pg
.
hw
.
playLocalAudio
(
"
tryagain
"
);
pg
.
hw
.
playLocalAudio
(
"
tryagain
"
);
this
.
tryCount
++
;
this
.
tryCount
++
;
setTimeout
(()
=>
{
this
.
scheduleOnce
(()
=>
{
this
.
open
(
null
);
this
.
open
(
null
);
},
1000
);
},
2.5
)
}
}
}
}
},
300
);
})
}
}
start
()
{
start
()
{
...
...
assets/NS02/scene/start.ts
View file @
bff22858
...
@@ -25,6 +25,10 @@ export default class NewClass extends cc.Component {
...
@@ -25,6 +25,10 @@ export default class NewClass extends cc.Component {
this
.
onGameOver
();
this
.
onGameOver
();
})
})
}
}
protected
onDestroy
():
void
{
cc
.
Tween
.
stopAll
();
this
.
unscheduleAllCallbacks
();
}
initView
()
{
initView
()
{
let
panel_gray
=
pg
.
view
.
find
(
this
,
"
panel_gray
"
);
let
panel_gray
=
pg
.
view
.
find
(
this
,
"
panel_gray
"
);
let
btn_start
=
pg
.
view
.
find
(
this
,
"
btn_start
"
);
let
btn_start
=
pg
.
view
.
find
(
this
,
"
btn_start
"
);
...
@@ -42,11 +46,15 @@ export default class NewClass extends cc.Component {
...
@@ -42,11 +46,15 @@ export default class NewClass extends cc.Component {
pg
.
view
.
visible
(
panel_gray
,
true
);
pg
.
view
.
visible
(
panel_gray
,
true
);
pg
.
view
.
visible
(
btn_start
,
false
);
pg
.
view
.
visible
(
btn_start
,
false
);
pg
.
view
.
visible
(
bg_vs
,
true
);
pg
.
view
.
visible
(
bg_vs
,
true
);
if
(
bg_vs
)
{
bg_vs
.
y
=
1000
;
cc
.
tween
(
bg_vs
).
to
(
0.2
,
{
y
:
0
}).
start
();
}
pg
.
event
.
emit
(
"
game_start
"
);
pg
.
event
.
emit
(
"
game_start
"
);
setTimeout
(()
=>
{
this
.
scheduleOnce
(()
=>
{
pg
.
view
.
visible
(
bg_vs
,
false
);
pg
.
view
.
visible
(
bg_vs
,
false
);
pg
.
view
.
visible
(
panel_gray
,
false
);
pg
.
view
.
visible
(
panel_gray
,
false
);
},
2
000
);
},
2
)
}
}
onTouchRestart
()
{
onTouchRestart
()
{
pg
.
hw
.
playLocalAudio
(
"
vs
"
);
pg
.
hw
.
playLocalAudio
(
"
vs
"
);
...
@@ -58,12 +66,12 @@ export default class NewClass extends cc.Component {
...
@@ -58,12 +66,12 @@ export default class NewClass extends cc.Component {
pg
.
view
.
visible
(
btn_start
,
false
);
pg
.
view
.
visible
(
btn_start
,
false
);
pg
.
view
.
visible
(
btn_restart
,
false
);
pg
.
view
.
visible
(
btn_restart
,
false
);
pg
.
view
.
visible
(
bg_vs
,
true
);
pg
.
view
.
visible
(
bg_vs
,
true
);
setTimeout
(()
=>
{
this
.
scheduleOnce
(()
=>
{
pg
.
view
.
visible
(
bg_vs
,
false
);
pg
.
view
.
visible
(
bg_vs
,
false
);
pg
.
view
.
visible
(
panel_gray
,
false
);
pg
.
view
.
visible
(
panel_gray
,
false
);
pg
.
view
.
visible
(
btn_restart
,
false
);
pg
.
view
.
visible
(
btn_restart
,
false
);
pg
.
event
.
emit
(
"
game_start
"
);
pg
.
event
.
emit
(
"
game_start
"
);
},
2
000
);
},
2
)
}
}
onGameOver
()
{
onGameOver
()
{
let
panel_gray
=
pg
.
view
.
find
(
this
,
"
panel_gray
"
);
let
panel_gray
=
pg
.
view
.
find
(
this
,
"
panel_gray
"
);
...
...
assets/NS02/scene/touzi.ts
View file @
bff22858
...
@@ -45,6 +45,10 @@ export default class NewClass extends cc.Component {
...
@@ -45,6 +45,10 @@ export default class NewClass extends cc.Component {
this
.
bg_dice5
=
pg
.
view
.
find
(
this
,
"
bg_dice5
"
);
this
.
bg_dice5
=
pg
.
view
.
find
(
this
,
"
bg_dice5
"
);
this
.
bg_dice6
=
pg
.
view
.
find
(
this
,
"
bg_dice6
"
);
this
.
bg_dice6
=
pg
.
view
.
find
(
this
,
"
bg_dice6
"
);
}
}
protected
onDestroy
():
void
{
cc
.
Tween
.
stopAll
();
this
.
unscheduleAllCallbacks
();
}
private
playing
:
boolean
;
private
playing
:
boolean
;
private
num
:
number
;
private
num
:
number
;
startAni
()
{
startAni
()
{
...
@@ -55,9 +59,9 @@ export default class NewClass extends cc.Component {
...
@@ -55,9 +59,9 @@ export default class NewClass extends cc.Component {
return
new
Promise
((
resolve
,
reject
)
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
this
.
num
=
number
;
this
.
num
=
number
;
this
.
playing
=
false
;
this
.
playing
=
false
;
setTimeout
(()
=>
{
this
.
scheduleOnce
(()
=>
{
resolve
(
''
);
resolve
(
''
);
},
1
500
);
},
1
.5
)
});
});
}
}
start
()
{
start
()
{
...
...
assets/NS02/textures/text_tip.png
View replaced file @
5cb77a3c
View file @
bff22858
10.6 KB
|
W:
|
H:
7.96 KB
|
W:
|
H:
2-up
Swipe
Onion skin
assets/NS02/textures/text_tip.png.meta
View file @
bff22858
...
@@ -18,12 +18,12 @@
...
@@ -18,12 +18,12 @@
"trimType": "auto",
"trimType": "auto",
"trimThreshold": 1,
"trimThreshold": 1,
"rotated": false,
"rotated": false,
"offsetX":
0
,
"offsetX":
-0.5
,
"offsetY":
0
,
"offsetY":
-0.5
,
"trimX":
0
,
"trimX":
124
,
"trimY":
0
,
"trimY":
1
,
"width":
698
,
"width":
449
,
"height": 12
9
,
"height": 12
8
,
"rawWidth": 698,
"rawWidth": 698,
"rawHeight": 129,
"rawHeight": 129,
"borderTop": 0,
"borderTop": 0,
...
...
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