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
6188fd65
Commit
6188fd65
authored
Aug 31, 2019
by
wildfirecode
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
35e452bb
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
52 additions
and
53 deletions
+52
-53
MainScene.ts
egret/src/mainScene/MainScene.ts
+43
-45
soundCtrl.ts
egret/src/soundCtrl.ts
+5
-0
soundCtrl2.ts
egret/src/soundCtrl2.ts
+4
-8
No files found.
egret/src/mainScene/MainScene.ts
View file @
6188fd65
import
{
DataManager
}
from
'./../../libs/tw/manager/DataManager'
;
import
getResPath
from
'../../libs/new_tc/getResPath'
;
import
{
NetManager
}
from
'./../../libs/tw/manager/NetManager'
;
import
Scene
from
'../../libs/new_wx/components/Scene'
;
import
{
Buried
}
from
'./../../libs/tw/util/Buried'
;
import
PanelCtrl
from
'../../libs/new_wx/ctrls/panelCtrl'
;
import
{
Tool
}
from
'../something/Tool'
;
import
SceneCtrl
from
'../../libs/new_wx/ctrls/sceneCtrl'
;
import
{
drawBg
,
generateMapBg
,
drawShape
}
from
'../something/logic/aaa'
;
import
{
showToast
}
from
'../../libs/new_wx/ctrls/toastCtrl'
;
import
{
ChapterData
}
from
'../something/interface/ChapterData'
;
import
{
ModuleTypes
}
from
'../../libs/new_wx/types/sceneTypes'
;
import
{
Lattice
}
from
'../something/class/Lattice'
;
import
{
getPropNums
}
from
'../getHomeData'
;
import
{
Pool
}
from
'../something/Pool'
;
import
{
getlogItem
}
from
'../Main'
;
import
{
RecoverName
}
from
'../something/enum/RecoverName'
;
import
PropType
from
'../PropType'
;
import
{
Element
}
from
'../something/class/Element'
;
import
{
BonusShootAni
,
stepPosition
}
from
'../something/anis/BonusShootAni'
;
import
{
ElementType
,
submitTran
,
codeMsgs
}
from
'../something/enum/ElementType'
;
import
{
EffectType
}
from
'../something/enum/EffectType'
;
import
{
BoomAni
}
from
'../something/anis/BoomAni'
;
import
{
BoomAni
}
from
'../something/anis/BoomAni'
;
import
{
IceAni
}
from
'../something/anis/IceAni'
;
import
{
RockAni
}
from
'../something/anis/RockAni'
;
import
{
Ice
}
from
'../something/class/Ice'
;
import
{
HorizontalAni
}
from
'../something/anis/HorizontalAni'
;
import
{
VerticalAni
}
from
'../something/anis/VerticalAni'
;
import
{
CrossAni
}
from
'../something/anis/CrossAni'
;
import
{
CrossAni
}
from
'../something/anis/CrossAni'
;
import
{
ThreeCrossAni
}
from
'../something/anis/ThreeCrossAni'
;
import
{
EleDisAni
}
from
'../something/anis/EleDisAni'
;
import
{
EleDisAni
}
from
'../something/anis/EleDisAni'
;
import
{
MagicRotateData
}
from
'../something/interface/MagicRotateData'
;
import
{
FlyTargetAni
}
from
'../something/anis/FlyTargetAni'
;
import
{
MagicRotateAni
}
from
'../something/anis/MagicRotateAni'
;
import
{
HorizontalAni
}
from
'../something/anis/HorizontalAni'
;
import
{
IceAni
}
from
'../something/anis/IceAni'
;
import
{
MagicLionAni
}
from
'../something/anis/MagicLionAni'
;
import
{
MagicLionAni
}
from
'../something/anis/MagicLionAni'
;
import
{
StepNumber
}
from
'../something/uis/StepNumber'
;
import
{
MagicRotateAni
}
from
'../something/anis/MagicRotateAni'
;
import
{
RockAni
}
from
'../something/anis/RockAni'
;
import
{
ScoreAni
}
from
'../something/anis/ScoreAni'
;
import
{
ThreeCrossAni
}
from
'../something/anis/ThreeCrossAni'
;
import
{
VerticalAni
}
from
'../something/anis/VerticalAni'
;
import
{
Chapters
}
from
'../something/Chapters'
;
import
{
Element
}
from
'../something/class/Element'
;
import
{
Ice
}
from
'../something/class/Ice'
;
import
{
Lattice
}
from
'../something/class/Lattice'
;
import
{
EffectType
}
from
'../something/enum/EffectType'
;
import
{
codeMsgs
,
ElementType
,
submitTran
}
from
'../something/enum/ElementType'
;
import
{
PassType
}
from
'../something/enum/PassType'
;
import
{
PassType
}
from
'../something/enum/PassType'
;
import
{
RecoverName
}
from
'../something/enum/RecoverName'
;
import
{
ChapterData
}
from
'../something/interface/ChapterData'
;
import
{
ElementTargetData
}
from
'../something/interface/ElementTargetData'
;
import
{
ElementTargetData
}
from
'../something/interface/ElementTargetData'
;
import
{
ScoreAni
}
from
'../something/anis/ScoreAni'
;
import
{
MagicRotateData
}
from
'../something/interface/MagicRotateData'
;
import
{
ScoreProgress
}
from
'../something/uis/ScoreProgress'
;
import
{
drawBg
,
drawShape
,
generateMapBg
}
from
'../something/logic/aaa'
;
import
{
playSound
,
SoundType
,
toggleSound
,
toggleBg
,
getSoundOn
,
getBgOn
,
stopBg
}
from
'../soundCtrl'
;
import
{
Pool
}
from
'../something/Pool'
;
import
Scene
from
'../../libs/new_wx/components/Scene'
;
import
{
Tool
}
from
'../something/Tool'
;
import
{
showToast
}
from
'../../libs/new_wx/ctrls/toastCtrl'
;
import
{
BonusTime
}
from
'../something/uis/BonusTime'
;
import
getResPath
from
'../../libs/new_tc/getResPath'
;
import
PanelCtrl
from
'../../libs/new_wx/ctrls/panelCtrl'
;
import
{
ModuleTypes
}
from
'../../libs/new_wx/types/sceneTypes'
;
import
{
ElementTargets
}
from
'../something/uis/ElementTargets'
;
import
{
ElementTargets
}
from
'../something/uis/ElementTargets'
;
import
{
Chapters
}
from
'../something/Chapters'
;
import
{
Loading2
}
from
'../something/uis/Loading2'
;
import
{
FlyTargetAni
}
from
'../something/anis/FlyTargetAni'
;
import
{
BonusShootAni
,
stepPosition
}
from
'../something/anis/BonusShootAni'
;
import
{
GuideMsg
}
from
'../something/uis/GuideMsg'
;
import
{
getlogItem
}
from
'../Main'
;
import
getHomeData
,
{
getPropNums
}
from
'../getHomeData'
;
import
PropType
from
'../PropType'
;
import
{
PropNumShow
}
from
'../something/uis/PropNumShow'
;
import
SceneCtrl
from
'../../libs/new_wx/ctrls/sceneCtrl'
;
import
{
PropGuide
}
from
'../something/uis/PropGuide'
;
import
{
PropGuide
}
from
'../something/uis/PropGuide'
;
import
{
PropNumShow
}
from
'../something/uis/PropNumShow'
;
import
{
ScoreProgress
}
from
'../something/uis/ScoreProgress'
;
import
{
StepNumber
}
from
'../something/uis/StepNumber'
;
import
{
getBgOn
,
getSoundOn
,
playSound
,
SoundType
,
stopBg
,
toggleSound
}
from
'../soundCtrl'
;
import
{
playGameBg
,
toggleGameBg
}
from
'../soundCtrl2'
;
import
{
createData
}
from
'../startScene/StartScene'
;
import
{
createData
}
from
'../startScene/StartScene'
;
import
{
Loading2
}
from
'../something/uis/Loading2'
;
import
{
DataManager
}
from
'./../../libs/tw/manager/DataManager'
;
import
{
BonusTime
}
from
'../something/uis/BonusTime'
;
import
{
NetManager
}
from
'./../../libs/tw/manager/NetManager'
;
import
{
NetName
}
from
'../../libs/tw/enum/NetName'
;
import
{
Buried
}
from
'./../../libs/tw/util/Buried'
;
import
{
playGameBg
,
toggleGameBg
,
getGameBgOn
,
setGameBgStatus
}
from
'../soundCtrl2'
;
const
aniClass
=
{
const
aniClass
=
{
"BoomAni"
:
BoomAni
,
"BoomAni"
:
BoomAni
,
...
@@ -373,11 +371,11 @@ export default class MainScene extends Scene {
...
@@ -373,11 +371,11 @@ export default class MainScene extends Scene {
this
.
musicBtn
.
source
=
"mainMusicBtnOn_png"
;
this
.
musicBtn
.
source
=
"mainMusicBtnOn_png"
;
stopBg
();
stopBg
();
playGameBg
();
playGameBg
();
setGameBgStatus
(
true
);
//
setGameBgStatus(true);
}
else
{
}
else
{
this
.
musicBtn
.
source
=
"mainMusicBtnOff_png"
;
this
.
musicBtn
.
source
=
"mainMusicBtnOff_png"
;
stopBg
();
stopBg
();
setGameBgStatus
(
false
);
//
setGameBgStatus(false);
}
}
//初始化道具信息
//初始化道具信息
var
arrObj
=
[
"boomBtnNum"
,
"hammerBtnNum"
,
"stepBtnNum"
];
var
arrObj
=
[
"boomBtnNum"
,
"hammerBtnNum"
,
"stepBtnNum"
];
...
@@ -763,7 +761,7 @@ export default class MainScene extends Scene {
...
@@ -763,7 +761,7 @@ export default class MainScene extends Scene {
onTap_musicBtn
()
{
onTap_musicBtn
()
{
// toggleBg();
// toggleBg();
toggleGameBg
();
toggleGameBg
();
if
(
get
Game
BgOn
())
{
if
(
getBgOn
())
{
this
.
musicBtn
.
source
=
"mainMusicBtnOn_png"
this
.
musicBtn
.
source
=
"mainMusicBtnOn_png"
}
else
{
}
else
{
this
.
musicBtn
.
source
=
"mainMusicBtnOff_png"
this
.
musicBtn
.
source
=
"mainMusicBtnOff_png"
...
...
egret/src/soundCtrl.ts
View file @
6188fd65
...
@@ -12,6 +12,11 @@ export const getBgOn = () => {
...
@@ -12,6 +12,11 @@ export const getBgOn = () => {
export
const
toggleSound
=
()
=>
{
export
const
toggleSound
=
()
=>
{
soundOn
=
!
soundOn
;
soundOn
=
!
soundOn
;
}
}
export
const
toggleBgStatus
=
()
=>
{
bgOn
=
!
bgOn
;
}
export
const
toggleBg
=
()
=>
{
export
const
toggleBg
=
()
=>
{
bgOn
=
!
bgOn
;
bgOn
=
!
bgOn
;
if
(
bgChannel
)
{
if
(
bgChannel
)
{
...
...
egret/src/soundCtrl2.ts
View file @
6188fd65
let
bgOn
=
true
;
import
{
getBgOn
,
toggleBgStatus
}
from
"./soundCtrl"
;
let
bgChannel
:
egret
.
SoundChannel
;
let
bgChannel
:
egret
.
SoundChannel
;
let
loading
=
false
;
let
loading
=
false
;
export
const
setGameBgStatus
=
(
b
:
boolean
)
=>
{
bgOn
=
b
;
}
export
const
getGameBgOn
=
()
=>
{
return
bgOn
}
export
const
toggleGameBg
=
()
=>
{
export
const
toggleGameBg
=
()
=>
{
bgOn
=
!
bgOn
;
toggleBgStatus
();
const
bgOn
=
getBgOn
();
if
(
bgChannel
)
{
if
(
bgChannel
)
{
if
(
!
bgOn
)
{
if
(
!
bgOn
)
{
bgChannel
.
stop
();
bgChannel
.
stop
();
...
...
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