Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
X
xiaoxiaoleTuia
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
王剑峰
xiaoxiaoleTuia
Commits
345031ec
Commit
345031ec
authored
May 11, 2021
by
zhangjinzhou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
换皮前暂存
parent
327c7643
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
66 additions
and
35 deletions
+66
-35
Utils.ts
egret/src/Utils.ts
+20
-0
MainScene.ts
egret/src/mainScene/MainScene.ts
+35
-28
StartPanel.ts
egret/src/panels/StartPanel.ts
+11
-7
No files found.
egret/src/Utils.ts
View file @
345031ec
...
@@ -16,6 +16,12 @@ export interface CouponJoinOptions{
...
@@ -16,6 +16,12 @@ export interface CouponJoinOptions{
export
interface
ShowTurnCircleOptions
{
export
interface
ShowTurnCircleOptions
{
afterClose
:
Function
,
//关闭转盘
afterClose
:
Function
,
//关闭转盘
}
}
interface
ShowVideoOptions
{
afterClose
:
Function
}
interface
ShowMeituanExchangeOptions
{
afterClose
:
Function
}
export
default
class
Utils
{
export
default
class
Utils
{
constructor
()
{
constructor
()
{
...
@@ -162,4 +168,18 @@ export default class Utils {
...
@@ -162,4 +168,18 @@ export default class Utils {
}
}
afterClose
&&
afterClose
();
afterClose
&&
afterClose
();
}
}
//打开视频
static
showVideo
(
afterClose
=
(
suc
)
=>
{}){
let
options
:
ShowVideoOptions
=
{
afterClose
,
};
afterClose
&&
afterClose
(
true
);
}
//美团碎片弹窗
static
showMeituanExchange
(
afterClose
=
()
=>
{}){
let
options
:
ShowMeituanExchangeOptions
=
{
afterClose
,
};
afterClose
&&
afterClose
();
}
}
}
\ No newline at end of file
egret/src/mainScene/MainScene.ts
View file @
345031ec
...
@@ -344,6 +344,7 @@ export default class MainScene extends Scene {
...
@@ -344,6 +344,7 @@ export default class MainScene extends Scene {
}
}
this
.
propBtnCon
.
stepBtn
.
propNumShow
.
count
+=
data
.
videoProp
[
2
];
this
.
propBtnCon
.
stepBtn
.
propNumShow
.
count
+=
data
.
videoProp
[
2
];
this
.
initBallonSp
();
//先禁掉事件
//先禁掉事件
this
.
enableMouseEvt
(
false
);
this
.
enableMouseEvt
(
false
);
...
@@ -381,35 +382,9 @@ export default class MainScene extends Scene {
...
@@ -381,35 +382,9 @@ export default class MainScene extends Scene {
//AiControl初始化,
//AiControl初始化,
AiControl
.
ins
.
init
(
this
.
lattices
);
AiControl
.
ins
.
init
(
this
.
lattices
);
//气球宝箱
this
.
balloonsp
=
new
eui
.
Image
(
"//yun.duiba.com.cn/aurora/assets/02d6dda42162d49097d4d271b5a367a506377487.jpeg"
);
let
balloonwid
=
100
;
let
balloonhei
=
100
;
this
.
balloonsp
.
width
=
balloonwid
;
this
.
balloonsp
.
height
=
balloonhei
;
this
.
addChild
(
this
.
balloonsp
);
let
topboty
=
224
;
let
gametopy
=
224
;
let
lattices
=
this
.
chapterData
.
map
.
lattices
;
for
(
var
m
=
0
;
m
<
lattices
.
length
;
m
++
)
{
if
(
lattices
[
m
])
{
gametopy
=
Tool
.
getPositionByIndex
(
m
)[
1
]
break
;
}
}
if
(
gametopy
<
224
)
{
gametopy
=
224
;
}
this
.
balloonsp
.
y
=
(
gametopy
-
topboty
)
/
2
+
topboty
-
balloonhei
/
2
;
let
movetime
=
5000
;
egret
.
Tween
.
get
(
this
.
balloonsp
,
{
loop
:
true
}).
to
({
x
:
750
-
balloonwid
},
movetime
)
.
to
({
x
:
0
},
movetime
)
this
.
balloonsp
.
addEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
clickBallon
,
this
);
}
}
/**
/**
* 加载所有用到的svga
* 加载所有用到的svga
*/
*/
...
@@ -3121,8 +3096,40 @@ export default class MainScene extends Scene {
...
@@ -3121,8 +3096,40 @@ export default class MainScene extends Scene {
arr
[
i
].
touchChildren
=
b
;
arr
[
i
].
touchChildren
=
b
;
}
}
this
.
quitBtn
.
touchEnabled
=
b
;
this
.
quitBtn
.
touchEnabled
=
b
;
this
.
balloonsp
.
touchEnabled
=
b
;
this
.
enableTouch
=
b
;
this
.
enableTouch
=
b
;
}
}
//初始化天降宝箱
initBallonSp
(){
//气球宝箱
this
.
balloonsp
=
new
eui
.
Image
(
"//yun.duiba.com.cn/aurora/assets/02d6dda42162d49097d4d271b5a367a506377487.jpeg"
);
let
balloonwid
=
100
;
let
balloonhei
=
100
;
this
.
balloonsp
.
width
=
balloonwid
;
this
.
balloonsp
.
height
=
balloonhei
;
this
.
addChild
(
this
.
balloonsp
);
let
topboty
=
224
;
let
gametopy
=
224
;
let
lattices
=
this
.
chapterData
.
map
.
lattices
;
for
(
var
m
=
0
;
m
<
lattices
.
length
;
m
++
)
{
if
(
lattices
[
m
])
{
gametopy
=
Tool
.
getPositionByIndex
(
m
)[
1
]
break
;
}
}
if
(
gametopy
<
224
)
{
gametopy
=
224
;
}
this
.
balloonsp
.
y
=
(
gametopy
-
topboty
)
/
2
+
topboty
-
balloonhei
/
2
;
let
movetime
=
5000
;
egret
.
Tween
.
get
(
this
.
balloonsp
,
{
loop
:
true
}).
to
({
x
:
750
-
balloonwid
},
movetime
)
.
to
({
x
:
0
},
movetime
)
this
.
balloonsp
.
addEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
clickBallon
,
this
);
}
//气球点击
//气球点击
clickBallon
()
{
clickBallon
()
{
egret
.
Tween
.
removeTweens
(
this
.
balloonsp
);
egret
.
Tween
.
removeTweens
(
this
.
balloonsp
);
...
...
egret/src/panels/StartPanel.ts
View file @
345031ec
...
@@ -74,19 +74,23 @@ export default class StartPanel extends Panel {
...
@@ -74,19 +74,23 @@ export default class StartPanel extends Panel {
const
prop2Nums
=
getPropNums
(
PropType
.
BOOM
);
const
prop2Nums
=
getPropNums
(
PropType
.
BOOM
);
const
prop1Nums
=
getPropNums
(
PropType
.
HAMMER
);
const
prop1Nums
=
getPropNums
(
PropType
.
HAMMER
);
const
prop3Nums
=
getPropNums
(
PropType
.
CHANCE_NUM
);
const
prop3Nums
=
getPropNums
(
PropType
.
CHANCE_NUM
);
// this['nums1Txt'].text = prop1Nums;
this
[
'nums1Txt'
].
text
=
prop1Nums
;
// this['nums2Txt'].text = prop2Nums;
this
[
'nums2Txt'
].
text
=
prop2Nums
;
// this['nums3Txt'].text = prop3Nums;
this
[
'nums3Txt'
].
text
=
prop3Nums
;
this
[
'nums1Txt'
].
text
=
0
;
this
.
boom
=
prop2Nums
;
this
[
'nums2Txt'
].
text
=
0
;
this
.
hammer
=
prop1Nums
;
this
[
'nums3Txt'
].
text
=
0
;
this
.
step
=
prop3Nums
;
// this['nums1Txt'].text = 0;
// this['nums2Txt'].text = 0;
// this['nums3Txt'].text = 0;
if
(
!
getPropNums
(
PropType
.
BOOM
))
this
[
'buy2btn'
].
visible
=
false
;
if
(
!
getPropNums
(
PropType
.
BOOM
))
this
[
'buy2btn'
].
visible
=
false
;
if
(
!
getPropNums
(
PropType
.
HAMMER
))
this
[
'buy1btn'
].
visible
=
false
;
if
(
!
getPropNums
(
PropType
.
HAMMER
))
this
[
'buy1btn'
].
visible
=
false
;
if
(
!
getPropNums
(
PropType
.
CHANCE_NUM
))
this
[
'buy3btn'
].
visible
=
false
;
if
(
!
getPropNums
(
PropType
.
CHANCE_NUM
))
this
[
'buy3btn'
].
visible
=
false
;
}
}
initEvents
()
{
initEvents
()
{
super
.
initEvents
();
//妈的,购买按钮居然不是按顺序的,购买道具弹框也不是按顺序的,,2炸弹,1锤子,3步数
super
.
initEvents
();
this
[
'buy1btn'
].
addEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
onTap_buy1btn
,
this
);
this
[
'buy1btn'
].
addEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
onTap_buy1btn
,
this
);
this
[
'buy2btn'
].
addEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
onTap_buy2btn
,
this
);
this
[
'buy2btn'
].
addEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
onTap_buy2btn
,
this
);
this
[
'buy3btn'
].
addEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
onTap_buy3btn
,
this
);
this
[
'buy3btn'
].
addEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
onTap_buy3btn
,
this
);
...
...
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