Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
L5R1_bingo
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
L5R1_bingo
Commits
df7b2366
Commit
df7b2366
authored
Nov 23, 2022
by
杨一航
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
a9681f62
Changes
9
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
3641 additions
and
2255 deletions
+3641
-2255
EndView.ts
assets/L5R1_bingo/prefabs/endView/EndView.ts
+10
-2
endView.prefab
assets/L5R1_bingo/prefabs/endView/endView.prefab
+231
-153
Keyboard.ts
assets/L5R1_bingo/prefabs/keyboards/Keyboard.ts
+5
-4
keyboard.prefab
assets/L5R1_bingo/prefabs/keyboards/keyboard.prefab
+2963
-987
L5R1_bingo.fire
assets/L5R1_bingo/scene/L5R1_bingo.fire
+281
-869
L5R1_bingo.ts
assets/L5R1_bingo/scene/L5R1_bingo.ts
+131
-227
AI.ts
assets/L5R1_bingo/script/AI.ts
+2
-2
MyCocosSceneComponent.ts
assets/L5R1_bingo/script/MyCocosSceneComponent.ts
+6
-1
Server.ts
assets/L5R1_bingo/script/Server.ts
+12
-10
No files found.
assets/L5R1_bingo/prefabs/endView/EndView.ts
View file @
df7b2366
...
...
@@ -10,6 +10,9 @@ const { ccclass, property } = cc._decorator;
@
ccclass
export
default
class
EndView
extends
cc
.
Component
{
@
property
(
cc
.
Node
)
frame
:
cc
.
Node
=
null
;
@
property
(
cc
.
Node
)
winRoot
:
cc
.
Node
=
null
;
...
...
@@ -32,13 +35,18 @@ export default class EndView extends cc.Component {
replayNode
:
cc
.
Node
=
null
;
onLoad
()
{
this
.
node
.
opacity
=
0
;
this
.
replayNode
.
on
(
"
click
"
,
this
.
replay
,
this
)
}
showView
(
win
:
boolean
,
redScore
,
blueScore
,
redUrl
,
blueUrl
)
{
this
.
node
.
opacity
=
255
;
this
.
frame
.
scale
=
0
;
cc
.
tween
(
this
.
frame
).
to
(
1
,
{
scale
:
1
},
{
easing
:
"
sineIn
"
}).
start
();
this
.
winRoot
.
active
=
win
;
this
.
loseRoot
.
active
=
!
win
;
this
.
lb_blue
.
string
=
blueScore
;
...
...
@@ -53,7 +61,7 @@ export default class EndView extends cc.Component {
}
replay
()
{
cc
.
game
.
restart
(
);
cc
.
director
.
loadScene
(
"
L5R1_bingo
"
);
}
}
assets/L5R1_bingo/prefabs/endView/endView.prefab
View file @
df7b2366
This diff is collapsed.
Click to expand it.
assets/L5R1_bingo/prefabs/keyboards/Keyboard.ts
View file @
df7b2366
...
...
@@ -43,14 +43,14 @@ export default class Keyboard extends cc.Component {
for
(
let
i
=
0
;
i
<
btnList
.
length
;
++
i
)
{
let
btnNode
=
btnList
[
i
];
let
key
=
btnNode
.
name
;
btnNode
.
on
(
"
click
"
,
this
.
enterWord
.
bind
(
this
,
key
),
this
);
btnNode
.
getChildByName
(
"
btn
"
).
on
(
"
click
"
,
this
.
enterWord
.
bind
(
this
,
key
),
this
);
}
this
.
btnOkNode
.
on
(
"
click
"
,
this
.
sendWords
,
this
)
this
.
btnbackNode
.
on
(
"
click
"
,
this
.
backWord
,
this
)
this
.
btnShowNode
.
on
(
"
click
"
,
this
.
showIn
,
this
)
this
.
btnHideNode
.
on
(
"
click
"
,
this
.
showOut
,
this
)
this
.
btnHideNode
.
on
(
"
click
"
,
this
.
showOut
.
bind
(
this
,
false
)
,
this
)
this
.
btnShowNode
.
active
=
false
;
this
.
btnHideNode
.
active
=
false
;
...
...
@@ -97,7 +97,6 @@ export default class Keyboard extends cc.Component {
}
showOut
(
hideMini
=
false
)
{
if
(
this
.
_moving
)
return
;
this
.
_moving
=
true
;
this
.
_wordList
=
[];
...
...
@@ -108,7 +107,9 @@ export default class Keyboard extends cc.Component {
if
(
hideMini
)
{
this
.
btnShowNode
.
active
=
false
;
this
.
btnHideNode
.
active
=
false
;
}
else
{
this
.
btnShowNode
.
active
=
true
;
this
.
btnHideNode
.
active
=
false
;
}
}
}
assets/L5R1_bingo/prefabs/keyboards/keyboard.prefab
View file @
df7b2366
This diff is collapsed.
Click to expand it.
assets/L5R1_bingo/scene/L5R1_bingo.fire
View file @
df7b2366
This diff is collapsed.
Click to expand it.
assets/L5R1_bingo/scene/L5R1_bingo.ts
View file @
df7b2366
This diff is collapsed.
Click to expand it.
assets/L5R1_bingo/script/AI.ts
View file @
df7b2366
...
...
@@ -64,9 +64,9 @@ export class AI {
}
else
if
(
type
==
MsgType
.
ROUND_END_EV
)
{
let
data
=
msgData
;
if
(
data
.
round
==
1
)
{
this
.
_countDelay
=
500000000
;
}
else
{
this
.
_countDelay
=
500000000
;
}
}
}
...
...
assets/L5R1_bingo/script/MyCocosSceneComponent.ts
View file @
df7b2366
...
...
@@ -135,7 +135,12 @@ export class MyCocosSceneComponent extends cc.Component {
// ------------------------------------------------
getSprNode
(
resName
)
{
const
sf
=
cc
.
find
(
'
Canvas/res/img/
'
+
resName
).
getComponent
(
cc
.
Sprite
).
spriteFrame
;
let
nodef
=
cc
.
find
(
'
Canvas/res/img/
'
+
resName
)
if
(
!
nodef
)
{
console
.
warn
(
"
no name res =
"
+
resName
);
return
;
}
const
sf
=
nodef
.
getComponent
(
cc
.
Sprite
).
spriteFrame
;
const
node
=
new
cc
.
Node
();
node
.
addComponent
(
cc
.
Sprite
).
spriteFrame
=
sf
;
return
node
;
...
...
assets/L5R1_bingo/script/Server.ts
View file @
df7b2366
...
...
@@ -42,7 +42,7 @@ export class GameServer {
_answerList
=
[]
private
_useAI
:
boolean
;
private
_timer
:
number
;
private
_totalTime
:
number
=
16
;
private
_totalTime
:
number
=
16
0
;
private
_gameData
:
MsgData
;
private
_userPrepareCount
:
number
;
private
_lastTime
:
number
;
...
...
@@ -238,10 +238,13 @@ export class GameServer {
data
:
this
.
_gameData
.
Msg
})
let
realRedScore
=
(
Math
.
floor
(
this
.
_gameData
.
RedScore
/
100
)
+
this
.
_gameData
.
RedScore
%
100
);
let
realBlueScore
=
(
Math
.
floor
(
this
.
_gameData
.
BuleSocre
/
100
)
+
this
.
_gameData
.
BuleSocre
%
100
);
let
winSide
=
"
Red
"
if
(
this
.
_gameData
.
BuleSocre
>
this
.
_gameData
.
RedScore
)
{
if
(
realBlueScore
>
real
RedScore
)
{
winSide
=
"
Blue
"
}
else
if
(
this
.
_gameData
.
BuleSocre
==
this
.
_gameData
.
Red
Score
)
{
}
else
if
(
realRedScore
==
realBlue
Score
)
{
let
answerList
=
this
.
_gameData
.
getAnswerList
();
for
(
let
i
=
answerList
.
length
-
1
;
i
>=
0
;
++
i
)
{
let
answer
=
answerList
[
i
];
...
...
@@ -385,17 +388,16 @@ export class GameServer {
});
if
(
this
.
_gameData
.
getAnswerList
().
length
==
16
)
{
this
.
_senMsg
({
type
:
MsgType
.
ROOM_ST
,
data
:
this
.
_gameData
.
Msg
});
let
answerList
=
this
.
_gameData
.
getAnswerList
();
for
(
let
i
=
0
;
i
<
answerList
.
length
;
++
i
)
{
this
.
_round_1_cardList
.
push
(
answerList
[
i
].
word
);
}
this
.
_senMsg
({
type
:
MsgType
.
ROUND_END_EV
,
data
:
{
round
:
this
.
_gameData
.
Round
,
reason
:
1
,
answerList
:
this
.
_round_1_card
List
}
data
:
{
round
:
this
.
_gameData
.
Round
,
reason
:
1
,
answerList
:
answer
List
}
});
clearInterval
(
this
.
_timer
)
this
.
_initRound2
();
}
else
{
...
...
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