Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
NS03
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
NS03
Commits
3772df25
Commit
3772df25
authored
Dec 30, 2021
by
Tt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改报错点
parent
7035f505
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
19 additions
and
226 deletions
+19
-226
Game.ts
assets/NS03/scene/Game.ts
+13
-0
NS03.ts
assets/NS03/scene/NS03.ts
+2
-1
audo_ani.ts
assets/NS03/scene/audo_ani.ts
+0
-31
audo_ani.ts.meta
assets/NS03/scene/audo_ani.ts.meta
+0
-9
chess.ts
assets/NS03/scene/chess.ts
+0
-67
chess.ts.meta
assets/NS03/scene/chess.ts.meta
+0
-9
player.ts
assets/NS03/scene/player.ts
+4
-3
touzi.ts
assets/NS03/scene/touzi.ts
+0
-97
touzi.ts.meta
assets/NS03/scene/touzi.ts.meta
+0
-9
No files found.
assets/NS03/scene/Game.ts
View file @
3772df25
...
@@ -21,8 +21,21 @@ export default class Game {
...
@@ -21,8 +21,21 @@ export default class Game {
public
robotLevel
:
number
;
public
robotLevel
:
number
;
constructor
()
{
constructor
()
{
//
//
this
.
start
=
false
;
}
}
public
init
()
{
this
.
start
=
false
;
this
.
lists
=
null
;
this
.
nowStem
=
null
;
this
.
pause
=
null
;
this
.
isRobot
=
null
;
this
.
playerScore
=
null
;
this
.
robotScore
=
null
;
this
.
robotLevel
=
null
;
}
public
start
:
boolean
;
reset
()
{
reset
()
{
this
.
start
=
true
;
this
.
lists
=
JSON
.
parse
(
JSON
.
stringify
(
Data
.
list
));
this
.
lists
=
JSON
.
parse
(
JSON
.
stringify
(
Data
.
list
));
this
.
pause
=
false
;
this
.
pause
=
false
;
this
.
isRobot
=
false
;
this
.
isRobot
=
false
;
...
...
assets/NS03/scene/NS03.ts
View file @
3772df25
...
@@ -39,6 +39,7 @@ export default class NewClass extends MyCocosSceneComponent {
...
@@ -39,6 +39,7 @@ export default class NewClass extends MyCocosSceneComponent {
cc
.
Tween
.
stopAll
();
cc
.
Tween
.
stopAll
();
this
.
unscheduleAllCallbacks
();
this
.
unscheduleAllCallbacks
();
pg
.
event
.
off
(
"
game_start
"
)
pg
.
event
.
off
(
"
game_start
"
)
pg
.
event
.
off
(
"
item_touch_right
"
)
pg
.
event
.
off
(
"
speak_success
"
);
pg
.
event
.
off
(
"
speak_success
"
);
pg
.
event
.
off
(
"
speak_fail
"
);
pg
.
event
.
off
(
"
speak_fail
"
);
}
}
...
@@ -49,7 +50,7 @@ export default class NewClass extends MyCocosSceneComponent {
...
@@ -49,7 +50,7 @@ export default class NewClass extends MyCocosSceneComponent {
this
.
log
(
"
test initData
"
)
this
.
log
(
"
test initData
"
)
// 所有全局变量 默认都是null
// 所有全局变量 默认都是null
this
.
_cantouch
=
true
;
this
.
_cantouch
=
true
;
Game
.
getIns
().
rese
t
();
Game
.
getIns
().
ini
t
();
//开始显示企鹅
//开始显示企鹅
}
}
initView
()
{
initView
()
{
...
...
assets/NS03/scene/audo_ani.ts
deleted
100644 → 0
View file @
7035f505
// Learn TypeScript:
// - https://docs.cocos.com/creator/manual/en/scripting/typescript.html
// Learn Attribute:
// - https://docs.cocos.com/creator/manual/en/scripting/reference/attributes.html
// Learn life-cycle callbacks:
// - https://docs.cocos.com/creator/manual/en/scripting/life-cycle-callbacks.html
const
{
ccclass
,
property
}
=
cc
.
_decorator
;
@
ccclass
export
default
class
NewClass
extends
cc
.
Component
{
@
property
(
cc
.
Label
)
label
:
cc
.
Label
=
null
;
@
property
text
:
string
=
'
hello
'
;
// LIFE-CYCLE CALLBACKS:
private
count
=
0
;
onLoad
()
{
this
.
count
=
0
;
}
update
(
dt
)
{
this
.
count
++
;
this
.
updateItems
();
}
updateItems
()
{
}
}
assets/NS03/scene/audo_ani.ts.meta
deleted
100644 → 0
View file @
7035f505
{
"ver": "1.0.8",
"uuid": "764039ec-62e7-416b-a01b-1f8dd451a870",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}
\ No newline at end of file
assets/NS03/scene/chess.ts
deleted
100644 → 0
View file @
7035f505
// Learn TypeScript:
// - https://docs.cocos.com/creator/manual/en/scripting/typescript.html
// Learn Attribute:
// - https://docs.cocos.com/creator/manual/en/scripting/reference/attributes.html
// Learn life-cycle callbacks:
// - https://docs.cocos.com/creator/manual/en/scripting/life-cycle-callbacks.html
import
movement
from
"
./movements
"
;
const
{
ccclass
,
property
}
=
cc
.
_decorator
;
interface
Point
{
id
:
string
;
blue_x
:
string
;
blue_y
:
string
;
yellow_x
:
string
;
yellow_y
:
string
;
}
@
ccclass
export
default
class
NewClass
extends
cc
.
Component
{
@
property
isRobot
:
boolean
=
false
;
// LIFE-CYCLE CALLBACKS:
onLoad
()
{
}
protected
onDestroy
():
void
{
cc
.
Tween
.
stopAll
();
this
.
unscheduleAllCallbacks
();
}
private
lastPoints
:
Array
<
Point
>
;
run
(
points
:
Array
<
Point
>
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
this
.
lastPoints
=
points
;
let
posArray
=
this
.
getPos
(
points
);
let
point0
=
posArray
.
shift
();
this
.
node
.
x
=
point0
.
x
;
this
.
node
.
y
=
point0
.
y
;
let
movementList
=
[]
for
(
let
i
=
0
;
i
<
posArray
.
length
;
i
++
)
{
let
pos
=
posArray
[
i
];
movementList
.
push
({
id
:
i
,
time
:
0.4
,
x
:
pos
.
x
,
y
:
pos
.
y
,
audionode
:
"
star
"
})
}
movement
.
loadTween
(
this
.
node
,
movementList
).
then
(()
=>
{
resolve
(
''
);
})
});
}
getPos
(
points
:
Array
<
Point
>
)
{
let
posArray
=
points
.
map
(
li
=>
{
let
pos
:
any
=
{
x
:
this
.
isRobot
?
li
.
blue_x
:
li
.
yellow_x
,
y
:
this
.
isRobot
?
li
.
blue_y
:
li
.
yellow_y
}
pos
.
x
=
Number
(
pos
.
x
);
pos
.
y
=
Number
(
pos
.
y
);
return
pos
;
});
return
posArray
;
}
// update (dt) {}
}
assets/NS03/scene/chess.ts.meta
deleted
100644 → 0
View file @
7035f505
{
"ver": "1.0.8",
"uuid": "00040df5-e4c9-4c8d-9fea-65b709873399",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}
\ No newline at end of file
assets/NS03/scene/player.ts
View file @
3772df25
...
@@ -19,11 +19,11 @@ export default class NewClass extends cc.Component {
...
@@ -19,11 +19,11 @@ export default class NewClass extends cc.Component {
this
.
player
=
pg
.
view
.
find
(
this
,
"
player
"
);
this
.
player
=
pg
.
view
.
find
(
this
,
"
player
"
);
this
.
robot
=
pg
.
view
.
find
(
this
,
"
robot
"
);
this
.
robot
=
pg
.
view
.
find
(
this
,
"
robot
"
);
pg
.
event
.
on
(
"
player_point_update
"
,
(
data
)
=>
{
//
pg.event.on("player_point_update", (data) => {
})
//
})
}
}
protected
onDestroy
():
void
{
protected
onDestroy
():
void
{
pg
.
event
.
off
(
"
player_point_update
"
);
//
pg.event.off("player_point_update");
}
}
updatePlayer
()
{
updatePlayer
()
{
let
icon_player
=
pg
.
view
.
find
(
this
.
player
,
"
icon_player
"
);
let
icon_player
=
pg
.
view
.
find
(
this
.
player
,
"
icon_player
"
);
...
@@ -42,6 +42,7 @@ export default class NewClass extends cc.Component {
...
@@ -42,6 +42,7 @@ export default class NewClass extends cc.Component {
pg
.
view
.
setString
(
score
,
`
${
Game
.
getIns
().
playerScore
}
:
${
Game
.
getIns
().
robotScore
}
`
);
pg
.
view
.
setString
(
score
,
`
${
Game
.
getIns
().
playerScore
}
:
${
Game
.
getIns
().
robotScore
}
`
);
}
}
update
(
dt
)
{
update
(
dt
)
{
if
(
!
Game
||
!
Game
.
getIns
()
||
!
Game
.
getIns
().
start
)
return
;
this
.
updatePlayer
();
this
.
updatePlayer
();
this
.
updateRobot
();
this
.
updateRobot
();
this
.
updateScore
();
this
.
updateScore
();
...
...
assets/NS03/scene/touzi.ts
deleted
100644 → 0
View file @
7035f505
// Learn TypeScript:
// - https://docs.cocos.com/creator/manual/en/scripting/typescript.html
// Learn Attribute:
// - https://docs.cocos.com/creator/manual/en/scripting/reference/attributes.html
// Learn life-cycle callbacks:
// - https://docs.cocos.com/creator/manual/en/scripting/life-cycle-callbacks.html
import
pg
from
"
./pg
"
;
const
{
ccclass
,
property
}
=
cc
.
_decorator
;
@
ccclass
export
default
class
NewClass
extends
cc
.
Component
{
@
property
(
cc
.
Label
)
label
:
cc
.
Label
=
null
;
@
property
text
:
string
=
'
hello
'
;
// LIFE-CYCLE CALLBACKS:
private
bg_1
:
cc
.
Node
;
private
bg_2
:
cc
.
Node
;
private
bg_3
:
cc
.
Node
;
private
bg_4
:
cc
.
Node
;
private
bg_5
:
cc
.
Node
;
private
bg_6
:
cc
.
Node
;
private
bg_dice1
:
cc
.
Node
;
private
bg_dice2
:
cc
.
Node
;
private
bg_dice3
:
cc
.
Node
;
private
bg_dice4
:
cc
.
Node
;
private
bg_dice5
:
cc
.
Node
;
private
bg_dice6
:
cc
.
Node
;
onLoad
()
{
this
.
bg_1
=
pg
.
view
.
find
(
this
,
"
bg_1
"
);
this
.
bg_2
=
pg
.
view
.
find
(
this
,
"
bg_2
"
);
this
.
bg_3
=
pg
.
view
.
find
(
this
,
"
bg_3
"
);
this
.
bg_4
=
pg
.
view
.
find
(
this
,
"
bg_4
"
);
this
.
bg_5
=
pg
.
view
.
find
(
this
,
"
bg_5
"
);
this
.
bg_6
=
pg
.
view
.
find
(
this
,
"
bg_6
"
);
this
.
bg_dice1
=
pg
.
view
.
find
(
this
,
"
bg_dice1
"
);
this
.
bg_dice2
=
pg
.
view
.
find
(
this
,
"
bg_dice2
"
);
this
.
bg_dice3
=
pg
.
view
.
find
(
this
,
"
bg_dice3
"
);
this
.
bg_dice4
=
pg
.
view
.
find
(
this
,
"
bg_dice4
"
);
this
.
bg_dice5
=
pg
.
view
.
find
(
this
,
"
bg_dice5
"
);
this
.
bg_dice6
=
pg
.
view
.
find
(
this
,
"
bg_dice6
"
);
}
protected
onDestroy
():
void
{
cc
.
Tween
.
stopAll
();
this
.
unscheduleAllCallbacks
();
}
private
playing
:
boolean
;
private
num
:
number
;
startAni
()
{
this
.
playing
=
true
;
this
.
num
=
null
;
}
stopAni
(
number
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
this
.
num
=
number
;
this
.
playing
=
false
;
this
.
scheduleOnce
(()
=>
{
resolve
(
''
);
},
1.5
)
});
}
start
()
{
}
updatePoint
(
number
)
{
if
(
!
number
)
return
;
if
(
this
.
num
)
{
for
(
let
i
=
1
;
i
<=
6
;
i
++
)
{
pg
.
view
.
visible
(
this
[
`bg_
${
i
}
`
],
false
)
}
for
(
let
i
=
1
;
i
<=
6
;
i
++
)
{
pg
.
view
.
visible
(
this
[
`bg_dice
${
i
}
`
],
i
==
number
)
}
}
else
{
for
(
let
i
=
1
;
i
<=
6
;
i
++
)
{
pg
.
view
.
visible
(
this
[
`bg_
${
i
}
`
],
i
==
number
)
}
for
(
let
i
=
1
;
i
<=
6
;
i
++
)
{
pg
.
view
.
visible
(
this
[
`bg_dice
${
i
}
`
],
false
)
}
}
}
update
(
dt
)
{
if
(
!
this
.
node
||
!
this
.
node
.
active
)
return
;
if
(
this
.
playing
)
{
let
i
=
Math
.
floor
(
Math
.
random
()
*
6
)
+
1
;
this
.
updatePoint
(
i
);
}
else
{
this
.
updatePoint
(
this
.
num
);
}
}
}
assets/NS03/scene/touzi.ts.meta
deleted
100644 → 0
View file @
7035f505
{
"ver": "1.0.8",
"uuid": "96a89d6c-d01a-480c-8b3b-38cf93279c5c",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"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