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
327c7643
Commit
327c7643
authored
May 10, 2021
by
zhangjinzhou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
气球,盲盒,星星宝箱暂存
parent
3c97d3bd
Changes
5
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
307 additions
and
29 deletions
+307
-29
Utils.ts
egret/src/Utils.ts
+37
-0
MainScene.ts
egret/src/mainScene/MainScene.ts
+138
-25
Chapter10.ts
egret/src/something/chapters/Chapter10.ts
+11
-1
Element.ts
egret/src/something/class/Element.ts
+0
-2
ScoreProgress.ts
egret/src/something/uis/ScoreProgress.ts
+121
-1
No files found.
egret/src/Utils.ts
View file @
327c7643
export
enum
CouponJoinScene
{
BlindBox
=
0
,
//盲盒
//星级宝箱
StarBox1
,
StarBox2
,
StarBox3
,
//通关
Checkpoint
,
Buoy
,
}
export
interface
CouponJoinOptions
{
scene
:
CouponJoinScene
,
//场景
beforeUse
:
Function
,
//跳转前
afterClose
:
Function
,
//关闭
}
export
interface
ShowTurnCircleOptions
{
afterClose
:
Function
,
//关闭转盘
}
export
default
class
Utils
{
export
default
class
Utils
{
constructor
()
{
constructor
()
{
...
@@ -125,4 +143,23 @@ export default class Utils {
...
@@ -125,4 +143,23 @@ export default class Utils {
rect2
.
y
=
obj2
.
y
;
rect2
.
y
=
obj2
.
y
;
return
rect1
.
intersects
(
rect2
);
return
rect1
.
intersects
(
rect2
);
}
}
//奖品相关弹窗
static
couponJoin
(
scene
:
CouponJoinScene
,
beforeUse
=
()
=>
{},
afterClose
=
()
=>
{}):
void
{
let
options
:
CouponJoinOptions
=
{
scene
:
scene
,
beforeUse
:
beforeUse
,
afterClose
:
afterClose
}
console
.
error
(
"奖品弹窗点击===》"
,
scene
);
beforeUse
&&
beforeUse
();
afterClose
&&
afterClose
();
}
//展示大转盘
static
showTurnCircle
(
afterClose
=
()
=>
{}):
void
{
let
options
:
ShowTurnCircleOptions
=
{
afterClose
,
}
afterClose
&&
afterClose
();
}
}
}
\ No newline at end of file
egret/src/mainScene/MainScene.ts
View file @
327c7643
This diff is collapsed.
Click to expand it.
egret/src/something/chapters/Chapter10.ts
View file @
327c7643
...
@@ -327,7 +327,17 @@ export const Chapters10: ChapterData[] = [
...
@@ -327,7 +327,17 @@ export const Chapters10: ChapterData[] = [
bubbleProbability
:
0
,
bubbleProbability
:
0
,
stepCount
:
25
,
stepCount
:
25
,
passTarget
:
{
type
:
1
,
elements
:
[{
type
:
0
,
count
:
30
},
{
type
:
1
,
count
:
36
}]
},
passTarget
:
{
type
:
1
,
elements
:
[{
type
:
0
,
count
:
30
},
{
type
:
1
,
count
:
36
}]
},
starScores
:
[
5000
,
11000
,
19000
],
map
:
{
lattices
:
[
1
,
1
,
1
,
1
,
0
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
0
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
0
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
0
,
1
,
1
,
1
,
1
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
1
,
1
,
1
,
0
,
1
,
0
,
1
,
1
,
1
,
0
,
1
,
1
,
0
,
1
,
0
,
1
,
1
,
0
],
connectedLats
:
[[
31
,
67
],
[
45
,
63
],
[
46
,
64
],
[
47
,
65
],
[
51
,
69
],
[
52
,
70
],
[
53
,
71
]],
elements
:
[
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
],
baseElements
:
[
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
],
recycles
:
[],
generateLats
:
[{
index
:
0
,
type
:
null
},
{
index
:
1
,
type
:
null
},
{
index
:
2
,
type
:
null
},
{
index
:
3
,
type
:
null
},
{
index
:
5
,
type
:
null
},
{
index
:
6
,
type
:
null
},
{
index
:
7
,
type
:
null
},
{
index
:
8
,
type
:
null
}]
}
starScores
:
[
5000
,
11000
,
19000
],
map
:
{
lattices
:
[
1
,
1
,
1
,
1
,
0
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
0
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
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
2
,
type
:
null
},
{
index
:
3
,
type
:
null
},
{
index
:
5
,
type
:
null
},
{
index
:
6
,
type
:
null
},
{
index
:
7
,
type
:
null
},
{
index
:
8
,
type
:
null
}]
}
},
},
//191
//191
{
{
...
...
egret/src/something/class/Element.ts
View file @
327c7643
...
@@ -175,8 +175,6 @@ export class Element extends eui.Component {
...
@@ -175,8 +175,6 @@ export class Element extends eui.Component {
var
texture
:
egret
.
Texture
;
var
texture
:
egret
.
Texture
;
if
(
this
.
type
==
ElementType
.
BLIND_BOX
){
if
(
this
.
type
==
ElementType
.
BLIND_BOX
){
texture
=
await
loadImageByUrl
(
"//yun.duiba.com.cn/aurora/assets/730048e95b89906c3a8076b88910ab272bc47d6f.jpeg"
);
texture
=
await
loadImageByUrl
(
"//yun.duiba.com.cn/aurora/assets/730048e95b89906c3a8076b88910ab272bc47d6f.jpeg"
);
console
.
error
(
"盲盒网络图片显示===》"
,
texture
);
}
else
{
}
else
{
texture
=
RES
.
getRes
(
source
);
texture
=
RES
.
getRes
(
source
);
}
}
...
...
egret/src/something/uis/ScoreProgress.ts
View file @
327c7643
import
{
loadImageByUrl
}
from
"../../../libs/new_wx/loadSpriteSheet"
;
import
Utils
,
{
CouponJoinScene
}
from
"../../Utils"
;
import
{
CurScoreNum
}
from
"./CurScoreNum"
;
import
{
CurScoreNum
}
from
"./CurScoreNum"
;
/**
/**
...
@@ -85,6 +87,7 @@ export class ScoreProgress {
...
@@ -85,6 +87,7 @@ export class ScoreProgress {
mask
.
graphics
.
endFill
();
mask
.
graphics
.
endFill
();
}
}
/**
/**
...
@@ -93,7 +96,8 @@ export class ScoreProgress {
...
@@ -93,7 +96,8 @@ export class ScoreProgress {
* @param scoreTxt 托管
* @param scoreTxt 托管
* @param starScores
* @param starScores
*/
*/
constructor
(
starProgress
:
eui
.
Image
,
scoreTxt
:
CurScoreNum
,
starScores
:
number
[])
{
constructor
(
starProgress
:
eui
.
Image
,
scoreTxt
:
CurScoreNum
,
starScores
:
number
[],
openStarDia
)
{
this
.
openStarDia
=
openStarDia
;
this
.
starProgress
=
starProgress
;
this
.
starProgress
=
starProgress
;
this
.
scoreTxt
=
scoreTxt
;
this
.
scoreTxt
=
scoreTxt
;
this
.
starScores
=
starScores
;
this
.
starScores
=
starScores
;
...
@@ -120,5 +124,121 @@ export class ScoreProgress {
...
@@ -120,5 +124,121 @@ export class ScoreProgress {
this
.
star3
.
x
=
573
;
this
.
star3
.
x
=
573
;
this
.
star3
.
y
=
76
;
this
.
star3
.
y
=
76
;
p
.
addChild
(
this
.
star3
);
p
.
addChild
(
this
.
star3
);
let
starboxwid
=
50
;
let
starboxhei
=
50
;
let
starboxy
=
25
;
let
starbox1x
=
423
;
let
starbox2x
=
498
;
let
starbox3x
=
573
;
this
.
starbox1
=
new
eui
.
Image
();
this
.
starbox1
.
width
=
starboxwid
;
this
.
starbox1
.
height
=
starboxhei
;
p
.
addChild
(
this
.
starbox1
);
this
.
starbox1
.
x
=
starbox1x
;
//-starboxwid/2;
this
.
starbox1
.
y
=
starboxy
;
this
.
starbox2
=
new
eui
.
Image
();
this
.
starbox2
.
width
=
starboxwid
;
this
.
starbox2
.
height
=
starboxhei
;
p
.
addChild
(
this
.
starbox2
);
this
.
starbox2
.
x
=
starbox2x
;
//-starboxwid/2;
this
.
starbox2
.
y
=
starboxy
;
this
.
starbox3
=
new
eui
.
Image
();
this
.
starbox3
.
width
=
starboxwid
;
this
.
starbox3
.
height
=
starboxhei
;
p
.
addChild
(
this
.
starbox3
);
this
.
starbox3
.
x
=
starbox3x
;
//-starboxwid/2;
this
.
starbox3
.
y
=
starboxy
;
this
.
updateStarBox
([
2
,
1
,
0
]);
this
.
starbox1
.
addEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
clickStar1
,
this
);
this
.
starbox2
.
addEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
clickStar2
,
this
);
this
.
starbox3
.
addEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
clickStar3
,
this
);
}
//新增星星宝箱
starboxdata
=
[
0
,
0
,
0
];
//0未开启,1待开启,2已开启
starbox1
:
eui
.
Image
;
starbox2
:
eui
.
Image
;
starbox3
:
eui
.
Image
;
box1wid
=
50
;
box1hei
=
50
;
box2wid
=
70
;
box2hei
=
70
;
sbox1x
=
423
;
sbox2x
=
498
;
sbox3x
=
573
;
starwid
=
46
;
sboxy
=
50
;
updateStarBox
(
data
)
{
this
.
starboxdata
=
data
;
this
.
setboxtex
(
0
);
this
.
setboxtex
(
1
);
this
.
setboxtex
(
2
);
}
s1havetween
=
false
;
s2havetween
=
false
;
s3havetween
=
false
;
openStarDia
=
null
;
async
setboxtex
(
idx
)
{
let
sp
:
eui
.
Image
=
this
[
"starbox"
+
(
idx
+
1
)];
let
data
=
this
.
starboxdata
[
idx
];
let
spx
=
this
[
"sbox"
+
(
idx
+
1
)
+
"x"
];
let
texurl
=
data
==
2
?
"//yun.duiba.com.cn/aurora/assets/8312db117356184c07b0d67153ec67ba3ed16f9f.png"
:
"//yun.duiba.com.cn/aurora/assets/f565872fe14ec885c7a9935bc0cfc40515b81898.png"
;
sp
.
texture
=
await
loadImageByUrl
(
texurl
);
sp
.
width
=
data
==
2
?
this
.
box2wid
:
this
.
box1wid
;
sp
.
height
=
data
==
2
?
this
.
box2hei
:
this
.
box1hei
;
sp
.
anchorOffsetX
=
sp
.
width
/
2
;
sp
.
anchorOffsetY
=
sp
.
height
/
2
;
sp
.
x
=
spx
+
this
.
starwid
/
2
;
// - sp.width / 2;
sp
.
y
=
this
.
sboxy
;
// - sp.height / 2;
if
(
data
==
1
)
{
if
(
!
this
[
"s"
+
(
idx
+
1
)
+
"havetween"
])
{
this
[
"s"
+
(
idx
+
1
)
+
"havetween"
]
=
true
;
egret
.
Tween
.
get
(
sp
,
{
loop
:
true
}).
to
({
rotation
:
30
},
300
)
.
to
({
rotation
:
-
30
},
600
)
.
to
({
rotation
:
0
,
},
300
);
}
}
else
{
egret
.
Tween
.
removeTweens
(
sp
);
}
}
//星星宝箱点击
clickStar1
(){
if
(
this
.
starboxdata
[
0
]
==
1
){
this
.
openStarDia
&&
this
.
openStarDia
(
1
);
}
}
clickStar2
(){
if
(
this
.
starboxdata
[
1
]
==
1
){
this
.
openStarDia
&&
this
.
openStarDia
(
2
);
}
}
clickStar3
(){
if
(
this
.
starboxdata
[
2
]
==
1
){
this
.
openStarDia
&&
this
.
openStarDia
(
3
);
}
}
}
}
}
\ No newline at end of file
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