Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
X
xiaoxiaole
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
xiaoxiaole
Commits
2627b490
Commit
2627b490
authored
Oct 25, 2019
by
wildfirecode
Browse files
Options
Browse Files
Download
Plain Diff
1
parents
9d03556c
03243267
Changes
13
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
65 additions
and
30 deletions
+65
-30
scratch_card_90.png
egret/resource/assets/scratch/scratch_card_90.png
+0
-0
scratch_card_92.png
egret/resource/assets/scratch/scratch_card_92.png
+0
-0
scratch_card_94.png
egret/resource/assets/scratch/scratch_card_94.png
+0
-0
scratch_card_96.png
egret/resource/assets/scratch/scratch_card_96.png
+0
-0
scratch_card_98.png
egret/resource/assets/scratch/scratch_card_98.png
+0
-0
scratch_card_bg.png
egret/resource/assets/scratch/scratch_card_bg.png
+0
-0
scratch_user1.png
egret/resource/assets/scratch/scratch_user1.png
+0
-0
scratch_user2.png
egret/resource/assets/scratch/scratch_user2.png
+0
-0
default.res.json
egret/resource/default.res.json
+1
-1
ScratchPrizeSkin.exml
egret/resource/skins/ScratchPrizeSkin.exml
+1
-1
ScratchSkin.exml
egret/resource/skins/ScratchSkin.exml
+3
-1
MainScene.ts
egret/src/mainScene/MainScene.ts
+28
-22
ScratchPanel.ts
egret/src/panels/ScratchPanel.ts
+32
-5
No files found.
egret/resource/assets/scratch/scratch_card_90.png
0 → 100644
View file @
2627b490
19.2 KB
egret/resource/assets/scratch/scratch_card_92.png
0 → 100644
View file @
2627b490
18 KB
egret/resource/assets/scratch/scratch_card_94.png
0 → 100644
View file @
2627b490
15.5 KB
egret/resource/assets/scratch/scratch_card_96.png
0 → 100644
View file @
2627b490
13.8 KB
egret/resource/assets/scratch/scratch_card_98.png
0 → 100644
View file @
2627b490
12.2 KB
egret/resource/assets/scratch/scratch_card_bg.png
0 → 100644
View file @
2627b490
18.4 KB
egret/resource/assets/scratch/scratch_user1.png
0 → 100644
View file @
2627b490
17.2 KB
egret/resource/assets/scratch/scratch_user2.png
0 → 100644
View file @
2627b490
18.8 KB
egret/resource/default.res.json
View file @
2627b490
...
...
@@ -129,7 +129,7 @@
"name"
:
"friendshare"
},
{
"keys"
:
"scratch_bg_png,scratch_hongbao_png,scratch_help_png,scratch_progress_bg_png,scratch_wx_tip_png,scratchbg2_png,scratch_invite_png"
,
"keys"
:
"scratch_bg_png,scratch_hongbao_png,scratch_help_png,scratch_progress_bg_png,scratch_wx_tip_png,scratchbg2_png,scratch_invite_png
,scratch_card_92_png,scratch_card_98_png,scratch_card_96_png,scratch_card_bg_png,scratch_card_94_png,scratch_card_90_png,scratch_user2_png,scratch_user1_png
"
,
"name"
:
"scratch"
},
{
...
...
egret/resource/skins/ScratchPrizeSkin.exml
View file @
2627b490
...
...
@@ -2,7 +2,7 @@
<e:Skin
class=
"InviteSkin"
width=
"750"
height=
"1206"
xmlns:e=
"http://ns.egret.com/eui"
xmlns:w=
"http://ns.egret.com/wing"
>
<e:Image
y=
"45.33"
horizontalCenter=
"0"
source=
"scratchPrize_bg_png"
/>
<e:Image
id=
"prizeImg"
y=
"426.77"
source=
""
horizontalCenter=
"0"
width=
"510"
height=
"228"
/>
<e:Image
id=
"prizeImg"
y=
"426.77"
source=
""
horizontalCenter=
"0"
width=
"510"
height=
"228"
/>
<e:Button
id=
"closeBtn"
label=
""
x=
"624"
y=
"313.33"
>
<e:skinName>
<e:Skin
states=
"up,down,disabled"
xmlns:w=
"http://ns.egret.com/wing"
>
...
...
egret/resource/skins/ScratchSkin.exml
View file @
2627b490
...
...
@@ -7,7 +7,9 @@
<e:Image
y=
"259.33"
source=
"scratch_bg_png"
horizontalCenter=
"0"
/>
<e:Group
id=
"con"
y=
"-67"
/>
<e:Label
id=
"numLabel"
text=
"共2位好友帮你刮了90.3%"
y=
"381.33"
textColor=
"0xF54500"
size=
"28"
horizontalCenter=
"0"
fontFamily=
"Lucida Family"
verticalAlign=
"middle"
textAlign=
"center"
/>
<e:Image
id=
"prizeImg"
y=
"439.33"
horizontalCenter=
"0.5"
source=
""
width=
"510"
height=
"228"
/>
<e:Image
y=
"414"
horizontalCenter=
"0"
source=
"scratch_card_bg_png"
/>
<e:Image
id=
"prizeImg"
y=
"435"
source=
""
width=
"510"
height=
"228"
horizontalCenter=
"0"
/>
<e:Image
id=
"scratch_progress"
y=
"414"
horizontalCenter=
"0"
x=
"10"
source=
"scratch_card_90_png"
/>
<e:Button
id=
"closeBtn"
label=
""
x=
"605"
y=
"219.33"
>
<e:skinName>
<e:Skin
states=
"up,down,disabled"
xmlns:w=
"http://ns.egret.com/wing"
>
...
...
egret/src/mainScene/MainScene.ts
View file @
2627b490
...
...
@@ -166,8 +166,8 @@ export default class MainScene extends Scene {
* 判断连通的状态
* 1表示存在小列连通到大列,从右往左遍历
* 2表示存在大列连通到小烈,从左往右遍历
* 3表示都有,遍历两边,down
的
大,从右先
* 4表示都有,遍历两边,down
的
小,从左先
* 3表示都有,遍历两边,down
比up
大,从右先
* 4表示都有,遍历两边,down
比up
小,从左先
*/
connectState
:
number
=
2
;
//皮肤上的
...
...
@@ -482,7 +482,7 @@ export default class MainScene extends Scene {
this
.
generateIndexs
=
Tool
.
setGenerateLats
(
this
.
lattices
,
this
.
chapterData
.
map
.
generateLats
||
[])
var
downMax
:
number
=
0
;
var
downMin
:
number
=
Tool
.
colNum
-
1
;
var
upMax
:
number
=
0
;
var
hasSmallToBig
:
boolean
;
var
hasBigToSmall
:
boolean
;
//联通口
...
...
@@ -494,6 +494,8 @@ export default class MainScene extends Scene {
var
colUp
=
Tool
.
indexToRc
(
connectedLat
[
0
])[
1
];
var
colDown
=
Tool
.
indexToRc
(
connectedLat
[
1
])[
1
];
downMax
=
Math
.
max
(
downMax
,
colDown
);
upMax
=
Math
.
max
(
upMax
,
colUp
);
if
(
colUp
>
colDown
)
{
hasBigToSmall
=
true
;
}
...
...
@@ -503,10 +505,14 @@ export default class MainScene extends Scene {
}
//1表示存在小列连通到大列,从右往左遍历
//2表示存在大列连通到小烈,从左往右遍历
//3表示都有,遍历两边,down
的
大,从右先
//4表示都有,遍历两边,down
的
小,从左先
//3表示都有,遍历两边,down
比up
大,从右先
//4表示都有,遍历两边,down
比up
小,从左先
if
(
hasBigToSmall
&&
hasSmallToBig
)
{
if
(
downMax
>
upMax
)
{
this
.
connectState
=
3
;
}
else
{
this
.
connectState
=
4
;
}
}
else
if
(
hasBigToSmall
)
{
this
.
connectState
=
2
;
...
...
@@ -1058,7 +1064,7 @@ export default class MainScene extends Scene {
if
(
/*!this.fallVerMark ||*/
Tool
.
judgeOutOne
(
this
.
emptys
,
this
.
lattices
))
{
// this.fallVerMark = true;
var
anis
=
this
.
fallVerticalEx
();
anis
=
anis
.
concat
(
this
.
fallVerticalEx
())
//
anis = anis.concat(this.fallVerticalEx())
// anis = anis.concat(this.fallSkewEx())
if
(
!
anis
.
length
)
{
anis
=
this
.
fallSkewEx
()
...
...
@@ -1146,8 +1152,8 @@ export default class MainScene extends Scene {
fallVerticalEx
()
{
//1表示存在小列连通到大列,从右往左遍历
//2表示存在大列连通到小烈,从左往右遍历
//3表示都有,遍历两边,down
的
大,从右先
//4表示都有,遍历两边,down
的
小,从左先
//3表示都有,遍历两边,down
比up
大,从右先
//4表示都有,遍历两边,down
比up
小,从左先
var
anis
:
FallAniData
[]
=
[]
let
operation
=
(
m
)
=>
{
//同一列,先原有的填满,再查是否有生成口
...
...
@@ -1210,20 +1216,20 @@ export default class MainScene extends Scene {
}
}
}
if
(
this
.
connectState
==
1
)
{
for
(
var
m
=
Tool
.
colNum
;
m
>=
0
;
m
++
)
operation
(
m
)
}
else
if
(
this
.
connectState
==
2
)
{
//
if (this.connectState == 1) {
//
for (var m = Tool.colNum; m >= 0; m++)operation(m)
//
}
//
else if (this.connectState == 2) {
for
(
var
m
=
0
;
m
<
Tool
.
colNum
;
m
++
)
operation
(
m
)
}
else
if
(
this
.
connectState
==
3
)
{
for
(
var
m
=
Tool
.
colNum
;
m
>=
0
;
m
++
)
operation
(
m
);
for
(
var
m
=
0
;
m
<
Tool
.
colNum
;
m
++
)
operation
(
m
);
}
else
if
(
this
.
connectState
==
4
)
{
for
(
var
m
=
0
;
m
<
Tool
.
colNum
;
m
++
)
operation
(
m
);
for
(
var
m
=
Tool
.
colNum
;
m
>=
0
;
m
++
)
operation
(
m
);
}
//
}
//
else if (this.connectState == 3) {
//
for (var m = Tool.colNum; m >= 0; m++) operation(m);
//
for (var m = 0; m < Tool.colNum; m++) operation(m);
//
}
//
else if (this.connectState == 4) {
//
for (var m = 0; m < Tool.colNum; m++) operation(m);
//
for (var m = Tool.colNum; m >= 0; m++) operation(m);
//
}
return
anis
;
}
...
...
egret/src/panels/ScratchPanel.ts
View file @
2627b490
...
...
@@ -8,7 +8,6 @@ import ScratchRulePanel from "./ScratchRulePanel";
import
CutTimer
from
"../CutTimer"
;
export
default
class
ScratchPanel
extends
Panel
{
private
invite_img
:
egret
.
Texture
;
private
cutTimer
:
CutTimer
;
constructor
(
data
)
{
...
...
@@ -81,21 +80,30 @@ export default class ScratchPanel extends Panel {
this
.
hongbaoEffect
();
this
.
setWXShareTip
();
this
[
"progressGroup"
].
mask
=
this
[
"progressMask"
];
this
.
setProgress
(
90.3
);
this
[
'numLabel'
]
=
`共
${
this
.
data
.
invitationUser
.
length
}
位好友帮你刮了
${
90.3
}
%`
;
this
.
setProgress
(
98
);
this
[
"prizeImg"
].
source
=
this
.
data
.
prizeImg
;
if
(
!
this
.
data
.
invitationUser
)
{
this
.
data
.
invitationUser
=
[];
}
// 添加邀请图标
let
dNum
=
this
.
data
.
invitationCount
-
this
.
data
.
invitationUser
.
length
;
for
(
let
i
=
0
;
i
<
dNum
;
i
++
)
{
this
.
data
.
invitationUser
.
push
({
nickname
:
"nickname"
,
avatar
:
this
.
invite_img
,
avatar
:
"scratch_invite_png"
,
});
}
// 添加假用户
this
.
data
.
invitationUser
.
unshift
({
nickname
:
"nickname"
,
avatar
:
"scratch_user1_png"
,
},
{
nickname
:
"nickname"
,
avatar
:
"scratch_user2_png"
,
});
// 添加回调函数
for
(
let
i
=
0
;
i
<
this
.
data
.
invitationUser
.
length
;
i
++
)
{
this
.
data
.
invitationUser
[
i
][
'callFun'
]
=
()
=>
{
NetManager
.
ins
.
getShareCode
((
success
,
res
)
=>
{
...
...
@@ -143,11 +151,31 @@ export default class ScratchPanel extends Panel {
}
else
if
(
progress
<
0
)
{
progress
=
0
;
}
this
[
'numLabel'
].
text
=
`共
${
this
.
data
.
invitationUser
.
length
+
2
}
位好友帮你刮了
${
progress
}
%`
;
this
[
"progressLabel"
].
text
=
`仅剩
${(
100
-
progress
).
toFixed
(
2
)}
%`
;
// 进度条文字
let
_width
=
this
[
"progressBg"
].
width
*
progress
/
100
;
// 宽度
let
dProgress
=
Math
.
abs
(
progress
-
this
[
"progress"
].
width
/
this
[
"progressBg"
].
width
);
// 比当前进度的差值的绝对值
let
_duration
=
1000
*
dProgress
/
100
;
// 算出变化的时间
egret
.
Tween
.
get
(
this
[
"progress"
]).
to
({
width
:
_width
},
_duration
);
let
i
=
new
eui
.
Image
();
if
(
progress
>=
100
){
this
[
"scratch_progress"
].
visible
=
false
;
}
else
if
(
progress
>=
98
&&
progress
<
100
){
this
[
"scratch_progress"
].
visible
=
true
;
this
[
"scratch_progress"
].
source
=
"scratch_card_98_png"
;
}
else
if
(
progress
>=
96
&&
progress
<
98
){
this
[
"scratch_progress"
].
visible
=
true
;
this
[
"scratch_progress"
].
source
=
"scratch_card_96_png"
;
}
else
if
(
progress
>=
94
&&
progress
<
96
){
this
[
"scratch_progress"
].
visible
=
true
;
this
[
"scratch_progress"
].
source
=
"scratch_card_94_png"
;
}
else
if
(
progress
>=
92
&&
progress
<
96
){
this
[
"scratch_progress"
].
visible
=
true
;
this
[
"scratch_progress"
].
source
=
"scratch_card_92_png"
;
}
else
if
(
progress
<
92
){
this
[
"scratch_progress"
].
visible
=
true
;
this
[
"scratch_progress"
].
source
=
"scratch_card_90_png"
;
}
}
private
setWXShareTip
()
{
...
...
@@ -177,7 +205,6 @@ export default class ScratchPanel extends Panel {
}
private
async
getGameRes
()
{
this
.
invite_img
=
await
RES
.
getResAsync
(
"scratch_invite_png"
);
}
get
skinKey
()
{
...
...
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