Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
db-game-template
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
崔立强
db-game-template
Commits
693f1945
Commit
693f1945
authored
Feb 19, 2019
by
wildfirecode
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
38c5f54d
Changes
31
Hide whitespace changes
Inline
Side-by-side
Showing
31 changed files
with
152 additions
and
51 deletions
+152
-51
.DS_Store
egret/.DS_Store
+0
-0
index.html
egret/index.html
+1
-1
Alert.ts
egret/libs/new_wx/components/Alert.ts
+4
-2
Panel.ts
egret/libs/new_wx/components/Panel.ts
+2
-0
panelCtrl.ts
egret/libs/new_wx/ctrls/panelCtrl.ts
+2
-1
common.tmproject
egret/resource/TextureMerger/common.tmproject
+0
-1
noprize.tmproject
egret/resource/TextureMerger/noprize.tmproject
+0
-1
play.tmproject
egret/resource/TextureMerger/play.tmproject
+0
-1
prize.tmproject
egret/resource/TextureMerger/prize.tmproject
+0
-1
rank.tmproject
egret/resource/TextureMerger/rank.tmproject
+0
-1
rule.tmproject
egret/resource/TextureMerger/rule.tmproject
+0
-1
start.tmproject
egret/resource/TextureMerger/start.tmproject
+0
-1
closeCommonBtn.png
egret/resource/assets/common/closeCommonBtn.png
+0
-0
shootline.png
egret/resource/assets/playscene/shootline.png
+0
-0
closeBtn.png
egret/resource/assets/rank/closeBtn.png
+0
-0
bg.mp3
egret/resource/assets/sounds/bg.mp3
+0
-0
bounce.mp3
egret/resource/assets/sounds/bounce.mp3
+0
-0
click.mp3
egret/resource/assets/sounds/click.mp3
+0
-0
good.mp3
egret/resource/assets/sounds/good.mp3
+0
-0
recover.mp3
egret/resource/assets/sounds/recover.mp3
+0
-0
shoot.mp3
egret/resource/assets/sounds/shoot.mp3
+0
-0
default.res.json
egret/resource/default.res.json
+47
-18
NoPrizeSkin.exml
egret/resource/skins/NoPrizeSkin.exml
+3
-3
PlaySkin.exml
egret/resource/skins/PlaySkin.exml
+2
-2
RankItemSkin.exml
egret/resource/skins/RankItemSkin.exml
+1
-1
RankSkin.exml
egret/resource/skins/RankSkin.exml
+1
-1
ReliveSkin.exml
egret/resource/skins/ReliveSkin.exml
+1
-1
StartSkin.exml
egret/resource/skins/StartSkin.exml
+5
-5
PlayScene.ts
egret/src/playScene/PlayScene.ts
+29
-0
soundCtrl.ts
egret/src/soundCtrl.ts
+46
-0
StartScene.ts
egret/src/startScene/StartScene.ts
+8
-9
No files found.
egret/.DS_Store
View file @
693f1945
No preview for this file type
egret/index.html
View file @
693f1945
...
@@ -42,7 +42,7 @@
...
@@ -42,7 +42,7 @@
<script
src=
"libs/security.js"
></script>
<script
src=
"libs/security.js"
></script>
<script
src=
"libs/downloadApp.js"
></script>
<script
src=
"libs/downloadApp.js"
></script>
<script>
<script>
window
[
'numsP'
]
=
1
;
window
[
'numsP'
]
=
.
1
;
// window['debugPhysics']=true;
// window['debugPhysics']=true;
window
[
'renderMode'
]
=
'webgl'
;
window
[
'renderMode'
]
=
'webgl'
;
window
[
'development'
]
=
true
;
window
[
'development'
]
=
true
;
...
...
egret/libs/new_wx/components/Alert.ts
View file @
693f1945
...
@@ -9,13 +9,15 @@ export default class Alert extends Panel {
...
@@ -9,13 +9,15 @@ export default class Alert extends Panel {
this
.
data
.
btnTxt
=
btnTxt
||
'确定'
;
this
.
data
.
btnTxt
=
btnTxt
||
'确定'
;
}
}
get
skinKey
()
{
return
'Alert'
}
get
skinKey
()
{
return
'Alert'
}
get
skinResKey
()
{
return
'common'
}
protected
get
closeBtns
():
eui
.
Button
[]
{
protected
get
closeBtns
():
eui
.
Button
[]
{
return
[
this
[
'closeBtn'
]]
return
[
this
[
'closeBtn'
]]
}
}
hidePanel
(){
hidePanel
()
{
super
.
hidePanel
();
super
.
hidePanel
();
SceneCtrl
.
instance
.
change
(
ModuleTypes
.
START_SCENE
);
SceneCtrl
.
instance
.
change
(
ModuleTypes
.
START_SCENE
);
}
}
...
...
egret/libs/new_wx/components/Panel.ts
View file @
693f1945
...
@@ -5,6 +5,8 @@ export default class Panel extends ComponentBase {
...
@@ -5,6 +5,8 @@ export default class Panel extends ComponentBase {
super
();
super
();
}
}
get
skinResKey
(){
return
null
}
initEvents
()
{
initEvents
()
{
this
.
closeBtns
.
forEach
(
this
.
closeBtns
.
forEach
(
btn
=>
{
if
(
btn
)
btn
.
addEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
onTouchTap_closeBtn
,
this
)
}
btn
=>
{
if
(
btn
)
btn
.
addEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
onTouchTap_closeBtn
,
this
)
}
...
...
egret/libs/new_wx/ctrls/panelCtrl.ts
View file @
693f1945
...
@@ -21,7 +21,8 @@ export default class PanelCtrl {
...
@@ -21,7 +21,8 @@ export default class PanelCtrl {
if
(
!
window
[
'development'
])
{
if
(
!
window
[
'development'
])
{
Loading
.
instace
.
show
();
Loading
.
instace
.
show
();
const
key
=
panel
.
skinKey
.
toLowerCase
();
const
key
=
panel
.
skinKey
.
toLowerCase
();
const
p
=
Promise
.
all
([
RES
.
getResAsync
(
`
${
key
}
_json`
),
RES
.
getResAsync
(
`
${
key
}
_png`
)]);
const
reskey
=
panel
.
skinResKey
||
key
;
const
p
=
Promise
.
all
([
RES
.
getResAsync
(
`
${
reskey
}
_json`
),
RES
.
getResAsync
(
`
${
reskey
}
_png`
)]);
p
.
then
(()
=>
{
p
.
then
(()
=>
{
Loading
.
instace
.
hide
();
Loading
.
instace
.
hide
();
this
.
showAfterLoadAtlas
(
panel
,
data
);
this
.
showAfterLoadAtlas
(
panel
,
data
);
...
...
egret/resource/TextureMerger/common.tmproject
deleted
100644 → 0
View file @
38c5f54d
{"options":{"layoutMath":"2","sizeMode":"2n","useExtension":1,"layoutGap":1,"extend":0},"projectName":"common","version":5,"files":["../assets/common/alertbg.png","../assets/common/closeBtn.png"]}
\ No newline at end of file
egret/resource/TextureMerger/noprize.tmproject
deleted
100644 → 0
View file @
38c5f54d
{"options":{"layoutMath":"2","sizeMode":"2n","useExtension":1,"layoutGap":1,"extend":0},"projectName":"noprize","version":5,"files":["../assets/nprize/得分- 无发券.png","../assets/nprize/再来一次.png"]}
\ No newline at end of file
egret/resource/TextureMerger/play.tmproject
deleted
100644 → 0
View file @
38c5f54d
{"options":{"layoutMath":"2","sizeMode":"2n","useExtension":1,"layoutGap":1,"extend":0},"projectName":"play","version":5,"files":["../assets/playscene/tri2.png","../assets/playscene/tri1.png","../assets/playscene/testbtn.png","../assets/playscene/sq4.png","../assets/playscene/sq3.png","../assets/playscene/sq2.png","../assets/playscene/sq1.png","../assets/playscene/line.png","../assets/playscene/door.png","../assets/playscene/circle1.png","../assets/playscene/ball.png","../assets/playscene/引导.png","../assets/playscene/音乐开启.png","../assets/playscene/音乐关闭.png","../assets/playscene/炮.png","../assets/playscene/风扇1.png","../assets/playscene/风扇.png","../assets/playscene/地.png","../assets/playscene/+1.png"]}
\ No newline at end of file
egret/resource/TextureMerger/prize.tmproject
deleted
100644 → 0
View file @
38c5f54d
{"options":{"layoutMath":"2","sizeMode":"2n","useExtension":1,"layoutGap":1,"extend":0},"projectName":"prize","version":5,"files":["../assets/prize/prizePanelbg.png","../assets/prize/PrizePanelX.png","../assets/prize/prizePanelUseBtn.png"]}
\ No newline at end of file
egret/resource/TextureMerger/rank.tmproject
deleted
100644 → 0
View file @
38c5f54d
{"options":{"layoutMath":"2","sizeMode":"2n","useExtension":1,"layoutGap":1,"extend":0},"projectName":"rank","version":5,"files":["../assets/rank/userItemBg.png","../assets/rank/rankTitle.png","../assets/rank/num3.png","../assets/rank/num2.png","../assets/rank/num1.png","../assets/rank/dog.png","../assets/rank/commonPanelBg.png","../assets/rank/closeBtn.png","../assets/rank/bottomLine.png"]}
\ No newline at end of file
egret/resource/TextureMerger/rule.tmproject
deleted
100644 → 0
View file @
38c5f54d
{"options":{"layoutMath":"2","sizeMode":"2n","useExtension":1,"layoutGap":1,"extend":0},"projectName":"rule","version":5,"files":["../assets/rule/X.png","../assets/rule/ruleBg.png"]}
\ No newline at end of file
egret/resource/TextureMerger/start.tmproject
deleted
100644 → 0
View file @
38c5f54d
{"options":{"layoutMath":"2","sizeMode":"2n","useExtension":1,"layoutGap":1,"extend":0},"projectName":"start","version":5,"files":["../assets/startScene/大标.png","../assets/startScene/地 拷贝.png","../assets/startScene/球.png","../assets/startScene/三角 拷贝 2.png","../assets/startScene/三角 拷贝.png","../assets/startScene/圆 拷贝.png","../assets/startScene/正方形 拷贝 2.png","../assets/startScene/正方形 拷贝.png","../assets/startScene/optionBtn.png","../assets/startScene/rankBtn.png","../assets/startScene/recordbtn.png","../assets/startScene/ruleBtn.png","../assets/startScene/start_btn_gray.png","../assets/startScene/start_btn.png"]}
\ No newline at end of file
egret/resource/assets/common/closeBtn.png
→
egret/resource/assets/common/close
Common
Btn.png
View file @
693f1945
File moved
egret/resource/assets/playscene/line.png
→
egret/resource/assets/playscene/
shoot
line.png
View file @
693f1945
File moved
egret/resource/assets/rank/closeBtn.png
deleted
100644 → 0
View file @
38c5f54d
2.31 KB
egret/resource/assets/sounds/bg.mp3
0 → 100644
View file @
693f1945
File added
egret/resource/assets/sounds/bounce.mp3
0 → 100644
View file @
693f1945
File added
egret/resource/assets/sounds/click.mp3
0 → 100644
View file @
693f1945
File added
egret/resource/assets/sounds/good.mp3
0 → 100644
View file @
693f1945
File added
egret/resource/assets/sounds/recover.mp3
0 → 100644
View file @
693f1945
File added
egret/resource/assets/sounds/shoot.mp3
0 → 100644
View file @
693f1945
File added
egret/resource/default.res.json
View file @
693f1945
...
@@ -9,11 +9,11 @@
...
@@ -9,11 +9,11 @@
"name"
:
"prize"
"name"
:
"prize"
},
},
{
{
"keys"
:
"tri2_png,tri1_png,testbtn_png,sq4_png,sq3_png,sq2_png,sq1_png,playscenebg_jpg,
line3_png,door_png,circle1_png,ball_png,引导_png,音乐开启_png,音乐关闭_png,炮_png,风扇1_png,风扇_png,地_png,+1
_png"
,
"keys"
:
"tri2_png,tri1_png,testbtn_png,sq4_png,sq3_png,sq2_png,sq1_png,playscenebg_jpg,
door_png,circle1_png,ball_png,引导_png,音乐开启_png,音乐关闭_png,炮_png,风扇1_png,风扇_png,地_png,+1_png,shootline
_png"
,
"name"
:
"play"
"name"
:
"play"
},
},
{
{
"keys"
:
"userItemBg_png,rankTitle_png,num3_png,num2_png,num1_png,dog_png,commonPanelBg_png,
closeBtn_png,
bottomLine_png"
,
"keys"
:
"userItemBg_png,rankTitle_png,num3_png,num2_png,num1_png,dog_png,commonPanelBg_png,bottomLine_png"
,
"name"
:
"rank"
"name"
:
"rank"
},
},
{
{
...
@@ -21,12 +21,16 @@
...
@@ -21,12 +21,16 @@
"name"
:
"rule"
"name"
:
"rule"
},
},
{
{
"keys"
:
"alertbg_png,close
Btn2
_png"
,
"keys"
:
"alertbg_png,close
CommonBtn
_png"
,
"name"
:
"common"
"name"
:
"common"
},
},
{
{
"keys"
:
"得分- 无发券_png,再来一次_png"
,
"keys"
:
"得分- 无发券_png,再来一次_png"
,
"name"
:
"noprize"
"name"
:
"noprize"
},
{
"keys"
:
"relivebtn_png,relivebg_png"
,
"name"
:
"relive"
}
}
],
],
"resources"
:
[
"resources"
:
[
...
@@ -150,11 +154,6 @@
...
@@ -150,11 +154,6 @@
"type"
:
"image"
,
"type"
:
"image"
,
"name"
:
"userItemBg_png"
"name"
:
"userItemBg_png"
},
},
{
"url"
:
"assets/rank/closeBtn.png"
,
"type"
:
"image"
,
"name"
:
"closeBtn_png"
},
{
{
"url"
:
"assets/rank/dog.png"
,
"url"
:
"assets/rank/dog.png"
,
"type"
:
"image"
,
"type"
:
"image"
,
...
@@ -245,11 +244,6 @@
...
@@ -245,11 +244,6 @@
"type"
:
"image"
,
"type"
:
"image"
,
"name"
:
"风扇1_png"
"name"
:
"风扇1_png"
},
},
{
"url"
:
"assets/playscene/line.png"
,
"type"
:
"image"
,
"name"
:
"line3_png"
},
{
{
"url"
:
"assets/startScene/地 拷贝.png"
,
"url"
:
"assets/startScene/地 拷贝.png"
,
"type"
:
"image"
,
"type"
:
"image"
,
...
@@ -300,11 +294,6 @@
...
@@ -300,11 +294,6 @@
"type"
:
"image"
,
"type"
:
"image"
,
"name"
:
"relivebtn_png"
"name"
:
"relivebtn_png"
},
},
{
"url"
:
"assets/common/closeBtn.png"
,
"type"
:
"image"
,
"name"
:
"closeBtn2_png"
},
{
{
"url"
:
"assets/relive/relivebg.png"
,
"url"
:
"assets/relive/relivebg.png"
,
"type"
:
"image"
,
"type"
:
"image"
,
...
@@ -324,6 +313,46 @@
...
@@ -324,6 +313,46 @@
"url"
:
"assets/nprize/得分- 无发券.png"
,
"url"
:
"assets/nprize/得分- 无发券.png"
,
"type"
:
"image"
,
"type"
:
"image"
,
"name"
:
"得分- 无发券_png"
"name"
:
"得分- 无发券_png"
},
{
"url"
:
"assets/sounds/bg.mp3"
,
"type"
:
"sound"
,
"name"
:
"bg_mp3"
},
{
"url"
:
"assets/sounds/bounce.mp3"
,
"type"
:
"sound"
,
"name"
:
"bounce_mp3"
},
{
"url"
:
"assets/sounds/good.mp3"
,
"type"
:
"sound"
,
"name"
:
"good_mp3"
},
{
"url"
:
"assets/sounds/shoot.mp3"
,
"type"
:
"sound"
,
"name"
:
"shoot_mp3"
},
{
"url"
:
"assets/sounds/recover.mp3"
,
"type"
:
"sound"
,
"name"
:
"recover_mp3"
},
{
"url"
:
"assets/sounds/click.mp3"
,
"type"
:
"sound"
,
"name"
:
"click_mp3"
},
{
"url"
:
"assets/common/closeCommonBtn.png"
,
"type"
:
"image"
,
"name"
:
"closeCommonBtn_png"
},
{
"url"
:
"assets/playscene/shootline.png"
,
"type"
:
"image"
,
"name"
:
"shootline_png"
}
}
]
]
}
}
\ No newline at end of file
egret/resource/skins/NoPrizeSkin.exml
View file @
693f1945
...
@@ -3,10 +3,10 @@
...
@@ -3,10 +3,10 @@
<e:Image
source=
"得分- 无发券_png"
y=
"221.55"
horizontalCenter=
"0"
/>
<e:Image
source=
"得分- 无发券_png"
y=
"221.55"
horizontalCenter=
"0"
/>
<e:Button
id=
"closeBtn"
label=
""
x=
"622"
y=
"200"
>
<e:Button
id=
"closeBtn"
label=
""
x=
"622"
y=
"200"
>
<e:skinName>
<e:skinName>
<e:Skin
states=
"up,down,disabled"
>
<e:Skin
states=
"up,down,disabled"
>
<e:Image
width=
"100%"
height=
"100%"
source=
"close
Btn2_png"
source.down=
"closeBtn2_png"
source.disabled=
"closeBtn2
_png"
/>
<e:Image
width=
"100%"
height=
"100%"
source=
"close
CommonBtn_png"
source.down=
"closeCommonBtn_png"
source.disabled=
"closeCommonBtn
_png"
/>
<e:Label
id=
"labelDisplay"
horizontalCenter=
"0"
verticalCenter=
"0"
/>
<e:Label
id=
"labelDisplay"
horizontalCenter=
"0"
verticalCenter=
"0"
/>
</e:Skin>
</e:Skin>
</e:skinName>
</e:skinName>
</e:Button>
</e:Button>
<e:Button
id=
"onceAgainBtn"
label=
""
y=
"478"
horizontalCenter=
"0"
>
<e:Button
id=
"onceAgainBtn"
label=
""
y=
"478"
horizontalCenter=
"0"
>
...
...
egret/resource/skins/PlaySkin.exml
View file @
693f1945
...
@@ -22,6 +22,6 @@
...
@@ -22,6 +22,6 @@
<e:Label
id=
"ballNums"
text=
"{data.currentBallNums}"
y=
"202.96"
verticalAlign=
"middle"
textAlign=
"center"
width=
"84.61"
size=
"38"
fontFamily=
"Tahoma"
anchorOffsetX=
"0"
anchorOffsetY=
"0"
height=
"43"
x=
"333.16"
textColor=
"0xee5f00"
touchEnabled=
"false"
/>
<e:Label
id=
"ballNums"
text=
"{data.currentBallNums}"
y=
"202.96"
verticalAlign=
"middle"
textAlign=
"center"
width=
"84.61"
size=
"38"
fontFamily=
"Tahoma"
anchorOffsetX=
"0"
anchorOffsetY=
"0"
height=
"43"
x=
"333.16"
textColor=
"0xee5f00"
touchEnabled=
"false"
/>
<e:Image
id=
"musicOff"
source=
"音乐关闭_png"
x=
"683.67"
y=
"7"
/>
<e:Image
id=
"musicOff"
source=
"音乐关闭_png"
x=
"683.67"
y=
"7"
/>
<e:Image
id=
"musicOn"
source=
"音乐开启_png"
x=
"683.67"
y=
"7"
/>
<e:Image
id=
"musicOn"
source=
"音乐开启_png"
x=
"683.67"
y=
"7"
/>
<e:Image
id=
"line"
source=
"line3_png"
x=
"375"
y=
"222.4"
anchorOffsetX=
"5"
anchorOffsetY=
"-74"
touchEnabled=
"false
"
/>
<e:Image
id=
"line"
x=
"375"
y=
"222.4"
anchorOffsetX=
"5"
anchorOffsetY=
"-74"
touchEnabled=
"false"
source=
"shootline_png
"
/>
<e:Image
id=
"guide"
source=
"引导_png"
x=
"0"
y=
"0"
/>
<e:Image
id=
"guide"
source=
"引导_png"
x=
"0"
y=
"0"
locked=
"true"
/>
</e:Skin>
</e:Skin>
\ No newline at end of file
egret/resource/skins/RankItemSkin.exml
View file @
693f1945
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
<w:Config
id=
"169001ce5a5"
/>
<w:Config
id=
"169001ce5a5"
/>
<e:Label
id=
"userRankNum"
text=
"{data.rank}"
x=
"21.5"
y=
"0"
anchorOffsetX=
"0"
width=
"126"
textAlign=
"left"
height=
"100%"
textColor=
"0xb4592a"
verticalAlign=
"middle"
size=
"26"
/>
<e:Label
id=
"userRankNum"
text=
"{data.rank}"
x=
"21.5"
y=
"0"
anchorOffsetX=
"0"
width=
"126"
textAlign=
"left"
height=
"100%"
textColor=
"0xb4592a"
verticalAlign=
"middle"
size=
"26"
/>
<e:Label
id=
"userId"
text=
"{data.cid}"
anchorOffsetX=
"0"
width=
"191"
textAlign=
"center"
x=
"157"
textColor=
"0xb4592a"
verticalAlign=
"middle"
height=
"100%"
size=
"26"
/>
<e:Label
id=
"userId"
text=
"{data.cid}"
anchorOffsetX=
"0"
width=
"191"
textAlign=
"center"
x=
"157"
textColor=
"0xb4592a"
verticalAlign=
"middle"
height=
"100%"
size=
"26"
/>
<e:Label
id=
"userScore"
text=
"{data.maxScore}"
anchorOffsetX=
"0"
width=
"2
19"
textColor=
"0xb4592a"
height=
"100%"
x=
"34
6"
verticalAlign=
"middle"
y=
"0"
textAlign=
"center"
size=
"26"
/>
<e:Label
id=
"userScore"
text=
"{data.maxScore}"
anchorOffsetX=
"0"
width=
"2
31"
textColor=
"0xb4592a"
height=
"100%"
x=
"33
6"
verticalAlign=
"middle"
y=
"0"
textAlign=
"center"
size=
"26"
/>
<e:Image
id=
"bottomLine"
source=
"bottomLine_png"
x=
"0"
bottom=
"0"
/>
<e:Image
id=
"bottomLine"
source=
"bottomLine_png"
x=
"0"
bottom=
"0"
/>
<e:Image
id=
"num3"
source=
"num3_png"
x=
"60"
y=
"5"
visible=
"false"
/>
<e:Image
id=
"num3"
source=
"num3_png"
x=
"60"
y=
"5"
visible=
"false"
/>
<e:Image
id=
"num2"
source=
"num2_png"
x=
"60"
y=
"5"
visible=
"false"
/>
<e:Image
id=
"num2"
source=
"num2_png"
x=
"60"
y=
"5"
visible=
"false"
/>
...
...
egret/resource/skins/RankSkin.exml
View file @
693f1945
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
<e:Button
id=
"closeBtn"
label=
""
horizontalCenter=
"256.5"
verticalCenter=
"-600.5"
>
<e:Button
id=
"closeBtn"
label=
""
horizontalCenter=
"256.5"
verticalCenter=
"-600.5"
>
<e:skinName>
<e:skinName>
<e:Skin
states=
"up,down,disabled"
>
<e:Skin
states=
"up,down,disabled"
>
<e:Image
width=
"100%"
height=
"100%"
source=
"close
Btn2_png"
source.down=
"closeBtn2_png"
source.disabled=
"closeBtn2
_png"
/>
<e:Image
width=
"100%"
height=
"100%"
source=
"close
CommonBtn_png"
source.down=
"closeCommonBtn_png"
source.disabled=
"closeCommonBtn
_png"
/>
<e:Label
id=
"labelDisplay"
horizontalCenter=
"0"
verticalCenter=
"0"
/>
<e:Label
id=
"labelDisplay"
horizontalCenter=
"0"
verticalCenter=
"0"
/>
</e:Skin>
</e:Skin>
</e:skinName>
</e:skinName>
...
...
egret/resource/skins/ReliveSkin.exml
View file @
693f1945
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
<e:Button
id=
"closeBtn"
label=
""
x=
"606.06"
y=
"184.88"
>
<e:Button
id=
"closeBtn"
label=
""
x=
"606.06"
y=
"184.88"
>
<e:skinName>
<e:skinName>
<e:Skin
states=
"up,down,disabled"
>
<e:Skin
states=
"up,down,disabled"
>
<e:Image
width=
"100%"
height=
"100%"
source=
"close
Btn2_png"
source.down=
"closeBtn2_png"
source.disabled=
"closeBtn2
_png"
/>
<e:Image
width=
"100%"
height=
"100%"
source=
"close
CommonBtn_png"
source.down=
"closeCommonBtn_png"
source.disabled=
"closeCommonBtn
_png"
/>
<e:Label
id=
"labelDisplay"
horizontalCenter=
"0"
verticalCenter=
"0"
/>
<e:Label
id=
"labelDisplay"
horizontalCenter=
"0"
verticalCenter=
"0"
/>
</e:Skin>
</e:Skin>
</e:skinName>
</e:skinName>
...
...
egret/resource/skins/StartSkin.exml
View file @
693f1945
...
@@ -48,11 +48,11 @@
...
@@ -48,11 +48,11 @@
</e:skinName>
</e:skinName>
</e:Button>
</e:Button>
<e:Image
source=
"地 拷贝_png"
x=
"2"
y=
"1062"
/>
<e:Image
source=
"地 拷贝_png"
x=
"2"
y=
"1062"
/>
<e:Image
source=
"三角 拷贝 2_png"
x=
"375"
y=
"63
0"
/>
<e:Image
id=
"ele4"
source=
"三角 拷贝 2_png"
x=
"390"
y=
"668"
anchorOffsetX=
"30"
anchorOffsetY=
"4
0"
/>
<e:Image
source=
"三角 拷贝_png"
x=
"633.5"
y=
"1012
"
/>
<e:Image
id=
"ele5"
source=
"三角 拷贝_png"
x=
"660.5"
y=
"1042"
anchorOffsetX=
"27"
anchorOffsetY=
"30
"
/>
<e:Image
source=
"正方形 拷贝 2_png"
x=
"44"
y=
"776
"
/>
<e:Image
id=
"ele3"
source=
"正方形 拷贝 2_png"
x=
"86"
y=
"818"
anchorOffsetX=
"42"
anchorOffsetY=
"42
"
/>
<e:Image
source=
"正方形 拷贝_png"
x=
"596"
y=
"198.5
"
/>
<e:Image
id=
"ele2"
source=
"正方形 拷贝_png"
x=
"634"
y=
"235.5"
anchorOffsetX=
"38"
anchorOffsetY=
"37
"
/>
<e:Image
source=
"圆 拷贝_png"
x=
"52"
y=
"188
"
/>
<e:Image
id=
"ele1"
source=
"圆 拷贝_png"
x=
"82"
y=
"217"
anchorOffsetX=
"30"
anchorOffsetY=
"29
"
/>
<e:Image
source=
"大标_png"
x=
"104"
y=
"138"
/>
<e:Image
source=
"大标_png"
x=
"104"
y=
"138"
/>
<e:Image
source=
"球_png"
x=
"112"
y=
"246"
/>
<e:Image
source=
"球_png"
x=
"112"
y=
"246"
/>
</e:Skin>
</e:Skin>
\ No newline at end of file
egret/src/playScene/PlayScene.ts
View file @
693f1945
...
@@ -23,11 +23,14 @@ import { getBlocks, resetCounter, getCounter } from "./blockGen";
...
@@ -23,11 +23,14 @@ import { getBlocks, resetCounter, getCounter } from "./blockGen";
import
createSpeialCircle
from
"./factory/createSpeialCircle"
;
import
createSpeialCircle
from
"./factory/createSpeialCircle"
;
import
{
NetManager
}
from
"../../libs/tw/manager/NetManager"
;
import
{
NetManager
}
from
"../../libs/tw/manager/NetManager"
;
import
Effect
from
"../Effect"
;
import
Effect
from
"../Effect"
;
import
{
toggleSound
,
playSound
,
SoundType
,
playBg
}
from
"../soundCtrl"
;
export
default
class
PlayScene
extends
Scene
{
export
default
class
PlayScene
extends
Scene
{
initEvents
()
{
initEvents
()
{
this
.
stage
.
addEventListener
(
egret
.
Event
.
ENTER_FRAME
,
this
.
onEnterFrame
,
this
);
this
.
stage
.
addEventListener
(
egret
.
Event
.
ENTER_FRAME
,
this
.
onEnterFrame
,
this
);
this
.
stage
.
addEventListener
(
egret
.
TouchEvent
.
TOUCH_BEGIN
,
this
.
onTouchBegin
,
this
);
this
.
stage
.
addEventListener
(
egret
.
TouchEvent
.
TOUCH_BEGIN
,
this
.
onTouchBegin
,
this
);
this
[
'musicOn'
].
addEventListener
(
egret
.
TouchEvent
.
TOUCH_BEGIN
,
this
.
onTouchTap_musicOn
,
this
);
this
[
'musicOff'
].
addEventListener
(
egret
.
TouchEvent
.
TOUCH_BEGIN
,
this
.
onTouchTap_musicOff
,
this
);
}
}
protected
removeEvents
()
{
protected
removeEvents
()
{
...
@@ -35,6 +38,21 @@ export default class PlayScene extends Scene {
...
@@ -35,6 +38,21 @@ export default class PlayScene extends Scene {
this
.
stage
.
removeEventListener
(
egret
.
Event
.
ENTER_FRAME
,
this
.
onEnterFrame
,
this
);
this
.
stage
.
removeEventListener
(
egret
.
Event
.
ENTER_FRAME
,
this
.
onEnterFrame
,
this
);
}
}
onTouchTap_musicOn
(
e
:
egret
.
TouchEvent
)
{
//关闭
e
.
stopPropagation
();
this
[
'musicOn'
].
visible
=
!
this
[
'musicOn'
].
visible
;
this
[
'musicOff'
].
visible
=
!
this
[
'musicOff'
].
visible
;
playSound
(
SoundType
.
click
);
toggleSound
();
}
onTouchTap_musicOff
(
e
:
egret
.
TouchEvent
)
{
//开启
e
.
stopPropagation
();
toggleSound
();
this
[
'musicOn'
].
visible
=
!
this
[
'musicOn'
].
visible
;
this
[
'musicOff'
].
visible
=
!
this
[
'musicOff'
].
visible
;
}
/** 重力因子,默认1 */
/** 重力因子,默认1 */
private
gravity
=
1
;
private
gravity
=
1
;
/** 物理时间缩放因子 */
/** 物理时间缩放因子 */
...
@@ -65,8 +83,14 @@ export default class PlayScene extends Scene {
...
@@ -65,8 +83,14 @@ export default class PlayScene extends Scene {
async
start
(
data
?)
{
async
start
(
data
?)
{
super
.
start
();
super
.
start
();
playBg
();
this
[
'musicOn'
].
visible
=
true
;
this
[
'musicOff'
].
visible
=
false
;
this
.
startGame
();
this
.
startGame
();
egret
.
Tween
.
get
(
this
[
'ele1'
],
{
loop
:
true
}).
set
({
rotation
:
0
}).
to
({
rotation
:
-
360
},
3000
);
egret
.
Tween
.
get
(
this
[
'ele2'
],
{
loop
:
true
}).
set
({
rotation
:
0
}).
to
({
rotation
:
360
},
3000
);
createSpecialRegTriangle
(
this
,
60
,
250
,
200
,
55
,
'specialRegTriangleTop'
);
//2只鸡
createSpecialRegTriangle
(
this
,
60
,
250
,
200
,
55
,
'specialRegTriangleTop'
);
//2只鸡
createSpecialRegTriangle
(
this
,
750
-
60
,
250
,
200
,
-
55
,
'specialRegTriangleTop'
);
//2只鸡
createSpecialRegTriangle
(
this
,
750
-
60
,
250
,
200
,
-
55
,
'specialRegTriangleTop'
);
//2只鸡
createSpecialRegTriangle
(
this
,
150
,
90
,
500
,
4
,
'specialRegTriangleTop'
);
//顶部两根棍子
createSpecialRegTriangle
(
this
,
150
,
90
,
500
,
4
,
'specialRegTriangleTop'
);
//顶部两根棍子
...
@@ -254,6 +278,7 @@ export default class PlayScene extends Scene {
...
@@ -254,6 +278,7 @@ export default class PlayScene extends Scene {
//如果是其他特殊的,不处理
//如果是其他特殊的,不处理
if
(
isSpecialCircle
(
block
))
{
//如果是特殊的圆,那么创建一个新的球,移除特殊圆
if
(
isSpecialCircle
(
block
))
{
//如果是特殊的圆,那么创建一个新的球,移除特殊圆
this
.
ballCountAll
++
;
this
.
ballCountAll
++
;
playSound
(
SoundType
.
good
)
const
newball
=
createBallItem
()
const
newball
=
createBallItem
()
this
.
addChild
(
newball
.
view
);
this
.
addChild
(
newball
.
view
);
newball
.
view
.
y
=
ball
.
view
.
y
=
block
.
y
;
newball
.
view
.
y
=
ball
.
view
.
y
=
block
.
y
;
...
@@ -271,6 +296,7 @@ export default class PlayScene extends Scene {
...
@@ -271,6 +296,7 @@ export default class PlayScene extends Scene {
this
.
shake
(
block
);
this
.
shake
(
block
);
this
.
data
.
score
++
;
this
.
data
.
score
++
;
block
.
num
=
block
.
num
-
1
;
block
.
num
=
block
.
num
-
1
;
playSound
(
SoundType
.
bounce
);
if
(
block
.
num
<=
0
)
{
if
(
block
.
num
<=
0
)
{
new
Effect
(
block
,
this
);
new
Effect
(
block
,
this
);
//回收加动效
//回收加动效
...
@@ -332,6 +358,7 @@ export default class PlayScene extends Scene {
...
@@ -332,6 +358,7 @@ export default class PlayScene extends Scene {
useFrame
:
true
,
useFrame
:
true
,
onComplete
:
()
=>
{
onComplete
:
()
=>
{
ball
.
view
.
x
=
targX
;
ball
.
view
.
x
=
targX
;
playSound
(
SoundType
.
recover
);
Tween
.
to
(
ball
.
view
,
20
,
{
Tween
.
to
(
ball
.
view
,
20
,
{
y
:
this
.
line
.
y
-
this
.
line
.
anchorOffsetY
+
BALL_D
/
2
,
y
:
this
.
line
.
y
-
this
.
line
.
anchorOffsetY
+
BALL_D
/
2
,
useFrame
:
true
,
useFrame
:
true
,
...
@@ -343,6 +370,7 @@ export default class PlayScene extends Scene {
...
@@ -343,6 +370,7 @@ export default class PlayScene extends Scene {
onComplete
:
()
=>
{
onComplete
:
()
=>
{
this
.
data
.
currentBallNums
++
;
this
.
data
.
currentBallNums
++
;
this
.
ballCount
++
;
this
.
ballCount
++
;
if
(
this
.
ballCount
==
this
.
ballCountAll
)
{
if
(
this
.
ballCount
==
this
.
ballCountAll
)
{
this
.
canShootTag
=
true
;
this
.
canShootTag
=
true
;
this
.
onShootEnd
();
this
.
onShootEnd
();
...
@@ -367,6 +395,7 @@ export default class PlayScene extends Scene {
...
@@ -367,6 +395,7 @@ export default class PlayScene extends Scene {
let
count
=
0
;
let
count
=
0
;
const
timer
=
setInterval
(()
=>
{
const
timer
=
setInterval
(()
=>
{
count
++
;
count
++
;
playSound
(
SoundType
.
shoot
);
this
.
data
.
currentBallNums
--
;
this
.
data
.
currentBallNums
--
;
if
(
this
.
data
.
currentBallNums
<
0
)
if
(
this
.
data
.
currentBallNums
<
0
)
this
.
data
.
currentBallNums
=
0
;
this
.
data
.
currentBallNums
=
0
;
...
...
egret/src/soundCtrl.ts
0 → 100644
View file @
693f1945
let
soundOn
=
true
;
let
bgChannel
:
egret
.
SoundChannel
;
let
loading
=
false
;
export
const
getSoundOn
=
()
=>
{
return
soundOn
}
export
const
toggleSound
=
()
=>
{
soundOn
=
!
soundOn
;
if
(
bgChannel
)
{
if
(
!
soundOn
)
{
bgChannel
.
stop
();
bgChannel
=
null
;
}
}
else
{
if
(
soundOn
)
{
playBg
();
}
}
}
export
const
playBg
=
async
()
=>
{
if
(
bgChannel
)
return
;
if
(
loading
)
return
;
loading
=
true
;
const
bg
=
await
RES
.
getResAsync
(
'bg_mp3'
);
bgChannel
=
bg
.
play
();
loading
=
false
;
}
export
enum
SoundType
{
click
=
'click'
,
bounce
=
'bounce'
,
good
=
'good'
,
recover
=
'recover'
,
shoot
=
'shoot'
,
}
export
const
playSound
=
(
type
:
SoundType
)
=>
{
if
(
!
soundOn
)
return
;
const
sound
:
egret
.
Sound
=
RES
.
getRes
(
type
+
"_mp3"
);
if
(
sound
)
sound
.
play
(
0
,
1
);
else
RES
.
getResAsync
(
type
+
"_mp3"
)
}
\ No newline at end of file
egret/src/startScene/StartScene.ts
View file @
693f1945
...
@@ -9,7 +9,6 @@ import SceneCtrl from "../../libs/new_wx/ctrls/sceneCtrl";
...
@@ -9,7 +9,6 @@ import SceneCtrl from "../../libs/new_wx/ctrls/sceneCtrl";
import
{
ModuleTypes
}
from
"../../libs/new_wx/types/sceneTypes"
;
import
{
ModuleTypes
}
from
"../../libs/new_wx/types/sceneTypes"
;
import
{
DataManager
}
from
"../../libs/tw/manager/DataManager"
;
import
{
DataManager
}
from
"../../libs/tw/manager/DataManager"
;
import
{
NetManager
}
from
"../../libs/tw/manager/NetManager"
;
import
{
NetManager
}
from
"../../libs/tw/manager/NetManager"
;
import
Effect
from
"../Effect"
;
export
default
class
StartScene
extends
Scene
{
export
default
class
StartScene
extends
Scene
{
ruleBtn
:
eui
.
Button
;
ruleBtn
:
eui
.
Button
;
...
@@ -25,24 +24,24 @@ export default class StartScene extends Scene {
...
@@ -25,24 +24,24 @@ export default class StartScene extends Scene {
exemptionTxt
:
eui
.
Label
;
exemptionTxt
:
eui
.
Label
;
async
start
(
data
?)
{
async
start
(
data
?)
{
this
.
startBtn
.
visible
=
false
;
this
.
startBtn
.
visible
=
false
;
this
.
updateGetInfoView
();
this
.
updateGetInfoView
();
this
.
updateExemptionTxt
();
this
.
updateExemptionTxt
();
super
.
start
();
super
.
start
();
egret
.
Tween
.
get
(
this
.
startBtn
,{
loop
:
true
}).
to
({
scaleX
:.
9
,
scaleY
:.
9
},
150
).
to
({
scaleX
:
1
,
scaleY
:
1
},
500
,
egret
.
Ease
.
getBackOut
(
5
)).
wait
(
600
);
NetManager
.
ins
.
getCredits
(()
=>
{
NetManager
.
ins
.
getCredits
(()
=>
{
this
.
data
.
credit
=
`我的
${
DataManager
.
ins
.
getCreditsData
.
unitName
}
:
${
DataManager
.
ins
.
getCreditsData
.
consumerCredits
}
`
;
this
.
data
.
credit
=
`我的
${
DataManager
.
ins
.
getCreditsData
.
unitName
}
:
${
DataManager
.
ins
.
getCreditsData
.
consumerCredits
}
`
;
});
});
NetManager
.
ins
.
getPrizeInfo
(()
=>
{
},
window
[
'revivePlugId'
]);
NetManager
.
ins
.
getPrizeInfo
(()
=>
{
},
window
[
'revivePlugId'
]);
// setTimeout(() => {
for
(
let
i
=
1
;
i
<=
5
;
i
++
)
{
// const e = new Effect('circle1_png');
const
ele
=
this
[
'ele'
+
i
];
// this.addChild(e);
egret
.
Tween
.
get
(
ele
,
{
loop
:
true
}).
set
({
rotation
:
0
}).
to
({
rotation
:
Math
.
random
()
>
0.5
?
360
:
-
360
},
3000
)
// e.x = 375;
}
// e.y = 500;
// }, 1000);
}
}
private
updateGetInfoView
()
{
private
updateGetInfoView
()
{
...
@@ -63,7 +62,7 @@ export default class StartScene extends Scene {
...
@@ -63,7 +62,7 @@ export default class StartScene extends Scene {
}
}
updateCountTxt
()
{
updateCountTxt
()
{
this
.
data
.
count
=
`
消耗:
${
getCountTxt
()}
`
;
this
.
data
.
count
=
`
${
getCountTxt
()}
`
;
}
}
updateExemptionTxt
()
{
updateExemptionTxt
()
{
...
...
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