Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
B
boardgame_yyh
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
boardgame_yyh
Commits
912f59e5
Commit
912f59e5
authored
Jul 29, 2022
by
杨一航
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
3d24d5ed
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
204 additions
and
185 deletions
+204
-185
boardgame_yyh.fire
assets/boardgame_yyh/scene/boardgame_yyh.fire
+182
-182
boardgame_yyh.ts
assets/boardgame_yyh/scene/boardgame_yyh.ts
+18
-0
Server.ts
assets/boardgame_yyh/script/Server.ts
+4
-3
No files found.
assets/boardgame_yyh/scene/boardgame_yyh.fire
View file @
912f59e5
This diff is collapsed.
Click to expand it.
assets/boardgame_yyh/scene/boardgame_yyh.ts
View file @
912f59e5
...
@@ -397,6 +397,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -397,6 +397,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
return
;
return
;
}
}
this
.
playLocalAudio
(
"
btn
"
);
this
.
playLocalAudio
(
"
btn
"
);
this
.
normaltheDice
();
this
.
networkHelper
.
sendFrame
({
this
.
networkHelper
.
sendFrame
({
type
:
"
roll
"
,
type
:
"
roll
"
,
uuid
:
this
.
myData
.
uuid
,
uuid
:
this
.
myData
.
uuid
,
...
@@ -844,6 +845,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -844,6 +845,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
`Canvas/road/root/piece
${
this
.
_status
.
current
}
`
`Canvas/road/root/piece
${
this
.
_status
.
current
}
`
);
);
await
this
.
fixStep
();
await
this
.
fixStep
();
await
this
.
toEnd
()
if
(
this
.
isMySide
)
{
if
(
this
.
isMySide
)
{
this
.
showWin
();
this
.
showWin
();
onHomeworkFinish
({
isWin
:
true
});
onHomeworkFinish
({
isWin
:
true
});
...
@@ -856,6 +858,21 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -856,6 +858,21 @@ export default class SceneComponent extends MyCocosSceneComponent {
});
});
}
}
async
toEnd
()
{
let
node
=
cc
.
find
(
`Canvas/road/root/piece
${
this
.
_status
.
current
}
`
);
let
pos
=
cc
.
find
(
`Canvas/road/root/END`
).
getPosition
();
await
asyncTweenTo
(
node
,
0.7
,
{
x
:
pos
.
x
,
y
:
pos
.
y
},
{
easing
:
"
cubicOut
"
}
);
await
asyncDelay
(
0.2
);
}
showWin
()
{
showWin
()
{
let
endRoot
=
cc
.
find
(
"
Canvas/endRoot
"
)
let
endRoot
=
cc
.
find
(
"
Canvas/endRoot
"
)
endRoot
.
active
=
true
;
endRoot
.
active
=
true
;
...
@@ -901,6 +918,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -901,6 +918,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
if
(
this
.
_isRolling
)
{
if
(
this
.
_isRolling
)
{
return
;
return
;
}
}
const
dice
=
cc
.
find
(
"
Canvas/road/board/runBoard
"
);
const
dice
=
cc
.
find
(
"
Canvas/road/board/runBoard
"
);
return
new
Promise
((
resolve
,
reject
)
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
const
targetAngle
=
Math
.
ceil
(
dice
.
angle
/
360
+
1
)
*
360
;
const
targetAngle
=
Math
.
ceil
(
dice
.
angle
/
360
+
1
)
*
360
;
...
...
assets/boardgame_yyh/script/Server.ts
View file @
912f59e5
...
@@ -173,10 +173,11 @@ export class GameServer {
...
@@ -173,10 +173,11 @@ export class GameServer {
let
nowStep
:
number
=
this
.
gameStatus
[
this
.
gameStatus
.
current
];
let
nowStep
:
number
=
this
.
gameStatus
[
this
.
gameStatus
.
current
];
console
.
log
(
"
nowStep ===
"
+
nowStep
);
console
.
log
(
"
nowStep ===
"
+
nowStep
);
const
jump
=
this
.
jumpList
.
find
(
jump
=>
parseInt
(
jump
.
from
)
==
nowStep
+
this
.
gameStatus
.
step
);
const
jump
=
this
.
jumpList
.
find
(
jump
=>
parseInt
(
jump
.
from
)
==
nowStep
+
this
.
gameStatus
.
step
);
this
.
gameStatus
[
this
.
gameStatus
.
current
]
=
jump
?
parseInt
(
jump
.
rto
)
:
nowStep
+
this
.
gameStatus
.
step
;
this
.
gameStatus
[
this
.
gameStatus
.
current
]
=
jump
?.
rto
?
parseInt
(
jump
.
rto
)
:
nowStep
+
this
.
gameStatus
.
step
;
if
(
jump
)
{
if
(
jump
)
{
console
.
log
(
"
jump=============
"
+
jump
);
console
.
log
(
"
jump=============
"
);
console
.
log
(
jump
);
}
}
if
(
this
.
gameStatus
[
this
.
gameStatus
.
current
]
<
this
.
_totalStep
-
1
)
{
if
(
this
.
gameStatus
[
this
.
gameStatus
.
current
]
<
this
.
_totalStep
-
1
)
{
this
.
gameStatus
.
step
=
null
;
this
.
gameStatus
.
step
=
null
;
...
@@ -203,7 +204,7 @@ export class GameServer {
...
@@ -203,7 +204,7 @@ export class GameServer {
let
nowStep
:
number
=
this
.
gameStatus
[
this
.
gameStatus
.
current
];
let
nowStep
:
number
=
this
.
gameStatus
[
this
.
gameStatus
.
current
];
console
.
log
(
"
nowStep ===
"
+
nowStep
);
console
.
log
(
"
nowStep ===
"
+
nowStep
);
const
jump
=
this
.
jumpList
.
find
(
jump
=>
parseInt
(
jump
.
from
)
==
nowStep
+
this
.
gameStatus
.
step
);
const
jump
=
this
.
jumpList
.
find
(
jump
=>
parseInt
(
jump
.
from
)
==
nowStep
+
this
.
gameStatus
.
step
);
this
.
gameStatus
[
this
.
gameStatus
.
current
]
=
jump
?
parseInt
(
jump
.
wto
)
:
nowStep
;
this
.
gameStatus
[
this
.
gameStatus
.
current
]
=
jump
?.
wto
?
parseInt
(
jump
.
wto
)
:
nowStep
;
this
.
gameStatus
.
step
=
null
;
this
.
gameStatus
.
step
=
null
;
this
.
gameStatus
.
state
=
2
;
this
.
gameStatus
.
state
=
2
;
...
...
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