Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
new_taobao
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
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
wildfirecode13
new_taobao
Commits
4bfd7253
Commit
4bfd7253
authored
Oct 01, 2020
by
spc
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
modified: project/src/canvas/game/src/com/MatchingPanel.ts
parent
eab321e5
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
176 additions
and
42 deletions
+176
-42
MatchingPanel.ts
project/src/canvas/game/src/com/MatchingPanel.ts
+6
-6
CircleItem.ts
project/src/canvas/game/src/xiaoxiaole/CircleItem.ts
+1
-1
Robot.ts
project/src/canvas/game/src/xiaoxiaole/Robot.ts
+52
-0
XxlConfig.ts
project/src/canvas/game/src/xiaoxiaole/XxlConfig.ts
+5
-1
XxlScene.ts
project/src/canvas/game/src/xiaoxiaole/XxlScene.ts
+112
-34
No files found.
project/src/canvas/game/src/com/MatchingPanel.ts
View file @
4bfd7253
...
...
@@ -70,9 +70,9 @@ export class MatchingPanel extends Panel {
leftAvatar
.
y
=
-
25
lContainer
.
addChild
(
leftAvatar
)
//遮罩
let
lcircle
=
Tools
.
getCircle
(
48
,
0xffff00
)
lcircle
.
x
=
23
3
lcircle
.
y
=
2
7
let
lcircle
=
Tools
.
getCircle
(
50
,
0xffff00
)
lcircle
.
x
=
23
2
lcircle
.
y
=
2
6
lContainer
.
addChild
(
lcircle
)
leftAvatar
.
mask
=
lcircle
...
...
@@ -103,9 +103,9 @@ export class MatchingPanel extends Panel {
rightAvatar
.
y
=
-
25
rContainer
.
addChild
(
rightAvatar
)
//遮罩
let
rcircle
=
Tools
.
getCircle
(
48
,
0xffff00
)
rcircle
.
x
=
right
.
width
-
23
3
rcircle
.
y
=
2
7
let
rcircle
=
Tools
.
getCircle
(
50
,
0xffff00
)
rcircle
.
x
=
right
.
width
-
23
2
rcircle
.
y
=
2
6
rContainer
.
addChild
(
rcircle
)
rightAvatar
.
mask
=
rcircle
...
...
project/src/canvas/game/src/xiaoxiaole/CircleItem.ts
View file @
4bfd7253
...
...
@@ -16,7 +16,7 @@ export default class CircleItem extends FYGE.Container {
//类型
type
:
number
circleRes
=
[
'2a747211-0210-4215-86a2-a6955b37c45b'
,
'7d1ec658-9371-4d52-b4d7-e75d04037daf'
,
'6a1345f6-969c-4969-8bfb-f4de637df34d'
,
'2e12a9ec-46be-487f-a9cd-550dd0af3746'
,
'b022fbdd-8607-435a-a205-19fc3b5123eb'
]
circleRes
=
config
.
circleRes
point
:
point
index
:
number
...
...
project/src/canvas/game/src/xiaoxiaole/Robot.ts
0 → 100644
View file @
4bfd7253
export
class
Robot
{
private
_needWin
:
boolean
=
true
private
_score
:
number
=
0
private
_time
:
number
=
120
+
Math
.
random
()
*
30
constructor
(
needWin
)
{
this
.
_needWin
=
needWin
}
getScore
(
userScore
:
number
,
gameLeftTime
:
number
):
number
{
if
(
this
.
_time
<
0
)
{
if
(
this
.
_needWin
)
{
//机器人赢
if
(
userScore
>
2600
)
{
this
.
_score
=
3000
+
(
Math
.
floor
(
Math
.
random
()
*
8
)
+
2
)
*
10
}
else
{
if
(
gameLeftTime
>
60
)
{
if
(
this
.
_score
>
userScore
)
{
this
.
_score
+=
(
Math
.
floor
(
Math
.
random
()
*
6
)
+
2
)
*
10
}
else
{
this
.
_score
=
userScore
+
(
Math
.
floor
(
Math
.
random
()
*
3
)
+
2
)
*
10
}
}
else
{
if
(
this
.
_score
>
userScore
)
{
this
.
_score
+=
(
Math
.
floor
(
Math
.
random
()
*
8
)
+
3
)
*
10
}
else
{
this
.
_score
=
userScore
+
(
Math
.
floor
(
Math
.
random
()
*
8
)
+
6
)
*
10
}
}
}
}
else
{
//机器人输
if
(
this
.
_score
>=
userScore
)
{
return
this
.
_score
}
else
{
//应该的分数
let
gapScore
=
userScore
-
this
.
_score
let
randomScore
=
(
Math
.
floor
(
Math
.
random
()
*
3
)
+
2
)
*
10
if
(
randomScore
<
gapScore
)
{
this
.
_score
+=
randomScore
return
this
.
_score
}
}
}
this
.
_time
=
120
+
Math
.
random
()
*
60
}
this
.
_time
--
return
this
.
_score
}
}
\ No newline at end of file
project/src/canvas/game/src/xiaoxiaole/XxlConfig.ts
View file @
4bfd7253
...
...
@@ -6,5 +6,9 @@ export const config = {
second
:
2000
,
third
:
3000
,
//5种每个球的分数
score
:
[
10
,
10
,
10
,
10
,
10
]
score
:
[
10
,
10
,
10
,
10
,
10
],
//游戏难度3,4,5
difficulty
:
3
,
//球的资源
circleRes
:
[
'2a747211-0210-4215-86a2-a6955b37c45b'
,
'7d1ec658-9371-4d52-b4d7-e75d04037daf'
,
'6a1345f6-969c-4969-8bfb-f4de637df34d'
,
'2e12a9ec-46be-487f-a9cd-550dd0af3746'
,
'b022fbdd-8607-435a-a205-19fc3b5123eb'
]
}
\ No newline at end of file
project/src/canvas/game/src/xiaoxiaole/XxlScene.ts
View file @
4bfd7253
This diff is collapsed.
Click to expand it.
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