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
{
NetManager
}
from
'./../../libs/tw/manager/NetManager'
;
import
{
Buried
}
from
'./../../libs/tw/util/Buried'
;
import
{
Tool
}
from
'../something/Tool'
;
import
{
drawBg
,
generateMapBg
,
drawShape
}
from
'../something/logic/aaa'
;
import
{
ChapterData
}
from
'../something/interface/ChapterData'
;
import
{
Lattice
}
from
'../something/class/Lattice'
;
import
{
Pool
}
from
'../something/Pool'
;
import
{
RecoverName
}
from
'../something/enum/RecoverName'
;
import
{
Element
}
from
'../something/class/Element'
;
import
{
ElementType
,
submitTran
,
codeMsgs
}
from
'../something/enum/ElementType'
;
import
{
EffectType
}
from
'../something/enum/EffectType'
;
import
getResPath
from
'../../libs/new_tc/getResPath'
;
import
Scene
from
'../../libs/new_wx/components/Scene'
;
import
PanelCtrl
from
'../../libs/new_wx/ctrls/panelCtrl'
;
import
SceneCtrl
from
'../../libs/new_wx/ctrls/sceneCtrl'
;
import
{
showToast
}
from
'../../libs/new_wx/ctrls/toastCtrl'
;
import
{
ModuleTypes
}
from
'../../libs/new_wx/types/sceneTypes'
;
import
{
getPropNums
}
from
'../getHomeData'
;
import
{
getlogItem
}
from
'../Main'
;
import
PropType
from
'../PropType'
;
import
{
BonusShootAni
,
stepPosition
}
from
'../something/anis/BonusShootAni'
;
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
{
ThreeCrossAni
}
from
'../something/anis/ThreeCrossAni'
;
import
{
EleDisAni
}
from
'../something/anis/EleDisAni'
;
import
{
MagicRotateData
}
from
'../something/interface/MagicRotateData'
;
import
{
MagicRotateAni
}
from
'../something/anis/MagicRotateAni'
;
import
{
FlyTargetAni
}
from
'../something/anis/FlyTargetAni'
;
import
{
HorizontalAni
}
from
'../something/anis/HorizontalAni'
;
import
{
IceAni
}
from
'../something/anis/IceAni'
;
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
{
RecoverName
}
from
'../something/enum/RecoverName'
;
import
{
ChapterData
}
from
'../something/interface/ChapterData'
;
import
{
ElementTargetData
}
from
'../something/interface/ElementTargetData'
;
import
{
ScoreAni
}
from
'../something/anis/ScoreAni'
;
import
{
ScoreProgress
}
from
'../something/uis/ScoreProgress'
;
import
{
playSound
,
SoundType
,
toggleSound
,
toggleBg
,
getSoundOn
,
getBgOn
,
stopBg
}
from
'../soundCtrl'
;
import
Scene
from
'../../libs/new_wx/components/Scene'
;
import
{
showToast
}
from
'../../libs/new_wx/ctrls/toastCtrl'
;
import
getResPath
from
'../../libs/new_tc/getResPath'
;
import
PanelCtrl
from
'../../libs/new_wx/ctrls/panelCtrl'
;
import
{
ModuleTypes
}
from
'../../libs/new_wx/types/sceneTypes'
;
import
{
MagicRotateData
}
from
'../something/interface/MagicRotateData'
;
import
{
drawBg
,
drawShape
,
generateMapBg
}
from
'../something/logic/aaa'
;
import
{
Pool
}
from
'../something/Pool'
;
import
{
Tool
}
from
'../something/Tool'
;
import
{
BonusTime
}
from
'../something/uis/BonusTime'
;
import
{
ElementTargets
}
from
'../something/uis/ElementTargets'
;
import
{
Chapters
}
from
'../something/Chapters'
;
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
{
Loading2
}
from
'../something/uis/Loading2'
;
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
{
Loading2
}
from
'../something/uis/Loading2'
;
import
{
BonusTime
}
from
'../something/uis/BonusTime'
;
import
{
NetName
}
from
'../../libs/tw/enum/NetName'
;
import
{
playGameBg
,
toggleGameBg
,
getGameBgOn
,
setGameBgStatus
}
from
'../soundCtrl2'
;
import
{
DataManager
}
from
'./../../libs/tw/manager/DataManager'
;
import
{
NetManager
}
from
'./../../libs/tw/manager/NetManager'
;
import
{
Buried
}
from
'./../../libs/tw/util/Buried'
;
const
aniClass
=
{
"BoomAni"
:
BoomAni
,
...
...
@@ -373,11 +371,11 @@ export default class MainScene extends Scene {
this
.
musicBtn
.
source
=
"mainMusicBtnOn_png"
;
stopBg
();
playGameBg
();
setGameBgStatus
(
true
);
//
setGameBgStatus(true);
}
else
{
this
.
musicBtn
.
source
=
"mainMusicBtnOff_png"
;
stopBg
();
setGameBgStatus
(
false
);
//
setGameBgStatus(false);
}
//初始化道具信息
var
arrObj
=
[
"boomBtnNum"
,
"hammerBtnNum"
,
"stepBtnNum"
];
...
...
@@ -763,7 +761,7 @@ export default class MainScene extends Scene {
onTap_musicBtn
()
{
// toggleBg();
toggleGameBg
();
if
(
get
Game
BgOn
())
{
if
(
getBgOn
())
{
this
.
musicBtn
.
source
=
"mainMusicBtnOn_png"
}
else
{
this
.
musicBtn
.
source
=
"mainMusicBtnOff_png"
...
...
egret/src/soundCtrl.ts
View file @
6188fd65
...
...
@@ -12,6 +12,11 @@ export const getBgOn = () => {
export
const
toggleSound
=
()
=>
{
soundOn
=
!
soundOn
;
}
export
const
toggleBgStatus
=
()
=>
{
bgOn
=
!
bgOn
;
}
export
const
toggleBg
=
()
=>
{
bgOn
=
!
bgOn
;
if
(
bgChannel
)
{
...
...
egret/src/soundCtrl2.ts
View file @
6188fd65
let
bgOn
=
true
;
import
{
getBgOn
,
toggleBgStatus
}
from
"./soundCtrl"
;
let
bgChannel
:
egret
.
SoundChannel
;
let
loading
=
false
;
export
const
setGameBgStatus
=
(
b
:
boolean
)
=>
{
bgOn
=
b
;
}
export
const
getGameBgOn
=
()
=>
{
return
bgOn
}
export
const
toggleGameBg
=
()
=>
{
bgOn
=
!
bgOn
;
toggleBgStatus
();
const
bgOn
=
getBgOn
();
if
(
bgChannel
)
{
if
(
!
bgOn
)
{
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