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
c84a6d20
Commit
c84a6d20
authored
Oct 12, 2020
by
spc
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
modified: src/com/SuccessNoAwardPanel.ts
parent
078d9f48
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
118 additions
and
19 deletions
+118
-19
FailedPanel.ts
project/src/canvas/game/src/com/FailedPanel.ts
+9
-1
SuccessNoAwardPanel.ts
project/src/canvas/game/src/com/SuccessNoAwardPanel.ts
+9
-2
SuccessPanel.ts
project/src/canvas/game/src/com/SuccessPanel.ts
+9
-1
Star.ts
project/src/canvas/game/src/xiaoxiaole/Star.ts
+8
-0
XxlConfig.ts
project/src/canvas/game/src/xiaoxiaole/XxlConfig.ts
+2
-2
XxlScene.ts
project/src/canvas/game/src/xiaoxiaole/XxlScene.ts
+81
-13
No files found.
project/src/canvas/game/src/com/FailedPanel.ts
View file @
c84a6d20
import
{
layers
}
from
"../../module/views/layers"
;
import
{
Panel
}
from
"../../module/views/Panel"
;
import
{
Ins
}
from
"../Ins"
;
import
{
GDispatcher
}
from
"../Main"
;
import
{
sendTbNet
,
TbNetName
}
from
"../TaoBaoNet"
;
export
class
FailedPanel
extends
Panel
{
...
...
@@ -22,7 +23,7 @@ export class FailedPanel extends Panel {
playAgainBtn
.
x
=
bg
.
width
-
playAgainBtn
.
width
>>
1
playAgainBtn
.
y
=
350
this
.
addChild
(
playAgainBtn
)
playAgainBtn
.
addEventListener
(
FYGE
.
MouseEvent
.
CLICK
,
this
.
back
,
this
)
playAgainBtn
.
addEventListener
(
FYGE
.
MouseEvent
.
CLICK
,
this
.
playAgain
,
this
)
}
// 退出游戏 返回主页
...
...
@@ -30,4 +31,11 @@ export class FailedPanel extends Panel {
this
.
hidePanel
()
sendTbNet
(
TbNetName
.
backToPage
,
{},
(
s
,
res
)
=>
{
console
.
log
(
'backToPage'
)
})
}
// 再来一局
playAgain
()
{
this
.
hidePanel
()
GDispatcher
.
dispatchEvent
(
"gameReset"
)
}
}
\ No newline at end of file
project/src/canvas/game/src/com/SuccessNoAwardPanel.ts
View file @
c84a6d20
import
{
layers
}
from
"../../module/views/layers"
;
import
{
Panel
}
from
"../../module/views/Panel"
;
import
{
Ins
}
from
"../Ins"
;
import
{
GDispatcher
}
from
"../Main"
;
import
{
sendTbNet
,
TbNetName
}
from
"../TaoBaoNet"
;
import
{
Tools
}
from
"../Tools"
;
...
...
@@ -31,7 +32,7 @@ export class SuccessNoAwardPanel extends Panel {
playAgainBtn
.
x
=
bg
.
width
-
playAgainBtn
.
width
>>
1
playAgainBtn
.
y
=
350
this
.
addChild
(
playAgainBtn
)
playAgainBtn
.
addEventListener
(
FYGE
.
MouseEvent
.
CLICK
,
this
.
back
,
this
)
playAgainBtn
.
addEventListener
(
FYGE
.
MouseEvent
.
CLICK
,
this
.
playAgain
,
this
)
}
// 退出游戏 返回主页
...
...
@@ -39,4 +40,10 @@ export class SuccessNoAwardPanel extends Panel {
this
.
hidePanel
()
sendTbNet
(
TbNetName
.
backToPage
,
{},
(
s
,
res
)
=>
{
console
.
log
(
'backToPage'
)
})
}
// 再来一局
playAgain
()
{
this
.
hidePanel
()
GDispatcher
.
dispatchEvent
(
"gameReset"
)
}
}
\ No newline at end of file
project/src/canvas/game/src/com/SuccessPanel.ts
View file @
c84a6d20
import
{
layers
}
from
"../../module/views/layers"
;
import
{
Panel
}
from
"../../module/views/Panel"
;
import
{
Ins
}
from
"../Ins"
;
import
{
GDispatcher
}
from
"../Main"
;
import
{
sendTbNet
,
TbNetName
}
from
"../TaoBaoNet"
;
import
{
Tools
}
from
"../Tools"
;
...
...
@@ -36,7 +37,7 @@ export class SuccessPanel extends Panel {
playAgainBtn
.
x
=
(
bg
.
width
-
playAgainBtn
.
width
>>
1
)
+
bg
.
width
/
4
playAgainBtn
.
y
=
490
this
.
addChild
(
playAgainBtn
)
playAgainBtn
.
addEventListener
(
FYGE
.
MouseEvent
.
CLICK
,
this
.
back
,
this
)
playAgainBtn
.
addEventListener
(
FYGE
.
MouseEvent
.
CLICK
,
this
.
playAgain
,
this
)
let
seePrizeBtn
=
Ins
.
initSprite
(
"9152efa4-2647-4354-9aec-7e23eb02bc22"
)
seePrizeBtn
.
x
=
(
bg
.
width
-
seePrizeBtn
.
width
>>
1
)
-
bg
.
width
/
4
...
...
@@ -56,4 +57,11 @@ export class SuccessPanel extends Panel {
this
.
hidePanel
()
sendTbNet
(
TbNetName
.
seePrize
,
{},
(
s
,
res
)
=>
{
console
.
log
(
'backToPage'
)
})
}
// // 再来一局
playAgain
()
{
this
.
hidePanel
()
GDispatcher
.
dispatchEvent
(
"gameReset"
)
}
}
\ No newline at end of file
project/src/canvas/game/src/xiaoxiaole/Star.ts
View file @
c84a6d20
...
...
@@ -11,6 +11,8 @@ export class Star extends FYGE.Container {
tipText
:
FYGE
.
TextField
=
Tools
.
getText
(
"1000分"
,
20
)
lightCircle
:
LightCircle
=
new
LightCircle
()
isBling
=
false
constructor
(
text
:
string
)
{
super
()
this
.
addChild
(
this
.
starContainer
)
...
...
@@ -38,9 +40,15 @@ export class Star extends FYGE.Container {
bling
()
{
this
.
isBling
=
true
this
.
lightCircle
.
play
()
FYGE
.
Tween
.
get
(
this
.
starContainer
).
to
({
scaleX
:
0.3
,
scaleY
:
0.3
},
200
).
call
(()
=>
{
this
.
pinkStar
.
visible
=
true
}).
to
({
scaleX
:
1.3
,
scaleY
:
1.3
},
200
).
to
({
scaleX
:
1
,
scaleY
:
1
},
100
)
}
dark
()
{
this
.
isBling
=
false
this
.
pinkStar
.
visible
=
false
}
}
\ No newline at end of file
project/src/canvas/game/src/xiaoxiaole/XxlConfig.ts
View file @
c84a6d20
export
const
config
=
{
//倒计时时间s
time
:
12
0
,
time
:
12
,
//3关分数
first
:
1000
,
second
:
2000
,
third
:
3000
,
//5种每个球的分数
score
:
[
10
,
10
,
10
,
10
,
10
],
score
:
[
10
00
,
10
,
10
,
10
,
10
],
//游戏难度3,4,5
difficulty
:
3
,
//球的资源
...
...
project/src/canvas/game/src/xiaoxiaole/XxlScene.ts
View file @
c84a6d20
...
...
@@ -212,6 +212,9 @@ export class XxlScene extends Scene {
//传入的用户信息
userInfo
:
UserInfo
//返回按钮
backBtn
:
FYGE
.
Sprite
async
initUi
()
{
...
...
@@ -222,9 +225,10 @@ export class XxlScene extends Scene {
// const prizeInfoRes = sendTbNet(TbNetName.getPrizeInfo, {})
this
.
userInfo
=
userInfoRes
.
data
as
UserInfo
this
.
userInfo
=
userInfoRes
.
data
as
UserInfo
(
function
init
()
{
for
(
var
i
=
0
;
i
<
that
.
ROW_NUM
;
i
++
)
{
...
...
@@ -250,6 +254,12 @@ export class XxlScene extends Scene {
this
.
x
=
(
Ins
.
stageW
-
750
)
>>
1
;
this
.
y
=
(
Ins
.
stageH
-
1624
)
>>
1
;
this
.
backBtn
=
Tools
.
getSprite
(
resCanvasList
[
'334aff33-1a9e-4277-aafe-3d9f22eab3d5'
].
url
,
0
,
40
+
1624
/
2
-
this
.
stage
.
viewRect
.
height
/
2
)
this
.
backBtn
.
mouseEnable
=
true
this
.
backBtn
.
addEventListener
(
FYGE
.
MouseEvent
.
MOUSE_DOWN
,
()
=>
{
sendTbNet
(
TbNetName
.
backToPage
,
{},
(
s
,
res
)
=>
{
console
.
log
(
'backToPage'
)
})
},
this
)
this
.
addChild
(
this
.
backBtn
)
//顶部分数
this
.
topContainer
=
new
FYGE
.
Container
()
...
...
@@ -661,8 +671,17 @@ export class XxlScene extends Scene {
this
.
level
=
3
this
.
llevelText
.
text
=
"第"
+
this
.
level
+
"关"
this
.
difficulty
=
5
if
(
!
this
.
star1
.
isBling
)
{
this
.
star1
.
bling
()
}
this
.
star2
.
bling
()
}
else
if
(
this
.
userScore
>=
3000
)
{
if
(
!
this
.
star1
.
isBling
)
{
this
.
star1
.
bling
()
}
if
(
!
this
.
star2
.
isBling
)
{
this
.
star2
.
bling
()
}
this
.
star3
.
bling
()
this
.
gameOver
()
}
...
...
@@ -687,6 +706,7 @@ export class XxlScene extends Scene {
this
.
isGameEnd
=
true
this
.
updateFakeScore
(
this
.
robot
.
getScore
(
this
.
userScore
,
this
.
timeNum
))
const
prizeInfo
=
await
sendTbNet
(
TbNetName
.
getPrizeInfo
)
GDispatcher
.
addEventListener
(
"gameReset"
,
this
.
reset
,
this
)
if
(
this
.
userInfo
.
win
)
{
//胜利
const
prize
=
prizeInfo
.
data
...
...
@@ -1058,6 +1078,8 @@ export class XxlScene extends Scene {
//刷新
refresh
()
{
this
.
g
.
clear
()
let
circleItems
=
this
.
circleItems
circleItems
.
forEach
(
co
=>
{
...
...
@@ -1081,6 +1103,9 @@ export class XxlScene extends Scene {
initEvents
()
{
var
that
=
this
;
// console.log("主场景添加事件")
...
...
@@ -1097,12 +1122,54 @@ export class XxlScene extends Scene {
gameStart
()
{
// console.log("游戏开始")
this
.
rightUserContainer
.
visible
=
true
this
.
timeNum
=
config
.
time
this
.
lt
=
0
this
.
tt
=
0
this
.
isGameStart
=
true
GDispatcher
.
removeEventListener
(
"MatchCompelete"
,
this
.
gameStart
)
}
async
reset
()
{
this
.
selectItems
.
splice
(
0
)
this
.
refresh
()
this
.
isGameEnd
=
false
this
.
isGameStart
=
false
this
.
userScore
=
0
//先隐藏
this
.
rightUserContainer
.
visible
=
false
this
.
lscore
.
text
=
"0"
this
.
rscore
.
text
=
"0"
//进度条归0
this
.
rect
.
x
=
this
.
rectX
this
.
star1
.
dark
()
this
.
star2
.
dark
()
this
.
star3
.
dark
()
//时间初始化
this
.
timeNum
=
config
.
time
this
.
time
.
text
=
this
.
timeNum
+
""
if
(
config
.
time
>=
100
)
{
this
.
time
.
textWidth
=
80
}
else
if
(
config
.
time
>=
10
)
{
this
.
time
.
textWidth
=
65
}
else
{
this
.
time
.
textWidth
=
50
}
const
userInfoRes
=
await
sendTbNet
(
TbNetName
.
getUserInfo
,
{})
this
.
userInfo
=
userInfoRes
.
data
as
UserInfo
//@ts-ignore
if
(
this
.
userInfo
.
noGameTime
&&
this
.
userInfo
.
noGameTime
===
1
)
{
console
.
log
(
"没有游戏次数"
)
}
else
{
this
.
robot
=
new
Robot
(
!
this
.
userInfo
.
win
)
showPanel
(
MatchingPanel
,
this
.
userInfo
)
}
}
lt
=
0
...
...
@@ -1174,6 +1241,7 @@ export class XxlScene extends Scene {
that
.
removeEventListener
(
FYGE
.
MouseEvent
.
MOUSE_DOWN
,
that
.
mouseDown
,
that
)
that
.
removeEventListener
(
FYGE
.
MouseEvent
.
MOUSE_UP
,
that
.
mouseUp
,
that
);
GDispatcher
.
removeEventListener
(
"gameReset"
,
this
.
reset
)
}
...
...
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