Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
L5R3_GuessingGame
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
L5R3_GuessingGame
Commits
56d1898b
Commit
56d1898b
authored
Nov 28, 2022
by
杨一航
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add
parent
00875b70
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
303 additions
and
225 deletions
+303
-225
Keyboard.ts
assets/L5R3_GuessingGame/prefabs/keyboards/Keyboard.ts
+5
-0
L5R3_GuessingGame.fire
assets/L5R3_GuessingGame/scene/L5R3_GuessingGame.fire
+249
-219
L5R3_GuessingGame.ts
assets/L5R3_GuessingGame/scene/L5R3_GuessingGame.ts
+49
-6
No files found.
assets/L5R3_GuessingGame/prefabs/keyboards/Keyboard.ts
View file @
56d1898b
...
@@ -112,4 +112,9 @@ export default class Keyboard extends cc.Component {
...
@@ -112,4 +112,9 @@ export default class Keyboard extends cc.Component {
this
.
btnHideNode
.
active
=
false
;
this
.
btnHideNode
.
active
=
false
;
}
}
}
}
showTips
()
{
cc
.
tween
(
this
.
btnShowNode
).
to
(
0.3
,
{
scale
:
1.2
}).
to
(
0.7
,
{
scale
:
1
}).
start
();
cc
.
tween
(
this
.
btnHideNode
).
to
(
0.3
,
{
scale
:
1.2
}).
to
(
0.7
,
{
scale
:
1
}).
start
();
}
}
}
assets/L5R3_GuessingGame/scene/L5R3_GuessingGame.fire
View file @
56d1898b
This diff is collapsed.
Click to expand it.
assets/L5R3_GuessingGame/scene/L5R3_GuessingGame.ts
View file @
56d1898b
...
@@ -68,6 +68,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -68,6 +68,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
_wordData
:
any
;
_wordData
:
any
;
private
_otherWord
:
any
;
private
_otherWord
:
any
;
private
_isRecording
:
any
;
private
_isRecording
:
any
;
private
_guessWords
:
any
;
onLoad
()
{
onLoad
()
{
...
@@ -94,13 +95,13 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -94,13 +95,13 @@ export default class SceneComponent extends MyCocosSceneComponent {
_reqestWord
()
{
_reqestWord
()
{
if
(
!
this
.
_
input
Words
)
{
if
(
!
this
.
_
guess
Words
)
{
return
;
return
;
}
}
this
.
_sendMsg
(
MsgType
.
USER_REQ_WOED
,
{
word
:
this
.
_
input
Words
,
uuid
:
this
.
playerId
})
this
.
_sendMsg
(
MsgType
.
USER_REQ_WOED
,
{
word
:
this
.
_
guess
Words
,
uuid
:
this
.
playerId
})
}
}
_inputWords
(
word
)
{
_inputWords
(
word
)
{
this
.
_
input
Words
=
word
;
this
.
_
guess
Words
=
word
;
this
.
inputNode
.
getChildByName
(
"
lb
"
).
getComponent
(
cc
.
Label
).
string
=
word
;
this
.
inputNode
.
getChildByName
(
"
lb
"
).
getComponent
(
cc
.
Label
).
string
=
word
;
}
}
...
@@ -187,6 +188,9 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -187,6 +188,9 @@ export default class SceneComponent extends MyCocosSceneComponent {
if
(
this
.
_catSpeaking
)
{
if
(
this
.
_catSpeaking
)
{
return
;
return
;
}
}
if
(
this
.
_isRecording
)
{
return
}
this
.
_catSpeaking
=
true
;
this
.
_catSpeaking
=
true
;
this
.
catAni
();
this
.
catAni
();
})
})
...
@@ -254,6 +258,25 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -254,6 +258,25 @@ export default class SceneComponent extends MyCocosSceneComponent {
asyncPlayDragonBoneAnimation
(
this
.
cat
,
"
normal
"
,
0
);
asyncPlayDragonBoneAnimation
(
this
.
cat
,
"
normal
"
,
0
);
this
.
_catSpeaking
=
false
;
this
.
_catSpeaking
=
false
;
})
})
if
(
index
==
0
)
{
asyncDelay
(
1
).
then
(()
=>
{
this
.
_keyboard
.
showTips
();
})
}
else
if
(
index
==
1
)
{
asyncDelay
(
1
).
then
(()
=>
{
cc
.
tween
(
this
.
pp
).
to
(
0.3
,
{
scale
:
1.2
}).
to
(
0.7
,
{
scale
:
1
}).
start
();
})
}
else
{
asyncDelay
(
1.5
).
then
(()
=>
{
cc
.
tween
(
this
.
pp
).
to
(
0.3
,
{
scale
:
1.2
}).
to
(
0.7
,
{
scale
:
1
}).
start
();
})
}
}
}
playerId
;
playerId
;
...
@@ -566,9 +589,19 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -566,9 +589,19 @@ export default class SceneComponent extends MyCocosSceneComponent {
this
.
playAudioByUrl
(
this
.
data
.
audioUrl_waiting_firstRound
,
()
=>
{
this
.
playAudioByUrl
(
this
.
data
.
audioUrl_waiting_firstRound
,
()
=>
{
asyncPlayDragonBoneAnimation
(
this
.
cat
,
"
normal
"
,
0
)
asyncPlayDragonBoneAnimation
(
this
.
cat
,
"
normal
"
,
0
)
this
.
_catSpeaking
=
false
;
this
.
_catSpeaking
=
false
;
let
card
=
this
.
cardRoot
.
children
[
index
];
let
cardNode
:
cc
.
Node
=
card
.
getChildByName
(
"
card
"
);
let
pos
=
this
.
myCardRoot
.
convertToNodeSpaceAR
(
cardNode
.
convertToWorldSpaceAR
(
cc
.
v2
(
0
,
0
)))
this
.
myCardRoot
.
getChildByName
(
"
card
"
).
getComponent
(
cc
.
Sprite
).
spriteFrame
=
this
.
cardList
[
index
]
this
.
myCardRoot
.
getChildByName
(
"
card
"
).
getComponent
(
cc
.
Sprite
).
spriteFrame
=
this
.
cardList
[
index
]
this
.
myCardRoot
.
getChildByName
(
"
word
"
).
getComponent
(
cc
.
Label
).
string
=
word
;
let
myCard
=
this
.
myCardRoot
.
getChildByName
(
"
card
"
);
resolve
(
""
);
let
pos1
=
myCard
.
position
;
myCard
.
x
=
pos
.
x
;
myCard
.
y
=
pos
.
y
;
cc
.
tween
(
myCard
).
to
(
1
,
{
x
:
pos1
.
x
,
y
:
pos1
.
y
}).
call
(()
=>
{
this
.
myCardRoot
.
getChildByName
(
"
word
"
).
getComponent
(
cc
.
Label
).
string
=
word
;
resolve
(
""
);
}).
start
();
})
})
})
})
...
@@ -637,6 +670,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -637,6 +670,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
}
}
this
.
_canChosendCard
=
false
;
this
.
_canChosendCard
=
false
;
this
.
playLocalAudio
(
"
btn
"
)
let
cards
=
this
.
cardRoot
.
children
;
let
cards
=
this
.
cardRoot
.
children
;
for
(
let
i
=
0
;
i
<
this
.
cardList
.
length
;
++
i
)
{
for
(
let
i
=
0
;
i
<
this
.
cardList
.
length
;
++
i
)
{
...
@@ -652,8 +686,17 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -652,8 +686,17 @@ export default class SceneComponent extends MyCocosSceneComponent {
word
:
word
,
word
:
word
,
}
}
)
)
let
cardNode
:
cc
.
Node
=
card
.
getChildByName
(
"
card
"
);
let
pos
=
this
.
myCardRoot
.
convertToNodeSpaceAR
(
cardNode
.
convertToWorldSpaceAR
(
cc
.
v2
(
0
,
0
)))
this
.
myCardRoot
.
getChildByName
(
"
card
"
).
getComponent
(
cc
.
Sprite
).
spriteFrame
=
this
.
cardList
[
index
]
this
.
myCardRoot
.
getChildByName
(
"
card
"
).
getComponent
(
cc
.
Sprite
).
spriteFrame
=
this
.
cardList
[
index
]
this
.
myCardRoot
.
getChildByName
(
"
word
"
).
getComponent
(
cc
.
Label
).
string
=
word
;
let
myCard
=
this
.
myCardRoot
.
getChildByName
(
"
card
"
);
let
pos1
=
myCard
.
position
;
myCard
.
x
=
pos
.
x
;
myCard
.
y
=
pos
.
y
;
cc
.
tween
(
myCard
).
to
(
1
,
{
x
:
pos1
.
x
,
y
:
pos1
.
y
}).
call
(()
=>
{
this
.
myCardRoot
.
getChildByName
(
"
word
"
).
getComponent
(
cc
.
Label
).
string
=
word
;
}).
start
();
})
})
...
...
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