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
02e8f760
Commit
02e8f760
authored
Oct 25, 2019
by
wjf
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev' of gitlab2.dui88.com:wanghongyuan/xiaoxiaole into dev
parents
2e1b1e16
cb6cf2a3
Changes
15
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
229 additions
and
204 deletions
+229
-204
MainBase.ts
egret/libs/new_wx/MainBase.ts
+12
-1
sceneTypes.ts
egret/libs/new_wx/types/sceneTypes.ts
+1
-0
hand.svga
egret/resource/assets/svgas/hand.svga
+0
-0
turntable.svga
egret/resource/assets/svgas/turntable.svga
+0
-0
default.thm.json
egret/resource/default.thm.json
+1
-0
H52Skin.exml
egret/resource/skins/H52Skin.exml
+6
-0
TurntableSkin.exml
egret/resource/skins/TurntableSkin.exml
+3
-2
CutTimer.ts
egret/src/CutTimer.ts
+1
-1
H52Scene.ts
egret/src/H52Scene.ts
+21
-0
MapScene.ts
egret/src/mapScene/MapScene.ts
+107
-113
IconBase.ts
egret/src/mapScene/icon/IconBase.ts
+7
-3
ScratchIcon.ts
egret/src/mapScene/icon/ScratchIcon.ts
+14
-2
TurntableIcon.ts
egret/src/mapScene/icon/TurntableIcon.ts
+36
-0
InvitePanel.ts
egret/src/panels/InvitePanel.ts
+1
-72
Turntable.ts
egret/src/panels/TurntablePanel/Turntable.ts
+19
-10
No files found.
egret/libs/new_wx/MainBase.ts
View file @
02e8f760
// tslint:disable: no-var-keyword
// tslint:disable: prefer-const
import
{
loadSvga
}
from
"../../src/loadSvga"
;
import
MainScene
from
"../../src/mainScene/MainScene"
;
import
MapScene
from
"../../src/mapScene/MapScene"
;
...
...
@@ -56,6 +57,7 @@ import ScratchPanel from "../../src/panels/ScratchPanel";
import
ScratchPrizePanel
from
"../../src/panels/ScratchPrizePanel"
;
import
Turntable
from
"../../src/panels/TurntablePanel/Turntable"
;
import
BagQuitPanel
from
"../../src/panels/BagQuitPanel"
;
import
H52Scene
from
"../../src/H52Scene"
;
export
default
class
MainBase
extends
eui
.
UILayer
{
constructor
()
{
...
...
@@ -108,6 +110,7 @@ export default class MainBase extends eui.UILayer {
const
scenes
=
[
[
ModuleTypes
.
INVITE_SCENE
,
{
cls
:
H5Scene
}],
[
ModuleTypes
.
INVITE_SCENE2
,
{
cls
:
H52Scene
}],
[
ModuleTypes
.
START_SCENE
,
{
cls
:
StartScene
}],
[
ModuleTypes
.
MAP_SCENE
,
{
cls
:
MapScene
}],
[
ModuleTypes
.
PLAY_SCENE
,
{
cls
:
PlayScene
}],
...
...
@@ -168,6 +171,7 @@ export default class MainBase extends eui.UILayer {
})
}
// tslint:disable-next-line: cyclomatic-complexity
private
async
runGame
()
{
await
this
.
loadResource
();
RES
.
getResAsync
(
'mapBg_mp3'
);
...
...
@@ -186,6 +190,7 @@ export default class MainBase extends eui.UILayer {
else
{
RES
.
getResAsync
(
'main_mapbottom_png'
);
RES
.
getResAsync
(
'lightani_png'
);
for
(
var
i
=
1
;
i
<
19
;
i
++
)
{
RES
.
getResAsync
(
"boom"
+
i
+
"_png"
)
}
...
...
@@ -224,6 +229,7 @@ export default class MainBase extends eui.UILayer {
for
(
var
i
=
1
;
i
<=
11
;
i
++
)
{
RES
.
getResAsync
(
"stepAni"
+
i
+
"_png"
)
}
var
aaa
=
[
1
,
3
,
5
,
7
,
9
,
11
,
14
,
16
,
18
,
19
,
21
,
23
,
25
,
27
,
29
,
32
,
34
];
for
(
var
i
=
1
;
i
<=
60
;
i
++
)
{
if
(
aaa
.
indexOf
(
i
)
>=
0
)
{
...
...
@@ -301,6 +307,10 @@ export default class MainBase extends eui.UILayer {
this
.
ajaxElement
().
then
(()
=>
{
SceneCtrl
.
instance
.
change
(
ModuleTypes
.
INVITE_SCENE
);
})
}
else
if
(
window
[
'isInvitePage'
]
==
2
)
{
this
.
ajaxElement
().
then
(()
=>
{
SceneCtrl
.
instance
.
change
(
ModuleTypes
.
INVITE_SCENE2
);
})
}
else
this
.
createGameScene
();
...
...
@@ -317,6 +327,7 @@ export default class MainBase extends eui.UILayer {
]);
loadSvga
(
getResPath
()
+
'resource/assets/svgas/box.svga'
);
loadSvga
(
getResPath
()
+
'resource/assets/svgas/invite.svga'
);
loadSvga
(
getResPath
()
+
'resource/assets/svgas/turntable.svga'
);
}
catch
(
e
)
{
console
.
error
(
e
);
...
...
egret/libs/new_wx/types/sceneTypes.ts
View file @
02e8f760
export
enum
ModuleTypes
{
INVITE_SCENE
,
INVITE_SCENE2
,
START_SCENE
,
MAP_SCENE
,
PLAY_SCENE
,
...
...
egret/resource/assets/svgas/hand.svga
0 → 100644
View file @
02e8f760
File added
egret/resource/assets/svgas/turntable.svga
0 → 100644
View file @
02e8f760
File added
egret/resource/default.thm.json
View file @
02e8f760
...
...
@@ -27,6 +27,7 @@
"resource/skins/FriendShareSkin.exml"
,
"resource/skins/FriendSkin.exml"
,
"resource/skins/H5Skin.exml"
,
"resource/skins/H52Skin.exml"
,
"resource/skins/IconButtonSkin.exml"
,
"resource/skins/InviteCutTimePanelSkin.exml"
,
"resource/skins/InviteItemSkin.exml"
,
...
...
egret/resource/skins/H52Skin.exml
0 → 100644
View file @
02e8f760
<?xml version="1.0" encoding="utf-8"?>
<e:Skin
class=
"H52Skin"
width=
"750"
height=
"1206"
xmlns:e=
"http://ns.egret.com/eui"
xmlns:w=
"http://ns.egret.com/wing"
>
<e:Image
source=
"invitebg_jpg"
/>
<e:Image
id=
"gobtn"
source=
"h5_gobtn_png"
y=
"995"
horizontalCenter=
"0"
/>
<e:Image
id=
"rulebtn"
source=
"h5btn_png"
y=
"954"
horizontalCenter=
"0"
visible=
"false"
/>
</e:Skin>
\ No newline at end of file
egret/resource/skins/TurntableSkin.exml
View file @
02e8f760
<?xml version="1.0" encoding="utf-8"?>
<e:Skin
class=
"LoadingSceneSkin"
width=
"750"
height=
"1624"
xmlns:e=
"http://ns.egret.com/eui"
xmlns:w=
"http://ns.egret.com/wing"
>
<e:Group
id=
"container"
y=
"-45.45"
x=
"-3"
/>
<e:Image
scaleX=
"1"
scaleY=
"1"
y=
"73.35"
horizontalCenter=
"0"
source=
""
/>
<e:Group
horizontalCenter=
"0"
verticalCenter=
"-190"
touchEnabled=
"false"
>
<e:Image
scaleX=
"1"
scaleY=
"1"
horizontalCenter=
"0"
verticalCenter=
"0"
source=
"turntable_bg_png"
/>
<e:Group
id=
"panel"
anchorOffsetX=
"253.5"
anchorOffsetY=
"253.5"
rotation=
"0"
horizontalCenter=
"0"
verticalCenter=
"0"
width=
"507"
height=
"507"
>
<e:Image
scaleX=
"1"
scaleY=
"1"
anchorOffsetX=
"253.5"
anchorOffsetY=
"253.5"
rotation=
"0"
horizontalCenter=
"0"
verticalCenter=
"0"
source=
"turntable_panel_png"
/>
<e:Group
id=
"prize0"
y=
"-10"
x=
"179"
>
...
...
@@ -33,7 +33,7 @@
<e:Button
id=
"start_btn"
label=
""
anchorOffsetX=
"93"
anchorOffsetY=
"140"
horizontalCenter=
"0"
verticalCenter=
"-25"
>
</e:Button>
</e:Group>
<e:Button
id=
"closeBtn"
label=
""
y=
"
135.31
"
x=
"565.89"
>
<e:Button
id=
"closeBtn"
label=
""
y=
"
292.88
"
x=
"565.89"
>
<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"
/>
...
...
@@ -41,4 +41,5 @@
</e:Skin>
</e:skinName>
</e:Button>
<e:Group
id=
"container2"
/>
</e:Skin>
\ No newline at end of file
egret/src/CutTimer.ts
View file @
02e8f760
/**
* 简单的倒计时
*
2019.10.
24
*
Created by haiyoucuv on 2019/10/
24
*/
export
default
class
CutTimer
{
private
_timer
:
egret
.
Timer
=
null
;
...
...
egret/src/H52Scene.ts
0 → 100644
View file @
02e8f760
import
Scene
from
"../libs/new_wx/components/Scene"
;
import
Utils
from
"./Utils"
;
import
PanelCtrl
from
"../libs/new_wx/ctrls/panelCtrl"
;
export
default
class
H52Scene
extends
Scene
{
async
start
(
data
?)
{
super
.
start
();
// this['rulebtn'].addEventListener(egret.TouchEvent.TOUCH_TAP,()=>{
// PanelCtrl.instance.show('inviterule')
// },this);
this
[
'gobtn'
].
addEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,()
=>
{
const
code
=
Utils
.
getRequestByKey
(
'shareCode2'
);
window
.
location
.
href
=
`
${
window
[
'targetUrl'
]}
&shareCode2=
${
code
}
`
},
this
);
}
get
skinKey
()
{
return
'H52'
}
}
egret/src/mapScene/MapScene.ts
View file @
02e8f760
This diff is collapsed.
Click to expand it.
egret/src/mapScene/icon/IconBase.ts
View file @
02e8f760
/**
* 地图页图标基类
*
2019.10.24
*
Created by haiyoucuv on 2019/10/25
*/
export
default
class
IconBase
{
private
iconGroup
:
eui
.
Group
;
...
...
@@ -14,12 +14,16 @@ export default class IconBase{
}
constructor
(
name
:
string
,
group
:
eui
.
Group
,
btn
:
eui
.
Button
,
tipsBg
:
eui
.
Image
,
tipsLabel
:
eui
.
Label
){
constructor
(
name
:
string
,
group
:
eui
.
Group
,
btn
:
eui
.
Button
,
tipsBg
?:
eui
.
Image
,
tipsLabel
?
:
eui
.
Label
){
this
.
iconGroup
=
group
;
this
.
iconBtn
=
btn
;
this
.
iconTipsBg
=
tipsBg
;
this
.
iconTips
=
tipsLabel
;
this
.
_name
=
name
;
this
.
start
();
}
protected
start
(){
this
.
initEvents
();
}
...
...
@@ -28,7 +32,7 @@ export default class IconBase{
}
protected
onTouchBtn
(
e
:
egret
.
TouchEvent
){
console
.
log
(
"基类"
);
}
protected
removeEvents
(){
...
...
egret/src/mapScene/icon/ScratchIcon.ts
View file @
02e8f760
import
IconBase
from
"./IconBase"
;
import
{
NetManager
}
from
"../../../libs/tw/manager/NetManager"
;
import
PanelCtrl
from
"../../../libs/new_wx/ctrls/panelCtrl"
;
export
default
class
ScratchIcon
extends
IconBase
{
constructor
(
name
:
string
,
group
:
eui
.
Group
,
btn
:
eui
.
Button
,
tipsBg
:
eui
.
Image
,
tipsLabel
:
eui
.
Label
)
{
constructor
(
name
:
string
,
group
:
eui
.
Group
,
btn
:
eui
.
Button
,
tipsBg
?:
eui
.
Image
,
tipsLabel
?
:
eui
.
Label
)
{
super
(
name
,
group
,
btn
,
tipsBg
,
tipsLabel
);
}
protected
start
()
{
super
.
start
();
}
protected
initEvents
()
{
super
.
initEvents
();
}
protected
onTouchBtn
(
e
:
egret
.
TouchEvent
)
{
super
.
onTouchBtn
(
e
);
console
.
log
(
"子类"
);
NetManager
.
ins
.
getInviteInfo
((
success
,
res
)
=>
{
if
(
!
success
)
{
return
;
}
PanelCtrl
.
instance
.
show
(
'scratch'
,
res
.
data
);
});
}
protected
removeEvents
()
{
...
...
egret/src/mapScene/icon/TurntableIcon.ts
0 → 100644
View file @
02e8f760
import
IconBase
from
"./IconBase"
;
import
{
NetManager
}
from
"../../../libs/tw/manager/NetManager"
;
import
PanelCtrl
from
"../../../libs/new_wx/ctrls/panelCtrl"
;
import
{
loadTurntableSvga
}
from
"../../panels/TurntablePanel/Turntable"
;
export
default
class
TurntableIcon
extends
IconBase
{
constructor
(
name
:
string
,
group
:
eui
.
Group
,
btn
:
eui
.
Button
,
tipsBg
?:
eui
.
Image
,
tipsLabel
?:
eui
.
Label
)
{
super
(
name
,
group
,
btn
,
tipsBg
,
tipsLabel
);
}
protected
start
()
{
super
.
start
();
}
protected
initEvents
()
{
super
.
initEvents
();
}
protected
onTouchBtn
(
e
:
egret
.
TouchEvent
)
{
super
.
onTouchBtn
(
e
);
loadTurntableSvga
((
mv
)
=>
{
PanelCtrl
.
instance
.
show
(
'turnTable'
,
{
mv
:
mv
})
})
}
protected
removeEvents
()
{
super
.
removeEvents
();
}
protected
destory
()
{
super
.
destory
();
}
}
\ No newline at end of file
egret/src/panels/InvitePanel.ts
View file @
02e8f760
...
...
@@ -215,74 +215,3 @@ class InviteItem extends eui.ItemRenderer {
},
this
);
}
}
\ No newline at end of file
// ////////////////////////////////////////////////////////////////////////////////////////////////
// // 端内分享提示
// class ShareTips extends ComponentBase {
// public inviteGroup: eui.Group;
// public btn1: eui.Button;
// public btn2: eui.Button;
//
// private img: string;
//
// setUrl(img: string) {
// this.img = img;
// }
//
// start() {
// this.once(egret.TouchEvent.ADDED_TO_STAGE, () => {
// this.height = this.stage.stageHeight;
// }, this);
//
// this.addEventListener(egret.TouchEvent.TOUCH_TAP, () => {
// hideShare();
// }, this);
//
// this.btn1.addEventListener(egret.TouchEvent.TOUCH_TAP, () => {
// this.getFunc();//朋友圈
// hideShare();
// }, this);
//
// this.btn2.addEventListener(egret.TouchEvent.TOUCH_TAP, () => {
// this.getFunc();//朋友圈
// hideShare();
// }, this);
// }
//
// getFunc() {
// NetManager.ins.getShareCode((success, res) => {
// if(!success) {
// return;
// }
// if(iswx()) { //微信端
//
// } else {//端内
// window["inviteShare"](res.data);
// }
// });
// }
//
// get skinKey() {
// return 'ShareTips';
// }
// }
//
// let inited = false;
// let _share: ShareTips;
// const initShare = () => {
// const layer = layers.shareLayer;
// const share = new ShareTips();
// share.loadSkin();
// share.start();
// layer.addChild(share);
// _share = share;
// };
//
// const showShareTips = (url: string) => {
// if(!inited) {
// initShare();
// inited = true;
// }
// _share.setUrl(url);
// layers.shareLayer.visible = true;
// };
\ No newline at end of file
egret/src/panels/TurntablePanel/Turntable.ts
View file @
02e8f760
...
...
@@ -10,11 +10,19 @@ import submit from "../../../libs/new_tw/ctrls/submit";
import
Loading
from
"../../../libs/new_wx/components/Loading"
;
import
{
NetManager
}
from
"../../../libs/tw/manager/NetManager"
;
import
Utils
from
"../../Utils"
;
import
{
loadSvga
}
from
"../../loadSvga"
;
import
getResPath
from
"../../../libs/new_tc/getResPath"
;
import
wait
from
"../../../libs/new_tc/wait"
;
export
const
loadTurntableSvga
=
(
callback
)
=>
{
loadSvga
(
getResPath
()
+
'resource/assets/svgas/turntable.svga'
).
then
(
async
(
mv
:
any
)
=>
{
await
wait
(
100
);
callback
(
mv
);
})
}
export
default
class
Turntable
extends
Panel
{
public
panel
:
eui
.
Group
;
public
start_btn
:
eui
.
Button
;
public
closeBtn
:
eui
.
Button
;
public
panel
:
eui
.
Group
;
public
start_btn
:
eui
.
Button
;
public
closeBtn
:
eui
.
Button
;
public
get
skinKey
()
{
return
'Turntable'
...
...
@@ -24,10 +32,11 @@ export default class Turntable extends Panel {
super
();
this
.
data
=
data
;
}
start
(
data
?)
{
hand
;
async
start
(
data
?)
{
super
.
start
();
this
[
'container'
].
addChild
(
this
.
data
.
mv
);
this
.
hand
=
await
loadSvga
(
getResPath
()
+
'resource/assets/svgas/hand.svga'
,
this
[
'container2'
])
}
initEvents
()
{
...
...
@@ -129,7 +138,7 @@ export default class Turntable extends Panel {
*/
private
rotate
(
rotation
:
number
,
time
:
number
,
callFun
:
Function
)
{
let
tw
=
egret
.
Tween
.
get
(
this
.
panel
);
tw
.
to
({
rotation
:
rotation
},
time
,
egret
.
Ease
.
cubicInOut
).
wait
(
500
).
call
(
callFun
);
tw
.
to
({
rotation
:
rotation
},
time
,
egret
.
Ease
.
cubicInOut
).
wait
(
500
).
call
(
callFun
);
}
protected
onSkinComplete
():
void
{
...
...
@@ -151,14 +160,14 @@ export default class Turntable extends Panel {
}
private
panelEffect
()
{
egret
.
Tween
.
get
(
this
.
panel
).
to
({
rotation
:
360
},
20000
).
call
(()
=>
{
egret
.
Tween
.
get
(
this
.
panel
).
to
({
rotation
:
360
},
20000
).
call
(()
=>
{
this
.
panelEffect
();
});
}
protected
async
preLoadRes
()
{
return
new
Promise
(
function
(
resolve
,
reject
)
{
return
new
Promise
(
function
(
resolve
,
reject
)
{
resolve
();
});
}
...
...
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