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
bd6bb07f
Commit
bd6bb07f
authored
Nov 07, 2019
by
邱旭
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev' of
http://gitlab2.dui88.com/wanghongyuan/xiaoxiaole
into dev
parents
6fe5106f
cf502021
Changes
13
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
618 additions
and
196 deletions
+618
-196
MainBase.ts
egret/libs/new_wx/MainBase.ts
+2
-0
redBombLight.svga
egret/resource/assets/svgas/redBombLight.svga
+0
-0
default.thm.json
egret/resource/default.thm.json
+91
-90
RedBombRuleSkin.exml
egret/resource/skins/RedBombRuleSkin.exml
+21
-0
getRedBombAward.ts
egret/src/getRedBombAward.ts
+25
-12
MainScene.ts
egret/src/mainScene/MainScene.ts
+110
-61
BombTipsPanel.ts
egret/src/panels/BombTipsPanel.ts
+10
-1
RedBombRule.ts
egret/src/panels/RedBombRule.ts
+49
-0
Tool.ts
egret/src/something/Tool.ts
+18
-0
FesRedBombShowAni.ts
egret/src/something/anisCall/FesRedBombShowAni.ts
+38
-0
FestivalEle.ts
egret/src/something/class/FestivalEle.ts
+249
-27
RecoverName.ts
egret/src/something/enum/RecoverName.ts
+1
-1
FestivalTarget.ts
egret/src/something/uis/FestivalTarget.ts
+4
-4
No files found.
egret/libs/new_wx/MainBase.ts
View file @
bd6bb07f
...
@@ -68,6 +68,7 @@ import HbNoPrize from "../../src/panels/HongbaoRain/HbNoPrize";
...
@@ -68,6 +68,7 @@ import HbNoPrize from "../../src/panels/HongbaoRain/HbNoPrize";
import
HbGame
from
"../../src/panels/HongbaoRain/HbGame"
;
import
HbGame
from
"../../src/panels/HongbaoRain/HbGame"
;
import
getRedBombAward
from
"../../src/getRedBombAward"
;
import
getRedBombAward
from
"../../src/getRedBombAward"
;
import
BombTipsPanel
from
"../../src/panels/BombTipsPanel"
;
import
BombTipsPanel
from
"../../src/panels/BombTipsPanel"
;
import
RedBombRule
from
"../../src/panels/RedBombRule"
;
export
default
class
MainBase
extends
eui
.
UILayer
{
export
default
class
MainBase
extends
eui
.
UILayer
{
constructor
()
{
constructor
()
{
...
@@ -125,6 +126,7 @@ export default class MainBase extends eui.UILayer {
...
@@ -125,6 +126,7 @@ export default class MainBase extends eui.UILayer {
[
'friend'
,
{
cls
:
FriendPanel
}],
[
'friend'
,
{
cls
:
FriendPanel
}],
[
'ad'
,
{
cls
:
ADPanel
}],
[
'ad'
,
{
cls
:
ADPanel
}],
[
'BombTipsPanel'
,
{
cls
:
BombTipsPanel
}],
[
'BombTipsPanel'
,
{
cls
:
BombTipsPanel
}],
[
'RedBombRule'
,
{
cls
:
RedBombRule
}],
];
];
const
scenes
=
[
const
scenes
=
[
...
...
egret/resource/assets/svgas/redBombLight.svga
0 → 100644
View file @
bd6bb07f
File added
egret/resource/default.thm.json
View file @
bd6bb07f
{
{
"skins"
:
{},
"skins"
:
{},
"autoGenerateExmlsList"
:
true
,
"autoGenerateExmlsList"
:
true
,
"exmls"
:
[
"exmls"
:
[
"resource/skins/ADSkin.exml"
,
"resource/skins/ADSkin.exml"
,
"resource/skins/ADSmallSkin.exml"
,
"resource/skins/ADSmallSkin.exml"
,
"resource/skins/AlertSkin.exml"
,
"resource/skins/AlertSkin.exml"
,
"resource/skins/AvatarSkin.exml"
,
"resource/skins/AvatarSkin.exml"
,
"resource/skins/BackSkin.exml"
,
"resource/skins/BackSkin.exml"
,
"resource/skins/BagItem2Skin.exml"
,
"resource/skins/BagItem2Skin.exml"
,
"resource/skins/BagItemSkin.exml"
,
"resource/skins/BagItemSkin.exml"
,
"resource/skins/BagQuitSkin.exml"
,
"resource/skins/BagQuitSkin.exml"
,
"resource/skins/BagSkin.exml"
,
"resource/skins/BagSkin.exml"
,
"resource/skins/Blood2Skin.exml"
,
"resource/skins/Blood2Skin.exml"
,
"resource/skins/BloodSkin.exml"
,
"resource/skins/BloodSkin.exml"
,
"resource/skins/Box2Skin.exml"
,
"resource/skins/Box2Skin.exml"
,
"resource/skins/BoxSkin.exml"
,
"resource/skins/BoxSkin.exml"
,
"resource/skins/Buy1Skin.exml"
,
"resource/skins/Buy1Skin.exml"
,
"resource/skins/Buy2Skin.exml"
,
"resource/skins/Buy2Skin.exml"
,
"resource/skins/Buy3Skin.exml"
,
"resource/skins/Buy3Skin.exml"
,
"resource/skins/ExchangeSkin.exml"
,
"resource/skins/ExchangeSkin.exml"
,
"resource/skins/FailSkin.exml"
,
"resource/skins/FailSkin.exml"
,
"resource/skins/FriendItem2Skin.exml"
,
"resource/skins/FriendItem2Skin.exml"
,
"resource/skins/FriendItemSkin.exml"
,
"resource/skins/FriendItemSkin.exml"
,
"resource/skins/FriendShareSkin.exml"
,
"resource/skins/FriendShareSkin.exml"
,
"resource/skins/FriendSkin.exml"
,
"resource/skins/FriendSkin.exml"
,
"resource/skins/H52Skin.exml"
,
"resource/skins/H52Skin.exml"
,
"resource/skins/H5Skin.exml"
,
"resource/skins/H5Skin.exml"
,
"resource/skins/HbCutTimeSkin.exml"
,
"resource/skins/HbCutTimeSkin.exml"
,
"resource/skins/HbGameSkin.exml"
,
"resource/skins/HbGameSkin.exml"
,
"resource/skins/HbNoPrizeSkin.exml"
,
"resource/skins/HbNoPrizeSkin.exml"
,
"resource/skins/HbPrizeSkin.exml"
,
"resource/skins/HbPrizeSkin.exml"
,
"resource/skins/HbRuleSkin.exml"
,
"resource/skins/HbRuleSkin.exml"
,
"resource/skins/IconButtonSkin.exml"
,
"resource/skins/IconButtonSkin.exml"
,
"resource/skins/InviteCutTimePanelSkin.exml"
,
"resource/skins/InviteCutTimePanelSkin.exml"
,
"resource/skins/InviteItemSkin.exml"
,
"resource/skins/InviteItemSkin.exml"
,
"resource/skins/InvitePrizePanelSkin.exml"
,
"resource/skins/InvitePrizePanelSkin.exml"
,
"resource/skins/InviteRulePanelSkin.exml"
,
"resource/skins/InviteRulePanelSkin.exml"
,
"resource/skins/InviteRuleSkin.exml"
,
"resource/skins/InviteRuleSkin.exml"
,
"resource/skins/InviteSkin.exml"
,
"resource/skins/InviteSkin.exml"
,
"resource/skins/Main2Skin.exml"
,
"resource/skins/Main2Skin.exml"
,
"resource/skins/MapBottomSkin.exml"
,
"resource/skins/MapBottomSkin.exml"
,
"resource/skins/MapRepeatSkin.exml"
,
"resource/skins/MapRepeatSkin.exml"
,
"resource/skins/MapSkin.exml"
,
"resource/skins/MapSkin.exml"
,
"resource/skins/MapTopSkin.exml"
,
"resource/skins/MapTopSkin.exml"
,
"resource/skins/NoPrizeSkin.exml"
,
"resource/skins/NoPrizeSkin.exml"
,
"resource/skins/OptionItemSkin.exml"
,
"resource/skins/OptionItemSkin.exml"
,
"resource/skins/OptionsSkin.exml"
,
"resource/skins/OptionsSkin.exml"
,
"resource/skins/PlaySkin.exml"
,
"resource/skins/PlaySkin.exml"
,
"resource/skins/Prize2Skin.exml"
,
"resource/skins/Prize2Skin.exml"
,
"resource/skins/PrizeSkin.exml"
,
"resource/skins/PrizeSkin.exml"
,
"resource/skins/QuitSkin.exml"
,
"resource/skins/QuitSkin.exml"
,
"resource/skins/RankFriendListSkin.exml"
,
"resource/skins/RankFriendListSkin.exml"
,
"resource/skins/RankItemSkin.exml"
,
"resource/skins/RankItemSkin.exml"
,
"resource/skins/RankSkin.exml"
,
"resource/skins/RankSkin.exml"
,
"resource/skins/RedBagActivitySkin.exml"
,
"resource/skins/RedBagActivitySkin.exml"
,
"resource/skins/RedBagAlertSkin.exml"
,
"resource/skins/RedBagAlertSkin.exml"
,
"resource/skins/RedBombTipsSkin.exml"
,
"resource/skins/RedBombTipsSkin.exml"
,
"resource/skins/ReliveSkin.exml"
,
"resource/skins/ReliveSkin.exml"
,
"resource/skins/RuleSkin.exml"
,
"resource/skins/RuleSkin.exml"
,
"resource/skins/ScratchItemSkin.exml"
,
"resource/skins/ScratchItemSkin.exml"
,
"resource/skins/ScratchPrizeSkin.exml"
,
"resource/skins/ScratchPrizeSkin.exml"
,
"resource/skins/ScratchRuleSkin.exml"
,
"resource/skins/ScratchRuleSkin.exml"
,
"resource/skins/ScratchSkin.exml"
,
"resource/skins/ScratchSkin.exml"
,
"resource/skins/Share2Skin.exml"
,
"resource/skins/Share2Skin.exml"
,
"resource/skins/Share3Skin.exml"
,
"resource/skins/Share3Skin.exml"
,
"resource/skins/ShareSkin.exml"
,
"resource/skins/ShareSkin.exml"
,
"resource/skins/ShareTipsSkin.exml"
,
"resource/skins/ShareTipsSkin.exml"
,
"resource/skins/ShopSkin.exml"
,
"resource/skins/ShopSkin.exml"
,
"resource/skins/ShowOffSkin.exml"
,
"resource/skins/ShowOffSkin.exml"
,
"resource/skins/SignItemSkin.exml"
,
"resource/skins/SignItemSkin.exml"
,
"resource/skins/SignPrizeSkin.exml"
,
"resource/skins/SignPrizeSkin.exml"
,
"resource/skins/SignSkin.exml"
,
"resource/skins/SignSkin.exml"
,
"resource/skins/StarSkin.exml"
,
"resource/skins/StarSkin.exml"
,
"resource/skins/StartPanelSkin.exml"
,
"resource/skins/StartPanelSkin.exml"
,
"resource/skins/StartSkin.exml"
,
"resource/skins/StartSkin.exml"
,
"resource/skins/TargetItemSkin.exml"
,
"resource/skins/TargetItemSkin.exml"
,
"resource/skins/TaskItemSkin.exml"
,
"resource/skins/TaskItemSkin.exml"
,
"resource/skins/TaskPrizeSkin.exml"
,
"resource/skins/TaskPrizeSkin.exml"
,
"resource/skins/TaskSkin.exml"
,
"resource/skins/TaskSkin.exml"
,
"resource/skins/Toast2Skin.exml"
,
"resource/skins/Toast2Skin.exml"
,
"resource/skins/ToastSkin.exml"
,
"resource/skins/ToastSkin.exml"
,
"resource/skins/RedBombTipsSkin.exml"
,
"resource/skins/RedBombTipsSkin.exml"
,
"resource/skins/TurnRuleSkin.exml"
,
"resource/skins/RedBombRuleSkin.exml"
,
"resource/skins/TurntableNoPrizeSkin.exml"
,
"resource/skins/TurnRuleSkin.exml"
,
"resource/skins/TurntablePrize2Skin.exml"
,
"resource/skins/TurntableNoPrizeSkin.exml"
,
"resource/skins/TurntablePrizeSkin.exml"
,
"resource/skins/TurntablePrize2Skin.exml"
,
"resource/skins/TurntableSkin.exml"
,
"resource/skins/TurntablePrizeSkin.exml"
,
"resource/skins/VScrollBarSkin.exml"
"resource/skins/TurntableSkin.exml"
,
],
"resource/skins/VScrollBarSkin.exml"
"path"
:
"resource/default.thm.json"
],
"path"
:
"resource/default.thm.json"
}
}
\ No newline at end of file
egret/resource/skins/RedBombRuleSkin.exml
0 → 100644
View file @
bd6bb07f
<?xml version="1.0" encoding="utf-8"?>
<e:Skin
class=
"RedBombRuleSkin"
width=
"750"
height=
"1624"
xmlns:e=
"http://ns.egret.com/eui"
xmlns:w=
"http://ns.egret.com/wing"
>
<e:Rect
left=
"0"
top=
"0"
bottom=
"0"
right=
"0"
fillAlpha=
"0.65"
/>
<e:Image
id=
"ruleBg"
horizontalCenter=
"0"
y=
"112"
source=
"hbRule_bg_png"
/>
<e:Scroller
id=
"scroller"
width=
"545"
x=
"103.76"
height=
"507"
y=
"337.2"
>
<e:Group
id=
"group"
width=
"100%"
>
<e:Label
id=
"labContent"
width=
"100%"
text=
""
lineSpacing=
"10"
size=
"30"
multiline=
"true"
textColor=
"0xa54615"
/>
<e:layout>
<e:VerticalLayout/>
</e:layout>
</e:Group>
</e:Scroller>
<e:Button
id=
"closeBtn"
label=
""
x=
"613"
y=
"261"
>
<e:skinName>
<e:Skin
states=
"up,down,disabled"
>
<e:Image
width=
"100%"
height=
"100%"
source=
"closeCommonBtn_png"
source.down=
"closeCommonBtn_png"
source.disabled=
"closeCommonBtn_png"
/>
<e:Label
id=
"labelDisplay"
horizontalCenter=
"0"
verticalCenter=
"0"
/>
</e:Skin>
</e:skinName>
</e:Button>
</e:Skin>
\ No newline at end of file
egret/src/getRedBombAward.ts
View file @
bd6bb07f
...
@@ -6,21 +6,34 @@ import { DataManager } from "../libs/tw/manager/DataManager";
...
@@ -6,21 +6,34 @@ import { DataManager } from "../libs/tw/manager/DataManager";
*/
*/
export
default
(
callback
?)
=>
{
export
default
(
callback
?)
=>
{
NetManager
.
ins
.
hc_redBombAward
((
success
)
=>
{
NetManager
.
ins
.
hc_redBombAward
((
success
)
=>
{
callback
(
success
);
if
(
success
)
{
if
(
success
)
{
const
data
=
DataManager
.
ins
.
getData
(
'hc_redBombAward'
).
data
;
const
data
=
DataManager
.
ins
.
getData
(
'hc_redBombAward'
).
data
;
if
(
data
&&
data
.
option
&&
data
.
option
.
categoryType
!=
1
)
{
if
(
data
)
changeTimesData
(
data
.
remainAwardTimes
||
0
);
callback
(
1
);
// if (data && data.option && data.option.categoryType != 1) {
}
// callback(1);
else
{
// }
callback
(
0
);
// else {
}
// callback(0);
}
else
{
// }
callback
(
0
);
}
}
NetManager
.
ins
.
hc_redBombBaseInfo
(()
=>
{});
// else {
// callback(0);
// }
// NetManager.ins.hc_redBombBaseInfo(() => { });
});
});
}
}
export
const
getRedBombTimes
=
()
=>
{
//如果接口没成功就返回0
return
DataManager
.
ins
.
getData
(
'hc_redBombBaseInfo'
);
export
const
getRedBombTimes
=
()
=>
{
if
(
DataManager
.
ins
.
getData
(
'hc_redBombBaseInfo'
)
&&
DataManager
.
ins
.
getData
(
'hc_redBombBaseInfo'
).
data
)
{
return
DataManager
.
ins
.
getData
(
'hc_redBombBaseInfo'
).
data
;
}
return
0
;
}
function
changeTimesData
(
timess
:
number
)
{
DataManager
.
ins
.
getData
(
'hc_redBombBaseInfo'
).
data
=
timess
;
}
}
\ No newline at end of file
egret/src/mainScene/MainScene.ts
View file @
bd6bb07f
This diff is collapsed.
Click to expand it.
egret/src/panels/BombTipsPanel.ts
View file @
bd6bb07f
...
@@ -2,6 +2,7 @@ import Panel from "../../libs/new_wx/components/Panel";
...
@@ -2,6 +2,7 @@ import Panel from "../../libs/new_wx/components/Panel";
import
PanelCtrl
from
"../../libs/new_wx/ctrls/panelCtrl"
;
import
PanelCtrl
from
"../../libs/new_wx/ctrls/panelCtrl"
;
import
SceneCtrl
from
"../../libs/new_wx/ctrls/sceneCtrl"
;
import
SceneCtrl
from
"../../libs/new_wx/ctrls/sceneCtrl"
;
import
{
createEffect1MovieClip
}
from
"../effect/createEffect1"
;
import
{
createEffect1MovieClip
}
from
"../effect/createEffect1"
;
import
RedBombRule
from
"./RedBombRule"
;
export
default
class
BombTipsPanel
extends
Panel
{
export
default
class
BombTipsPanel
extends
Panel
{
async
start
(
data
)
{
async
start
(
data
)
{
...
@@ -32,9 +33,17 @@ export default class BombTipsPanel extends Panel {
...
@@ -32,9 +33,17 @@ export default class BombTipsPanel extends Panel {
initEvents
()
{
initEvents
()
{
super
.
initEvents
();
super
.
initEvents
();
this
[
'btn'
].
addEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
onTapInvite
,
this
)
this
[
'btn'
].
addEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
onTapInvite
,
this
);
this
[
'rulebtn'
].
addEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
onTapInvite2
,
this
);
}
}
onTapInvite2
()
{
const
rule
=
new
RedBombRule
();
rule
.
loadSkin
();
rule
.
start
();
this
.
addChild
(
rule
);
}
onTapInvite
()
{
onTapInvite
()
{
this
[
'btn'
].
touchEnabled
=
false
;
this
[
'btn'
].
touchEnabled
=
false
;
const
eles
=
[
'btn'
,
'rulebtn'
,
'bg'
,
'ele1'
,
'ele2'
,
'ele3'
,
'ele4'
,
'light'
];
const
eles
=
[
'btn'
,
'rulebtn'
,
'bg'
,
'ele1'
,
'ele2'
,
'ele3'
,
'ele4'
,
'light'
];
...
...
egret/src/panels/RedBombRule.ts
0 → 100644
View file @
bd6bb07f
import
Panel
from
"../../libs/new_wx/components/Panel"
;
import
getSkinPath
from
"../../libs/new_wx/utils/getSkinPath"
;
import
{
HtmlTextParser
}
from
"../../libs/new_wx/HtmlTextParser"
;
/**
* 邀请规则面板
*/
export
default
class
RedBombRule
extends
Panel
{
public
scroller
:
eui
.
Scroller
;
public
group
:
eui
.
Group
;
public
labContent
:
eui
.
Label
;
public
closeBtn
:
eui
.
Button
;
private
_mask
:
egret
.
Sprite
;
start
()
{
super
.
start
();
this
.
addRule
();
this
.
closeBtn
.
addEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
()
=>
{
this
.
visible
=
false
;
},
this
);
}
loadSkin
()
{
this
.
skinName
=
getSkinPath
(
this
.
skinKey
);
if
(
this
.
skin
)
{
this
.
onSkinComplete
();
}
else
{
this
.
addEventListener
(
egret
.
Event
.
COMPLETE
,
this
.
onSkinComplete
,
this
);
}
}
private
addRule
()
{
const
text
=
`<br>1、用户每天邀请指定数量的新玩家参与闯关,可获得指定的现金券奖励。
2、用户发起邀请后,需在24小时内完成邀请任务;超过24小时,邀请任务失败,无法获得奖励,需重新发起邀请。
3、新用户仅包含未参与过狮狮连萌活动的用户。
4、用户不可为自己助力,或重复为好友助力。
5、完成邀请任务后,玩家可点击首页“邀请得现金券”图标领取现金券。
6、发放的奖励请在规定的有效时间内尽快领取或使用,逾期未领取或使用的会失效哦。
7、活动过程中,凡以不正当手段(包括但不限于作弊、恶意套现、扰乱系统、网络攻击等违规行为)参与本次活动的用户,苏宁易购有权终止其参加活动,并取消其获得奖励的资格。
8、极少数特殊情况下,若用户在完成活动的任务中被系统判定异常账户或风控账户,则可能导致奖励发放异常。
9、如遇不可抗力(包括但不限于重大自然灾害事件、活动受政府机关指令需要停止举办或调整的、活动遭受严重网络攻击不能正常进行的),苏宁易购有权取消、修改或暂停活动。`
this
.
labContent
.
textFlow
=
(
new
HtmlTextParser
).
parser
(
text
);
}
get
skinKey
()
{
return
'RedBombRule'
}
}
egret/src/something/Tool.ts
View file @
bd6bb07f
...
@@ -369,6 +369,24 @@ export class Tool {
...
@@ -369,6 +369,24 @@ export class Tool {
return
false
;
return
false
;
}
}
/**
* 可放置节日元素
* 必须是基础元素,且不带毛球状态
* 毛球可能成为通关目标,不放
*
* @param lat
*/
public
static
judgeSetFesEle
(
lat
:
Lattice
)
{
if
(
Tool
.
judgeBaseEle
(
lat
)
&&
//基础元素
!
lat
.
element
.
hasState
(
StateType
.
HAIRBALLGREY
)
&&
//不带毛球,下同
!
lat
.
element
.
hasState
(
StateType
.
HAIRBALLBLACK
)
&&
!
lat
.
element
.
hasState
(
StateType
.
HAIRBALLBROWN
)
)
{
return
true
;
}
return
false
;
}
/**
/**
* 判断元素是否可被手势选中和交换
* 判断元素是否可被手势选中和交换
...
...
egret/src/something/anisCall/FesRedBombShowAni.ts
0 → 100644
View file @
bd6bb07f
import
{
Pool
}
from
"../Pool"
;
import
{
RecoverName
}
from
"../enum/RecoverName"
;
export
class
FesRedBombShowAni
extends
egret
.
DisplayObjectContainer
{
constructor
()
{
super
()
var
textureDown
:
egret
.
Texture
=
RES
.
getRes
(
"fesRedBombSta1_png"
)
var
down
=
new
egret
.
Bitmap
(
textureDown
);
down
.
x
=
-
textureDown
.
textureWidth
/
2
;
down
.
y
=
-
textureDown
.
textureHeight
/
2
;
this
.
addChild
(
down
);
var
textureUp
:
egret
.
Texture
=
RES
.
getRes
(
"xingxingbi_png"
);
var
up
=
new
egret
.
Bitmap
(
textureUp
);
up
.
x
=
-
textureUp
.
textureWidth
/
2
;
//-89
up
.
y
=
-
100
;
this
.
addChild
(
up
);
}
play
(
position
:
number
[],
callback
:
Function
)
{
this
.
scaleX
=
this
.
scaleY
=
0.29
;
this
.
x
=
position
[
0
];
this
.
y
=
position
[
1
];
egret
.
Tween
.
get
(
this
)
.
wait
(
200
)
.
to
({
scaleX
:
1
,
scaleY
:
1
},
500
,
egret
.
Ease
.
backOut
)
.
wait
(
500
)
.
to
({
scaleX
:
0.29
,
scaleY
:
0.29
},
500
,
egret
.
Ease
.
backInOut
)
.
call
(()
=>
{
if
(
this
.
parent
)
this
.
parent
.
removeChild
(
this
);
Pool
.
recover
(
RecoverName
.
FESREDBOMBSHOW_ANI
,
this
);
callback
()
})
//波纹动效再说,现在来不及
}
}
\ No newline at end of file
egret/src/something/class/FestivalEle.ts
View file @
bd6bb07f
...
@@ -10,8 +10,7 @@ const images = {
...
@@ -10,8 +10,7 @@ const images = {
* 节日元素
* 节日元素
*
*
*/
*/
export
class
FestivalEle
extends
eui
.
Component
{
export
class
FestivalEle
extends
egret
.
DisplayObjectContainer
{
private
showImage
:
eui
.
Image
;
/**
/**
* 是否要分裂了
* 是否要分裂了
*/
*/
...
@@ -25,52 +24,275 @@ export class FestivalEle extends eui.Component {
...
@@ -25,52 +24,275 @@ export class FestivalEle extends eui.Component {
}
}
set
statusNum
(
value
:
number
)
{
set
statusNum
(
value
:
number
)
{
if
(
value
>=
0
)
{
if
(
value
>=
0
)
{
//播放原来的动画
let
child
=
this
.
$children
[
this
.
_statusNum
];
child
[
"play"
](()
=>
{
//切换
this
.
toggleStatus
(
value
);
})
this
.
_statusNum
=
value
;
this
.
_statusNum
=
value
;
//播放动画,然后循环动画
// if (this.showImage.source != images[this._statusNum]) {
// this.changeSource(images[this._statusNum]);
// }
}
else
{
}
else
{
//不用动画
this
.
_statusNum
=
0
;
this
.
_statusNum
=
0
;
this
.
isActive
=
true
;
this
.
isActive
=
true
;
}
}
}
}
constructor
(
n
:
number
=
2
)
{
constructor
(
n
:
number
=
2
)
{
super
()
super
();
this
.
showImage
=
new
eui
.
Image
();
var
status3
=
new
Status3
();
this
.
addChild
(
this
.
showImage
)
this
.
addChild
(
status3
);
this
.
changeSource
(
images
[
n
]);
var
status2
=
new
Status2
();
this
.
addChild
(
status2
);
var
status1
=
new
Status1
();
this
.
addChild
(
status1
);
this
.
toggleStatus
(
n
);
this
.
isActive
=
false
;
this
.
isActive
=
false
;
this
.
_statusNum
=
n
;
this
.
_statusNum
=
n
;
}
}
changeSource
(
source
:
string
)
{
var
texture
:
egret
.
Texture
=
RES
.
getRes
(
source
);
this
.
showImage
.
texture
=
texture
this
.
showImage
.
anchorOffsetX
=
texture
.
textureWidth
/
2
;
this
.
showImage
.
anchorOffsetY
=
texture
.
textureHeight
/
2
+
20
;
this
.
showImage
.
y
=
20
}
shakeAni
()
{
this
.
showImage
.
rotation
=
0
;
egret
.
Tween
.
get
(
this
.
showImage
)
.
to
({
rotation
:
10
},
80
)
.
to
({
rotation
:
-
8
},
160
)
.
to
({
rotation
:
5
},
160
)
.
to
({
rotation
:
0
},
50
)
}
reset
(
n
:
number
=
2
)
{
reset
(
n
:
number
=
2
)
{
this
.
changeSource
(
images
[
n
]
);
this
.
toggleStatus
(
n
);
this
.
isActive
=
false
;
this
.
isActive
=
false
;
this
.
_statusNum
=
n
;
this
.
_statusNum
=
n
;
}
toggleStatus
(
index
:
number
)
{
for
(
var
i
=
0
;
i
<
this
.
$children
.
length
;
i
++
)
{
var
child
=
this
.
$children
[
i
];
if
(
i
==
index
)
{
child
.
visible
=
true
;
//重置状态
child
[
"reset"
]();
}
else
{
child
.
visible
=
false
;
}
}
}
}
}
//第一种状态
class
Status1
extends
egret
.
DisplayObjectContainer
{
upImage
:
egret
.
Bitmap
;
constructor
()
{
super
();
var
textureDown
:
egret
.
Texture
=
RES
.
getRes
(
"fesRedBombSta1_png"
)
var
down
=
new
egret
.
Bitmap
(
textureDown
);
down
.
x
=
-
textureDown
.
textureWidth
/
2
;
down
.
y
=
-
textureDown
.
textureHeight
/
2
;
this
.
addChild
(
down
);
var
textureUp
:
egret
.
Texture
=
RES
.
getRes
(
"xingxingbi_png"
);
var
up
=
new
egret
.
Bitmap
(
textureUp
);
up
.
anchorOffsetX
=
textureUp
.
textureWidth
/
2
;
up
.
anchorOffsetY
=
textureUp
.
textureHeight
/
2
;
up
.
y
=
textureUp
.
textureHeight
/
2
-
100
;
this
.
addChild
(
up
);
this
.
upImage
=
up
;
this
.
scaleX
=
this
.
scaleY
=
0.29
;
}
reset
()
{
this
.
upImage
.
scaleX
=
this
.
upImage
.
scaleY
=
1
;
}
play
(
callback
:
Function
)
{
egret
.
Tween
.
get
(
this
.
upImage
)
.
to
({
scaleX
:
1.8
,
scaleY
:
1.8
},
240
)
.
call
(()
=>
{
callback
();
})
}
}
const
status2Cfg
=
[
{
"name"
:
"fesRedCap"
,
"x"
:
-
7
,
"y"
:
-
6
,
"width"
:
251
,
"height"
:
104
},
{
"name"
:
"fesRedSmallLight"
,
"x"
:
-
7
,
"y"
:
-
14
,
"width"
:
249
,
"height"
:
159
},
{
"name"
:
"fesRedUp"
,
"x"
:
-
2
,
"y"
:
52
,
"width"
:
237
,
"height"
:
185
},
{
"name"
:
"fesRedDown"
,
"x"
:
-
2
,
"y"
:
0
,
"width"
:
237
,
"height"
:
237
}
]
//第二种状态
class
Status2
extends
egret
.
DisplayObjectContainer
{
light
:
egret
.
Bitmap
;
fesRedCap
:
egret
.
Bitmap
constructor
()
{
super
();
this
.
scaleX
=
this
.
scaleY
=
0.29
for
(
var
i
=
status2Cfg
.
length
-
1
;
i
>=
0
;
i
--
)
{
var
bitmap
=
new
egret
.
Bitmap
(
RES
.
getRes
(
status2Cfg
[
i
].
name
+
"_png"
));
bitmap
.
x
=
status2Cfg
[
i
].
x
-
237
/
2
;
bitmap
.
y
=
status2Cfg
[
i
].
y
-
237
/
2
;
this
.
addChild
(
bitmap
);
if
(
status2Cfg
[
i
].
name
==
"fesRedSmallLight"
)
{
this
.
light
=
bitmap
}
else
if
(
status2Cfg
[
i
].
name
==
"fesRedCap"
)
{
this
.
fesRedCap
=
bitmap
;
}
}
}
reset
()
{
this
.
fesRedCap
.
scaleY
=
1
;
this
.
light
.
alpha
=
1
;
egret
.
Tween
.
get
(
this
.
light
,
{
loop
:
true
})
.
to
({
alpha
:
0
},
450
)
.
to
({
alpha
:
1
},
450
)
}
play
(
callback
:
Function
)
{
this
.
light
.
alpha
=
0
;
egret
.
Tween
.
removeTweens
(
this
.
light
);
this
.
fesRedCap
.
scaleY
=
1
;
egret
.
Tween
.
get
(
this
.
fesRedCap
)
.
to
({
scaleY
:
0.1
},
180
)
.
call
(()
=>
{
callback
();
})
}
}
}
const
status3Cfg
=
[
{
"name"
:
"fesRedUp"
,
"x"
:
0
,
"y"
:
52
,
"width"
:
237
,
"height"
:
185
},
{
"name"
:
"tinyRedMid"
,
"x"
:
86
,
"y"
:
60
,
"width"
:
74
,
"height"
:
90
},
{
"name"
:
"tinyRedLeft"
,
"x"
:
22
,
"y"
:
5
,
"width"
:
116
,
"height"
:
132
},
{
"name"
:
"tinyRedRight"
,
"x"
:
123
,
"y"
:
14
,
"width"
:
89
,
"height"
:
106
},
{
"name"
:
"fesRedDown"
,
"x"
:
0
,
"y"
:
0
,
"width"
:
237
,
"height"
:
237
}
]
class
Status3
extends
egret
.
DisplayObjectContainer
{
midRed
:
egret
.
Bitmap
;
leftRed
:
egret
.
Bitmap
;
rightRed
:
egret
.
Bitmap
;
constructor
()
{
super
();
this
.
scaleX
=
this
.
scaleY
=
0.29
for
(
var
i
=
status3Cfg
.
length
-
1
;
i
>=
0
;
i
--
)
{
var
config
=
status3Cfg
[
i
];
var
bitmap
=
new
egret
.
Bitmap
(
RES
.
getRes
(
config
.
name
+
"_png"
));
bitmap
.
x
=
config
.
x
-
237
/
2
;
bitmap
.
y
=
config
.
y
-
237
/
2
;
this
.
addChild
(
bitmap
);
if
(
config
.
name
==
"tinyRedMid"
)
{
this
.
midRed
=
bitmap
;
}
else
if
(
config
.
name
==
"tinyRedLeft"
)
{
this
.
leftRed
=
bitmap
;
}
else
if
(
config
.
name
==
"tinyRedRight"
)
{
this
.
rightRed
=
bitmap
;
}
}
}
reset
()
{
egret
.
Tween
.
removeTweens
(
this
.
leftRed
);
egret
.
Tween
.
removeTweens
(
this
.
rightRed
);
egret
.
Tween
.
removeTweens
(
this
.
midRed
);
var
offset
=
237
/
2
//动画出来,然后循环
this
.
leftRed
.
x
=
22
+
40
-
offset
;
this
.
leftRed
.
y
=
5
+
100
-
offset
;
egret
.
Tween
.
get
(
this
.
leftRed
)
.
to
({
x
:
22
-
3
-
offset
,
y
:
5
-
8
-
offset
},
150
)
.
to
({
x
:
22
-
offset
,
y
:
5
-
offset
},
50
)
this
.
rightRed
.
x
=
123
-
7
-
offset
;
this
.
rightRed
.
y
=
14
+
100
-
offset
;
egret
.
Tween
.
get
(
this
.
rightRed
)
.
to
({
x
:
123
+
3
-
offset
,
y
:
14
-
8
-
offset
},
150
)
.
to
({
x
:
123
-
offset
,
y
:
14
-
offset
},
50
)
this
.
midRed
.
x
=
86
-
7
-
offset
;
this
.
midRed
.
y
=
60
+
80
-
offset
;
egret
.
Tween
.
get
(
this
.
midRed
)
.
to
({
x
:
86
+
3
-
offset
,
y
:
60
-
8
-
offset
},
150
)
.
to
({
x
:
86
-
offset
,
y
:
60
-
offset
},
50
)
.
call
(()
=>
{
//循环动画
this
.
leftRed
.
x
=
22
-
offset
;
this
.
leftRed
.
y
=
5
-
offset
;
egret
.
Tween
.
get
(
this
.
leftRed
,
{
loop
:
true
})
.
to
({
x
:
22
+
2
-
offset
,
y
:
5
+
5
-
offset
},
150
)
.
to
({
x
:
22
-
6
-
offset
,
y
:
5
-
14
-
offset
},
150
)
.
to
({
x
:
22
-
offset
,
y
:
5
-
offset
},
100
)
.
wait
(
500
);
this
.
rightRed
.
x
=
123
-
offset
;
this
.
rightRed
.
y
=
14
-
offset
;
egret
.
Tween
.
get
(
this
.
rightRed
,
{
loop
:
true
})
.
to
({
x
:
123
-
2
-
offset
,
y
:
14
+
5
-
offset
},
150
)
.
to
({
x
:
123
+
6
-
offset
,
y
:
14
-
14
-
offset
},
150
)
.
to
({
x
:
123
-
offset
,
y
:
14
-
offset
},
100
)
.
wait
(
500
);
// class
this
.
midRed
.
x
=
86
-
offset
;
\ No newline at end of file
this
.
midRed
.
y
=
60
-
offset
;
egret
.
Tween
.
get
(
this
.
midRed
,
{
loop
:
true
})
.
to
({
x
:
86
-
2
-
offset
,
y
:
60
+
5
-
offset
},
150
)
.
to
({
x
:
86
+
6
-
offset
,
y
:
60
-
14
-
offset
},
150
)
.
to
({
x
:
86
-
offset
,
y
:
60
-
offset
},
100
)
.
wait
(
500
);
})
}
play
(
callback
:
Function
)
{
}
}
\ No newline at end of file
egret/src/something/enum/RecoverName.ts
View file @
bd6bb07f
...
@@ -22,6 +22,7 @@ export enum RecoverName {
...
@@ -22,6 +22,7 @@ export enum RecoverName {
BUBBLE_ANI
=
"BubbleAni"
,
BUBBLE_ANI
=
"BubbleAni"
,
HAIRBALLBROWNDIVIDE_ANI
=
"HairballBrownDivideAni"
,
HAIRBALLBROWNDIVIDE_ANI
=
"HairballBrownDivideAni"
,
HAIRBALLJUMP_ANI
=
"HairballJumpAni"
,
//三种毛球是一样的动画
HAIRBALLJUMP_ANI
=
"HairballJumpAni"
,
//三种毛球是一样的动画
FESREDBOMBSHOW_ANI
=
"FesRedBombShowAni"
,
...
@@ -52,7 +53,6 @@ export enum RecoverName {
...
@@ -52,7 +53,6 @@ export enum RecoverName {
EGGBROKEN_ANI
=
"EggBrokenAni"
,
EGGBROKEN_ANI
=
"EggBrokenAni"
,
HAIRBALLGREYDIS_ANI
=
"HairballGreyDisAni"
,
HAIRBALLGREYDIS_ANI
=
"HairballGreyDisAni"
,
HAIRBALLBLACKDIS_ANI
=
"HairballBlackDisAni"
,
HAIRBALLBLACKDIS_ANI
=
"HairballBlackDisAni"
,
FESTIVALELESMALLDIS_ANI
=
"FestivalEleSmallDisAni"
,
//方形遮罩
//方形遮罩
RECT_MASK
=
"RectMask"
,
RECT_MASK
=
"RectMask"
,
...
...
egret/src/something/uis/FestivalTarget.ts
View file @
bd6bb07f
...
@@ -30,7 +30,7 @@ export class FestivalTarget extends egret.DisplayObjectContainer {
...
@@ -30,7 +30,7 @@ export class FestivalTarget extends egret.DisplayObjectContainer {
this
.
_count
=
value
;
this
.
_count
=
value
;
this
.
countNum
.
num
=
value
;
this
.
countNum
.
num
=
value
;
}
}
constructor
()
{
constructor
(
count
:
number
=
6
)
{
super
()
super
()
var
texture
:
egret
.
Texture
=
RES
.
getRes
(
"festivalTargetBg_png"
);
var
texture
:
egret
.
Texture
=
RES
.
getRes
(
"festivalTargetBg_png"
);
var
showImage
=
new
egret
.
Bitmap
(
texture
);
var
showImage
=
new
egret
.
Bitmap
(
texture
);
...
@@ -42,10 +42,10 @@ export class FestivalTarget extends egret.DisplayObjectContainer {
...
@@ -42,10 +42,10 @@ export class FestivalTarget extends egret.DisplayObjectContainer {
this
.
zeroMark
.
visible
=
false
;
this
.
zeroMark
.
visible
=
false
;
this
.
addChild
(
this
.
zeroMark
);
this
.
addChild
(
this
.
zeroMark
);
this
.
countNum
=
new
TargetNumber
();
this
.
countNum
=
new
TargetNumber
();
this
.
countNum
.
x
=
40
;
this
.
countNum
.
x
=
40
;
this
.
countNum
.
y
=
60
;
this
.
countNum
.
y
=
60
;
this
.
addChild
(
this
.
countNum
);
this
.
addChild
(
this
.
countNum
);
this
.
count
=
6
;
this
.
count
=
count
;
}
}
}
}
\ 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