Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OPW_BoardGame_L5R4
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
OPW_BoardGame_L5R4
Commits
7735f9a1
Commit
7735f9a1
authored
Nov 24, 2022
by
李维
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加头像击用户名
parent
38eb50bc
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
878 additions
and
321 deletions
+878
-321
OPW_BoardGame_L5R4.fire
assets/OPW_BoardGame_L5R4/scene/OPW_BoardGame_L5R4.fire
+851
-293
OPW_BoardGame_L5R4.ts
assets/OPW_BoardGame_L5R4/scene/OPW_BoardGame_L5R4.ts
+27
-28
No files found.
assets/OPW_BoardGame_L5R4/scene/OPW_BoardGame_L5R4.fire
View file @
7735f9a1
This diff is collapsed.
Click to expand it.
assets/OPW_BoardGame_L5R4/scene/OPW_BoardGame_L5R4.ts
View file @
7735f9a1
...
...
@@ -20,7 +20,6 @@ const MSG_TEST = "msg_test";
const
MSG_SWITCHSIDE
=
"
msg_switch_side
"
;
const
MSG_ROLLING
=
"
msg_rolling
"
;
const
MSG_GO
=
"
msg_go
"
;
const
MSG_BACK
=
"
msg_back
"
;
const
MSG_TIMEOUT
=
"
msg_timeout
"
;
const
MSG_FINISH
=
"
msg_finish
"
;
const
MSG_PLAYER_TO_TREE
=
"
msg_player_to_tree
"
;
...
...
@@ -73,7 +72,6 @@ export default class SceneComponent extends MyCocosSceneComponent {
do
{
this
.
playerId
=
await
this
.
networkHelper
.
init
(
"
l2_boardgame2_tree
"
,
2
);
if
(
this
.
playerId
===
null
)
{
console
.
log
(
"
onDestroy
"
);
this
.
networkHelper
.
onDestroy
();
}
console
.
log
(
"
this.playerId =
"
+
this
.
playerId
);
...
...
@@ -187,6 +185,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
this
.
loadingLayer
.
onLoadFinished
(()
=>
{
this
.
initSide
();
this
.
initTimer
();
this
.
initPlayerInfo
();
});
}
...
...
@@ -309,7 +308,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
playerDB
=
this
.
bluePlayerDB
;
}
asyncPlayDragonBoneAnimation
(
playerDB
,
'
jump
'
,
-
1
);
return
new
Promise
((
resovle
,
reject
)
=>
{
cc
.
tween
(
playerNode
).
to
(
0.5
,
{
x
:
205
,
y
:
23
}).
call
(()
=>
{
asyncPlayDragonBoneAnimation
(
playerDB
,
'
normal
'
,
-
1
);
...
...
@@ -654,7 +653,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
// 转盘
this
.
registerEvent
(
MSG_ROLLING
,
(
param
,
next
)
=>
{
console
.
log
(
"
转盘结果:
"
,
param
.
nextGem
)
//
console.log("转盘结果:", param.nextGem)
this
.
turntable
.
stopBlink
();
this
.
turntable
.
rollNum
(
param
.
nextGem
.
score
).
then
(()
=>
{
// 异步操作执行完成后调用
...
...
@@ -667,11 +666,6 @@ export default class SceneComponent extends MyCocosSceneComponent {
// 走棋
this
.
registerEvent
(
MSG_GO
,
(
param
,
next
)
=>
{
console
.
log
(
"
走棋开始
"
);
// setTimeout(() => {
// console.log("走棋结束");
// next()
// }, 2000);
if
(
this
.
currentGameSide
==
RED
)
{
this
.
playerToGem
(
this
.
redPlayerNode
,
this
.
gemstonesAll
[
param
.
index
]).
then
(()
=>
{
next
(
param
);
...
...
@@ -700,26 +694,9 @@ export default class SceneComponent extends MyCocosSceneComponent {
})
})
// 后退
this
.
registerEvent
(
MSG_BACK
,
(
param
,
next
)
=>
{
console
.
log
(
"
走棋开始
"
);
setTimeout
(()
=>
{
console
.
log
(
"
走棋结束
"
);
next
()
},
2000
);
},
()
=>
{
// 游戏流程3: 测评 - 对手不会出现测评界面
this
.
runFunctionMySide
(()
=>
{
console
.
log
(
"
语音评测开始
"
);
setTimeout
(()
=>
{
console
.
log
(
"
语音评测结束
"
)
},
2000
);
})
})
// 时间到
this
.
registerEvent
(
MSG_TIMEOUT
,
(
param
,
next
)
=>
{
console
.
log
(
"
时间到
"
)
//
console.log("时间到")
this
.
turntable
.
disable
();
this
.
turntable
.
stopBlink
();
setTimeout
(()
=>
{
...
...
@@ -793,7 +770,6 @@ export default class SceneComponent extends MyCocosSceneComponent {
const
arrIndex1
=
gem
.
__arrIndex1
;
const
arrIndex2
=
gem
.
__arrIndex2
;
gem
.
__isDone
=
true
;
console
.
log
(
this
.
gemstones
[
arrIndex1
][
arrIndex2
]);
}
// 走棋
...
...
@@ -801,6 +777,29 @@ export default class SceneComponent extends MyCocosSceneComponent {
}
// 初始化用户信息 头像 名字
initPlayerInfo
()
{
const
red
=
cc
.
find
(
"
Canvas/playerLand/red/header/image
"
);
const
blue
=
cc
.
find
(
"
Canvas/playerLand/blue/header/image
"
);
const
redName
=
cc
.
find
(
"
Canvas/playerLand/red/name/label
"
).
getComponent
(
cc
.
Label
);
const
blueName
=
cc
.
find
(
"
Canvas/playerLand/blue/name/label
"
).
getComponent
(
cc
.
Label
);
this
.
allPlayerList
.
forEach
((
player
)
=>
{
this
.
getSpriteFrimeByUrl
(
player
.
headUrl
,
(
sf
)
=>
{
if
(
player
.
color
==
"
Red
"
)
{
red
.
getComponent
(
cc
.
Sprite
).
spriteFrame
=
sf
;
red
.
width
=
140
;
red
.
height
=
140
;
redName
.
string
=
player
.
name
;
}
else
{
blue
.
getComponent
(
cc
.
Sprite
).
spriteFrame
=
sf
;
blue
.
width
=
140
;
blue
.
height
=
140
;
blueName
.
string
=
player
.
name
;
}
});
});
}
// 处理换边
handleSwitchSide
()
{
if
(
this
.
side
==
this
.
currentGameSide
)
{
...
...
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