Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
new-kickball
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
new-kickball
Commits
9d5f3970
Commit
9d5f3970
authored
Jun 20, 2019
by
任建锋
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
--
parent
16987938
Changes
34
Show whitespace changes
Inline
Side-by-side
Showing
34 changed files
with
7310 additions
and
306 deletions
+7310
-306
SceneStart_20190620162124.ts
.history/assets/scripts/scenes/SceneStart_20190620162124.ts
+184
-0
SceneStart_20190620162225.ts
.history/assets/scripts/scenes/SceneStart_20190620162225.ts
+188
-0
SceneStart_20190620162316.ts
.history/assets/scripts/scenes/SceneStart_20190620162316.ts
+189
-0
SceneStart_20190620163435.ts
.history/assets/scripts/scenes/SceneStart_20190620163435.ts
+192
-0
SceneStart_20190620163657.ts
.history/assets/scripts/scenes/SceneStart_20190620163657.ts
+198
-0
SceneStart_20190620163812.ts
.history/assets/scripts/scenes/SceneStart_20190620163812.ts
+204
-0
SceneStart_20190620163840.ts
.history/assets/scripts/scenes/SceneStart_20190620163840.ts
+204
-0
SceneStart_20190620164131.ts
.history/assets/scripts/scenes/SceneStart_20190620164131.ts
+206
-0
SceneStart_20190620164507.ts
.history/assets/scripts/scenes/SceneStart_20190620164507.ts
+228
-0
SceneStart_20190620164511.ts
.history/assets/scripts/scenes/SceneStart_20190620164511.ts
+228
-0
SceneStart_20190620164601.ts
.history/assets/scripts/scenes/SceneStart_20190620164601.ts
+227
-0
SceneStart_20190620164638.ts
.history/assets/scripts/scenes/SceneStart_20190620164638.ts
+229
-0
SceneStart_20190620164741.ts
.history/assets/scripts/scenes/SceneStart_20190620164741.ts
+231
-0
SceneStart_20190620164814.ts
.history/assets/scripts/scenes/SceneStart_20190620164814.ts
+231
-0
SceneStart_20190620164822.ts
.history/assets/scripts/scenes/SceneStart_20190620164822.ts
+231
-0
SceneStart_20190620164829.ts
.history/assets/scripts/scenes/SceneStart_20190620164829.ts
+231
-0
SceneStart_20190620165016.ts
.history/assets/scripts/scenes/SceneStart_20190620165016.ts
+231
-0
SceneStart_20190620165200.ts
.history/assets/scripts/scenes/SceneStart_20190620165200.ts
+231
-0
SceneStart_20190620165216.ts
.history/assets/scripts/scenes/SceneStart_20190620165216.ts
+231
-0
SceneStart_20190620165228.ts
.history/assets/scripts/scenes/SceneStart_20190620165228.ts
+231
-0
SceneStart_20190620165300.ts
.history/assets/scripts/scenes/SceneStart_20190620165300.ts
+231
-0
SceneStart_20190620165308.ts
.history/assets/scripts/scenes/SceneStart_20190620165308.ts
+231
-0
SceneStart_20190620165446.ts
.history/assets/scripts/scenes/SceneStart_20190620165446.ts
+234
-0
SceneStart_20190620165503.ts
.history/assets/scripts/scenes/SceneStart_20190620165503.ts
+234
-0
SceneStart_20190620165508.ts
.history/assets/scripts/scenes/SceneStart_20190620165508.ts
+234
-0
SceneStart_20190620165554.ts
.history/assets/scripts/scenes/SceneStart_20190620165554.ts
+234
-0
SceneStart_20190620165631.ts
.history/assets/scripts/scenes/SceneStart_20190620165631.ts
+234
-0
SceneStart_20190620165635.ts
.history/assets/scripts/scenes/SceneStart_20190620165635.ts
+234
-0
SceneStart_20190620165757.ts
.history/assets/scripts/scenes/SceneStart_20190620165757.ts
+234
-0
SceneStart_20190620165908.ts
.history/assets/scripts/scenes/SceneStart_20190620165908.ts
+233
-0
SceneStart_20190620165931.ts
.history/assets/scripts/scenes/SceneStart_20190620165931.ts
+233
-0
main.scene
assets/scenes/main.scene
+348
-287
SceneStart.ts
assets/scripts/scenes/SceneStart.ts
+63
-11
MustCompile.ts
src/generated/MustCompile.ts
+8
-8
No files found.
.history/assets/scripts/scenes/SceneStart_20190620162124.ts
0 → 100644
View file @
9d5f3970
/**
* Created by rockyl on 2019-04-09.
*/
import
ScillaComponent
from
"scilla-components/src/base/ScillaComponent"
;
import
{
dynamic
,
Entity
,
Tween
}
from
"scilla/src"
;
import
{
setText
}
from
"../entityUtils"
;
import
{
alien
}
from
"../navigator/StackNavigator"
;
import
Wave
from
'components/animation/Wave'
import
{
INavigatorViewBase
}
from
"../navigator/VirtualNavigator"
;
import
{
Transform
}
from
'scilla-components/src'
;
import
{
createTween
,
ease
}
from
"scilla"
;
export
default
class
SceneStart
extends
ScillaComponent
implements
INavigatorViewBase
{
ajaxElement
:
dynamic
;
doJoin
:
dynamic
;
getNgameStartStatus
:
dynamic
;
countTxt
:
Entity
;
startbtn
:
Entity
;
recordbtn
:
Entity
;
pingziFront
:
Entity
;
pingziBack
:
Entity
;
rankbtn
:
Entity
;
rulebtn
:
Entity
;
gouzi
:
Entity
;
private
startBtnAnimation
;
pingziFrontTransform
:
Transform
;
pingziBackTransform
:
Transform
;
gouziTransform
:
Transform
;
onAwake
()
{
super
.
onAwake
();
this
.
setCountText
(
''
);
this
.
startBtnAnimation
=
this
.
startbtn
.
getComponent
(
Transform
);
this
.
pingziFrontTransform
=
this
.
pingziFront
.
getComponent
(
Transform
);
this
.
pingziBackTransform
=
this
.
pingziBack
.
getComponent
(
Transform
);
this
.
gouziTransform
=
this
.
gouzi
.
getComponent
(
Transform
);
//Tween.
//egret.Tween.get(this.startBtn, {loop:true}).to({scaleX:0.9, scaleY:0.9}, 300).wait(1000).to({scaleX:1, scaleY:1}, 300);
// SingleSceneNavigator
console
.
log
(
"sd"
)
/* var sd=createTween(this.startBtnAnimation, this.startBtnAnimation)
.to({scaleX:1.2,scaleY:1.2}, 1200) */
/* createTween(this, this.startBtnAnimation)
.set({scale: {x: 0, y: 0}, alpha: 1})
.wait(100)
.to({scale: {x: 0.8, y: 0.8}}, 800)
.to({scale: {x: 1.1, y: 1.1}, alpha: 0}, 1200); */
createTween
(
this
,
this
.
startBtnAnimation
,
true
,{
loop
:
-
1
})
.
set
({
scale
:
{
x
:
1
,
y
:
1
}})
.
to
({
scale
:
{
x
:
.
9
,
y
:
.
9
}},
300
)
.
wait
(
1000
)
.
to
({
scale
:
{
x
:
1
,
y
:
1
}},
300
)
createTween
(
this
,
this
.
pingziFrontTransform
,
true
,{
loop
:
-
1
})
.
set
({
position
:
{
x
:
-
110
}})
.
to
({
position
:
{
x
:
110
}},
1000
)
createTween
(
this
,
this
.
pingziBackTransform
,
true
,{
loop
:
-
1
})
.
set
({
position
:
{
x
:
47.5
}})
.
to
({
position
:
{
x
:
-
152.5
}},
1000
)
//console.log(sd)
//.call(resolve);
}
private
setCountText
(
text
:
string
)
{
setText
(
this
.
countTxt
,
text
);
}
initGameStage
()
{
this
.
updateCountText
();
}
updateCountText
()
{
const
{
element
}
=
this
.
ajaxElement
;
let
text
=
''
if
(
element
.
freeLimit
>
0
)
{
text
=
`今日剩余免费次数:
${
element
.
freeLimit
}
次`
;
}
else
{
text
=
`
${
element
.
needCredits
}${
window
[
'CFG'
].
unitName
}
/次`
}
this
.
setCountText
(
text
);
}
onClick_startbtn
()
{
/* this.broadcast('callApi', 1, 'doJoin', {
activityId: window['CFG'].actId,
activityType: 'hdtool',
consumerId: window['CFG'].consumerId
}); */
if
(
window
[
'getDuibaToken'
])
{
window
[
'getDuibaToken'
]((
tokenObj
:
any
)
=>
{
this
.
broadcast
(
'callApi'
,
1
,
'doJoin'
,
{
token
:
tokenObj
.
token
,
activityId
:
window
[
'CFG'
].
actId
,
activityType
:
'hdtool'
,
consumerId
:
window
[
'CFG'
].
consumerId
});
},
(
key
:
string
,
messageObj
:
any
)
=>
{
this
.
onGotDojoinError
();
});
}
else
{
this
.
broadcast
(
'callApi'
,
1
,
'doJoin'
,
{
activityId
:
window
[
'CFG'
].
actId
,
activityType
:
'hdtool'
,
consumerId
:
window
[
'CFG'
].
consumerId
});
}
}
onGotDojoin
()
{
console
.
log
(
'onGotDojoin'
,
this
.
doJoin
);
this
.
broadcast
(
'callApi'
,
1
,
'getNgameStartStatus'
,
{
orderId
:
this
.
doJoin
});
}
onGotDojoinError
(
data
?)
{
console
.
log
(
'onGotDojoinError'
)
console
.
log
(
this
.
doJoin
)
console
.
log
(
data
)
}
onGot_getNgameStartStatus
()
{
console
.
log
(
'onGot_getNgameStartStatus'
,
this
.
getNgameStartStatus
);
//fuck 不可以循环引用
this
.
bubbling
(
'fuck'
,
'play'
);
}
onGotError_getNgameStartStatus
()
{
console
.
log
(
this
.
getNgameStartStatus
)
console
.
log
(
'onGotError_getNgameStartStatus'
);
}
onClick_rulebtn
()
{
console
.
log
(
'onClick_rulebtn'
);
this
.
bubbling
(
'showDialog'
,
'Rule'
);
}
onClick_recordbtn
()
{
console
.
log
(
'onClick_rulebtn'
);
//this.bubbling('showDialog', 'Rule');
}
onClick_rankbtn
()
{
alert
(
'onClick_rankbtn'
)
// globalEvent.emit('alert', {title: 'Success', content: 'You complete this puzzle', button: 'Next level'}, this.onAlertClose);
}
onDidEnter
(
last
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
):
void
{
this
.
entity
.
enabled
=
true
;
}
onDidLeave
(
next
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
):
void
{
this
.
entity
.
enabled
=
false
;
}
async
onWillEnter
(
last
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
)
{
}
async
onWillLeave
(
next
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
)
{
}
onWillMount
(
last
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
):
Promise
<
any
>
{
return
undefined
;
}
onWillUnMount
(
next
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
):
Promise
<
any
>
{
return
undefined
;
}
}
.history/assets/scripts/scenes/SceneStart_20190620162225.ts
0 → 100644
View file @
9d5f3970
/**
* Created by rockyl on 2019-04-09.
*/
import
ScillaComponent
from
"scilla-components/src/base/ScillaComponent"
;
import
{
dynamic
,
Entity
,
Tween
}
from
"scilla/src"
;
import
{
setText
}
from
"../entityUtils"
;
import
{
alien
}
from
"../navigator/StackNavigator"
;
import
Wave
from
'components/animation/Wave'
import
{
INavigatorViewBase
}
from
"../navigator/VirtualNavigator"
;
import
{
Transform
}
from
'scilla-components/src'
;
import
{
createTween
,
ease
}
from
"scilla"
;
export
default
class
SceneStart
extends
ScillaComponent
implements
INavigatorViewBase
{
ajaxElement
:
dynamic
;
doJoin
:
dynamic
;
getNgameStartStatus
:
dynamic
;
countTxt
:
Entity
;
startbtn
:
Entity
;
recordbtn
:
Entity
;
pingziFront
:
Entity
;
pingziBack
:
Entity
;
rankbtn
:
Entity
;
rulebtn
:
Entity
;
gouzi
:
Entity
;
private
startBtnAnimation
;
pingziFrontTransform
:
Transform
;
pingziBackTransform
:
Transform
;
gouziTransform
:
Transform
;
onAwake
()
{
super
.
onAwake
();
this
.
setCountText
(
''
);
this
.
startBtnAnimation
=
this
.
startbtn
.
getComponent
(
Transform
);
this
.
pingziFrontTransform
=
this
.
pingziFront
.
getComponent
(
Transform
);
this
.
pingziBackTransform
=
this
.
pingziBack
.
getComponent
(
Transform
);
this
.
gouziTransform
=
this
.
gouzi
.
getComponent
(
Transform
);
//Tween.
//egret.Tween.get(this.startBtn, {loop:true}).to({scaleX:0.9, scaleY:0.9}, 300).wait(1000).to({scaleX:1, scaleY:1}, 300);
// SingleSceneNavigator
console
.
log
(
"sd"
)
/* var sd=createTween(this.startBtnAnimation, this.startBtnAnimation)
.to({scaleX:1.2,scaleY:1.2}, 1200) */
/* createTween(this, this.startBtnAnimation)
.set({scale: {x: 0, y: 0}, alpha: 1})
.wait(100)
.to({scale: {x: 0.8, y: 0.8}}, 800)
.to({scale: {x: 1.1, y: 1.1}, alpha: 0}, 1200); */
createTween
(
this
,
this
.
startBtnAnimation
,
true
,{
loop
:
-
1
})
.
set
({
scale
:
{
x
:
1
,
y
:
1
}})
.
to
({
scale
:
{
x
:
.
9
,
y
:
.
9
}},
300
)
.
wait
(
1000
)
.
to
({
scale
:
{
x
:
1
,
y
:
1
}},
300
)
createTween
(
this
,
this
.
pingziFrontTransform
,
true
,{
loop
:
-
1
})
.
set
({
position
:
{
x
:
-
110
}})
.
to
({
position
:
{
x
:
110
}},
1000
)
createTween
(
this
,
this
.
pingziBackTransform
,
true
,{
loop
:
-
1
})
.
set
({
position
:
{
x
:
47.5
}})
.
to
({
position
:
{
x
:
-
152.5
}},
1000
)
createTween
(
this
,
this
.
gouziTransform
,
true
,{
loop
:
-
1
})
.
set
({
position
:
{
y
:
47.5
}})
.
to
({
position
:
{
y
:
-
152.5
}},
1000
)
//console.log(sd)
//.call(resolve);
}
private
setCountText
(
text
:
string
)
{
setText
(
this
.
countTxt
,
text
);
}
initGameStage
()
{
this
.
updateCountText
();
}
updateCountText
()
{
const
{
element
}
=
this
.
ajaxElement
;
let
text
=
''
if
(
element
.
freeLimit
>
0
)
{
text
=
`今日剩余免费次数:
${
element
.
freeLimit
}
次`
;
}
else
{
text
=
`
${
element
.
needCredits
}${
window
[
'CFG'
].
unitName
}
/次`
}
this
.
setCountText
(
text
);
}
onClick_startbtn
()
{
/* this.broadcast('callApi', 1, 'doJoin', {
activityId: window['CFG'].actId,
activityType: 'hdtool',
consumerId: window['CFG'].consumerId
}); */
if
(
window
[
'getDuibaToken'
])
{
window
[
'getDuibaToken'
]((
tokenObj
:
any
)
=>
{
this
.
broadcast
(
'callApi'
,
1
,
'doJoin'
,
{
token
:
tokenObj
.
token
,
activityId
:
window
[
'CFG'
].
actId
,
activityType
:
'hdtool'
,
consumerId
:
window
[
'CFG'
].
consumerId
});
},
(
key
:
string
,
messageObj
:
any
)
=>
{
this
.
onGotDojoinError
();
});
}
else
{
this
.
broadcast
(
'callApi'
,
1
,
'doJoin'
,
{
activityId
:
window
[
'CFG'
].
actId
,
activityType
:
'hdtool'
,
consumerId
:
window
[
'CFG'
].
consumerId
});
}
}
onGotDojoin
()
{
console
.
log
(
'onGotDojoin'
,
this
.
doJoin
);
this
.
broadcast
(
'callApi'
,
1
,
'getNgameStartStatus'
,
{
orderId
:
this
.
doJoin
});
}
onGotDojoinError
(
data
?)
{
console
.
log
(
'onGotDojoinError'
)
console
.
log
(
this
.
doJoin
)
console
.
log
(
data
)
}
onGot_getNgameStartStatus
()
{
console
.
log
(
'onGot_getNgameStartStatus'
,
this
.
getNgameStartStatus
);
//fuck 不可以循环引用
this
.
bubbling
(
'fuck'
,
'play'
);
}
onGotError_getNgameStartStatus
()
{
console
.
log
(
this
.
getNgameStartStatus
)
console
.
log
(
'onGotError_getNgameStartStatus'
);
}
onClick_rulebtn
()
{
console
.
log
(
'onClick_rulebtn'
);
this
.
bubbling
(
'showDialog'
,
'Rule'
);
}
onClick_recordbtn
()
{
console
.
log
(
'onClick_rulebtn'
);
//this.bubbling('showDialog', 'Rule');
}
onClick_rankbtn
()
{
alert
(
'onClick_rankbtn'
)
// globalEvent.emit('alert', {title: 'Success', content: 'You complete this puzzle', button: 'Next level'}, this.onAlertClose);
}
onDidEnter
(
last
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
):
void
{
this
.
entity
.
enabled
=
true
;
}
onDidLeave
(
next
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
):
void
{
this
.
entity
.
enabled
=
false
;
}
async
onWillEnter
(
last
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
)
{
}
async
onWillLeave
(
next
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
)
{
}
onWillMount
(
last
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
):
Promise
<
any
>
{
return
undefined
;
}
onWillUnMount
(
next
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
):
Promise
<
any
>
{
return
undefined
;
}
}
.history/assets/scripts/scenes/SceneStart_20190620162316.ts
0 → 100644
View file @
9d5f3970
/**
* Created by rockyl on 2019-04-09.
*/
import
ScillaComponent
from
"scilla-components/src/base/ScillaComponent"
;
import
{
dynamic
,
Entity
,
Tween
}
from
"scilla/src"
;
import
{
setText
}
from
"../entityUtils"
;
import
{
alien
}
from
"../navigator/StackNavigator"
;
import
Wave
from
'components/animation/Wave'
import
{
INavigatorViewBase
}
from
"../navigator/VirtualNavigator"
;
import
{
Transform
}
from
'scilla-components/src'
;
import
{
createTween
,
ease
}
from
"scilla"
;
export
default
class
SceneStart
extends
ScillaComponent
implements
INavigatorViewBase
{
ajaxElement
:
dynamic
;
doJoin
:
dynamic
;
getNgameStartStatus
:
dynamic
;
countTxt
:
Entity
;
startbtn
:
Entity
;
recordbtn
:
Entity
;
pingziFront
:
Entity
;
pingziBack
:
Entity
;
rankbtn
:
Entity
;
rulebtn
:
Entity
;
gouzi
:
Entity
;
private
startBtnAnimation
;
pingziFrontTransform
:
Transform
;
pingziBackTransform
:
Transform
;
gouziTransform
:
Transform
;
onAwake
()
{
super
.
onAwake
();
this
.
setCountText
(
''
);
this
.
startBtnAnimation
=
this
.
startbtn
.
getComponent
(
Transform
);
this
.
pingziFrontTransform
=
this
.
pingziFront
.
getComponent
(
Transform
);
this
.
pingziBackTransform
=
this
.
pingziBack
.
getComponent
(
Transform
);
this
.
gouziTransform
=
this
.
gouzi
.
getComponent
(
Transform
);
//Tween.
//egret.Tween.get(this.startBtn, {loop:true}).to({scaleX:0.9, scaleY:0.9}, 300).wait(1000).to({scaleX:1, scaleY:1}, 300);
// SingleSceneNavigator
console
.
log
(
"sd"
)
/* var sd=createTween(this.startBtnAnimation, this.startBtnAnimation)
.to({scaleX:1.2,scaleY:1.2}, 1200) */
/* createTween(this, this.startBtnAnimation)
.set({scale: {x: 0, y: 0}, alpha: 1})
.wait(100)
.to({scale: {x: 0.8, y: 0.8}}, 800)
.to({scale: {x: 1.1, y: 1.1}, alpha: 0}, 1200); */
createTween
(
this
,
this
.
startBtnAnimation
,
true
,{
loop
:
-
1
})
.
set
({
scale
:
{
x
:
1
,
y
:
1
}})
.
to
({
scale
:
{
x
:
.
9
,
y
:
.
9
}},
300
)
.
wait
(
1000
)
.
to
({
scale
:
{
x
:
1
,
y
:
1
}},
300
)
createTween
(
this
,
this
.
pingziFrontTransform
,
true
,{
loop
:
-
1
})
.
set
({
position
:
{
x
:
-
110
}})
.
to
({
position
:
{
x
:
110
}},
1000
)
createTween
(
this
,
this
.
pingziBackTransform
,
true
,{
loop
:
-
1
})
.
set
({
position
:
{
x
:
47.5
}})
.
to
({
position
:
{
x
:
-
152.5
}},
1000
)
createTween
(
this
,
this
.
gouziTransform
,
true
,{
loop
:
-
1
})
.
set
({
position
:
{
y
:
132.5
}})
.
to
({
position
:
{
y
:
335
}},
1000
)
.
to
({
position
:
{
y
:
132.5
}},
1000
)
//console.log(sd)
//.call(resolve);
}
private
setCountText
(
text
:
string
)
{
setText
(
this
.
countTxt
,
text
);
}
initGameStage
()
{
this
.
updateCountText
();
}
updateCountText
()
{
const
{
element
}
=
this
.
ajaxElement
;
let
text
=
''
if
(
element
.
freeLimit
>
0
)
{
text
=
`今日剩余免费次数:
${
element
.
freeLimit
}
次`
;
}
else
{
text
=
`
${
element
.
needCredits
}${
window
[
'CFG'
].
unitName
}
/次`
}
this
.
setCountText
(
text
);
}
onClick_startbtn
()
{
/* this.broadcast('callApi', 1, 'doJoin', {
activityId: window['CFG'].actId,
activityType: 'hdtool',
consumerId: window['CFG'].consumerId
}); */
if
(
window
[
'getDuibaToken'
])
{
window
[
'getDuibaToken'
]((
tokenObj
:
any
)
=>
{
this
.
broadcast
(
'callApi'
,
1
,
'doJoin'
,
{
token
:
tokenObj
.
token
,
activityId
:
window
[
'CFG'
].
actId
,
activityType
:
'hdtool'
,
consumerId
:
window
[
'CFG'
].
consumerId
});
},
(
key
:
string
,
messageObj
:
any
)
=>
{
this
.
onGotDojoinError
();
});
}
else
{
this
.
broadcast
(
'callApi'
,
1
,
'doJoin'
,
{
activityId
:
window
[
'CFG'
].
actId
,
activityType
:
'hdtool'
,
consumerId
:
window
[
'CFG'
].
consumerId
});
}
}
onGotDojoin
()
{
console
.
log
(
'onGotDojoin'
,
this
.
doJoin
);
this
.
broadcast
(
'callApi'
,
1
,
'getNgameStartStatus'
,
{
orderId
:
this
.
doJoin
});
}
onGotDojoinError
(
data
?)
{
console
.
log
(
'onGotDojoinError'
)
console
.
log
(
this
.
doJoin
)
console
.
log
(
data
)
}
onGot_getNgameStartStatus
()
{
console
.
log
(
'onGot_getNgameStartStatus'
,
this
.
getNgameStartStatus
);
//fuck 不可以循环引用
this
.
bubbling
(
'fuck'
,
'play'
);
}
onGotError_getNgameStartStatus
()
{
console
.
log
(
this
.
getNgameStartStatus
)
console
.
log
(
'onGotError_getNgameStartStatus'
);
}
onClick_rulebtn
()
{
console
.
log
(
'onClick_rulebtn'
);
this
.
bubbling
(
'showDialog'
,
'Rule'
);
}
onClick_recordbtn
()
{
console
.
log
(
'onClick_rulebtn'
);
//this.bubbling('showDialog', 'Rule');
}
onClick_rankbtn
()
{
alert
(
'onClick_rankbtn'
)
// globalEvent.emit('alert', {title: 'Success', content: 'You complete this puzzle', button: 'Next level'}, this.onAlertClose);
}
onDidEnter
(
last
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
):
void
{
this
.
entity
.
enabled
=
true
;
}
onDidLeave
(
next
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
):
void
{
this
.
entity
.
enabled
=
false
;
}
async
onWillEnter
(
last
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
)
{
}
async
onWillLeave
(
next
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
)
{
}
onWillMount
(
last
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
):
Promise
<
any
>
{
return
undefined
;
}
onWillUnMount
(
next
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
):
Promise
<
any
>
{
return
undefined
;
}
}
.history/assets/scripts/scenes/SceneStart_20190620163435.ts
0 → 100644
View file @
9d5f3970
/**
* Created by rockyl on 2019-04-09.
*/
import
ScillaComponent
from
"scilla-components/src/base/ScillaComponent"
;
import
{
dynamic
,
Entity
,
Tween
}
from
"scilla/src"
;
import
{
setText
}
from
"../entityUtils"
;
import
{
alien
}
from
"../navigator/StackNavigator"
;
import
Wave
from
'components/animation/Wave'
import
{
INavigatorViewBase
}
from
"../navigator/VirtualNavigator"
;
import
{
Transform
}
from
'scilla-components/src'
;
import
{
createTween
,
ease
}
from
"scilla"
;
export
default
class
SceneStart
extends
ScillaComponent
implements
INavigatorViewBase
{
ajaxElement
:
dynamic
;
doJoin
:
dynamic
;
getNgameStartStatus
:
dynamic
;
countTxt
:
Entity
;
startbtn
:
Entity
;
recordbtn
:
Entity
;
pingziFront
:
Entity
;
pingziBack
:
Entity
;
rankbtn
:
Entity
;
rulebtn
:
Entity
;
gouzi
:
Entity
;
pingzi_1
:
Entity
;
pingzi_2
:
Entity
;
gouzi_pingzi
:
Entity
;
private
startBtnAnimation
;
pingziFrontTransform
:
Transform
;
pingziBackTransform
:
Transform
;
gouziTransform
:
Transform
;
onAwake
()
{
super
.
onAwake
();
this
.
setCountText
(
''
);
this
.
startBtnAnimation
=
this
.
startbtn
.
getComponent
(
Transform
);
this
.
pingziFrontTransform
=
this
.
pingziFront
.
getComponent
(
Transform
);
this
.
pingziBackTransform
=
this
.
pingziBack
.
getComponent
(
Transform
);
this
.
gouziTransform
=
this
.
gouzi
.
getComponent
(
Transform
);
//Tween.
//egret.Tween.get(this.startBtn, {loop:true}).to({scaleX:0.9, scaleY:0.9}, 300).wait(1000).to({scaleX:1, scaleY:1}, 300);
// SingleSceneNavigator
console
.
log
(
"sd"
)
/* var sd=createTween(this.startBtnAnimation, this.startBtnAnimation)
.to({scaleX:1.2,scaleY:1.2}, 1200) */
/* createTween(this, this.startBtnAnimation)
.set({scale: {x: 0, y: 0}, alpha: 1})
.wait(100)
.to({scale: {x: 0.8, y: 0.8}}, 800)
.to({scale: {x: 1.1, y: 1.1}, alpha: 0}, 1200); */
createTween
(
this
,
this
.
startBtnAnimation
,
true
,{
loop
:
-
1
})
.
set
({
scale
:
{
x
:
1
,
y
:
1
}})
.
to
({
scale
:
{
x
:
.
9
,
y
:
.
9
}},
300
)
.
wait
(
1000
)
.
to
({
scale
:
{
x
:
1
,
y
:
1
}},
300
)
createTween
(
this
,
this
.
pingziFrontTransform
,
true
,{
loop
:
-
1
})
.
set
({
position
:
{
x
:
-
110
}})
.
to
({
position
:
{
x
:
110
}},
1000
)
createTween
(
this
,
this
.
pingziBackTransform
,
true
,{
loop
:
-
1
})
.
set
({
position
:
{
x
:
47.5
}})
.
to
({
position
:
{
x
:
-
152.5
}},
1000
)
createTween
(
this
,
this
.
gouziTransform
,
true
,{
loop
:
-
1
})
.
set
({
position
:
{
y
:
132.5
}})
.
to
({
position
:
{
y
:
335
}},
1000
)
.
to
({
position
:
{
y
:
132.5
}},
1000
)
//console.log(sd)
//.call(resolve);
}
private
setCountText
(
text
:
string
)
{
setText
(
this
.
countTxt
,
text
);
}
initGameStage
()
{
this
.
updateCountText
();
}
updateCountText
()
{
const
{
element
}
=
this
.
ajaxElement
;
let
text
=
''
if
(
element
.
freeLimit
>
0
)
{
text
=
`今日剩余免费次数:
${
element
.
freeLimit
}
次`
;
}
else
{
text
=
`
${
element
.
needCredits
}${
window
[
'CFG'
].
unitName
}
/次`
}
this
.
setCountText
(
text
);
}
onClick_startbtn
()
{
/* this.broadcast('callApi', 1, 'doJoin', {
activityId: window['CFG'].actId,
activityType: 'hdtool',
consumerId: window['CFG'].consumerId
}); */
if
(
window
[
'getDuibaToken'
])
{
window
[
'getDuibaToken'
]((
tokenObj
:
any
)
=>
{
this
.
broadcast
(
'callApi'
,
1
,
'doJoin'
,
{
token
:
tokenObj
.
token
,
activityId
:
window
[
'CFG'
].
actId
,
activityType
:
'hdtool'
,
consumerId
:
window
[
'CFG'
].
consumerId
});
},
(
key
:
string
,
messageObj
:
any
)
=>
{
this
.
onGotDojoinError
();
});
}
else
{
this
.
broadcast
(
'callApi'
,
1
,
'doJoin'
,
{
activityId
:
window
[
'CFG'
].
actId
,
activityType
:
'hdtool'
,
consumerId
:
window
[
'CFG'
].
consumerId
});
}
}
onGotDojoin
()
{
console
.
log
(
'onGotDojoin'
,
this
.
doJoin
);
this
.
broadcast
(
'callApi'
,
1
,
'getNgameStartStatus'
,
{
orderId
:
this
.
doJoin
});
}
onGotDojoinError
(
data
?)
{
console
.
log
(
'onGotDojoinError'
)
console
.
log
(
this
.
doJoin
)
console
.
log
(
data
)
}
onGot_getNgameStartStatus
()
{
console
.
log
(
'onGot_getNgameStartStatus'
,
this
.
getNgameStartStatus
);
//fuck 不可以循环引用
this
.
bubbling
(
'fuck'
,
'play'
);
}
onGotError_getNgameStartStatus
()
{
console
.
log
(
this
.
getNgameStartStatus
)
console
.
log
(
'onGotError_getNgameStartStatus'
);
}
onClick_rulebtn
()
{
console
.
log
(
'onClick_rulebtn'
);
this
.
bubbling
(
'showDialog'
,
'Rule'
);
}
onClick_recordbtn
()
{
console
.
log
(
'onClick_rulebtn'
);
//this.bubbling('showDialog', 'Rule');
}
onClick_rankbtn
()
{
alert
(
'onClick_rankbtn'
)
// globalEvent.emit('alert', {title: 'Success', content: 'You complete this puzzle', button: 'Next level'}, this.onAlertClose);
}
onDidEnter
(
last
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
):
void
{
this
.
entity
.
enabled
=
true
;
}
onDidLeave
(
next
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
):
void
{
this
.
entity
.
enabled
=
false
;
}
async
onWillEnter
(
last
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
)
{
}
async
onWillLeave
(
next
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
)
{
}
onWillMount
(
last
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
):
Promise
<
any
>
{
return
undefined
;
}
onWillUnMount
(
next
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
):
Promise
<
any
>
{
return
undefined
;
}
}
.history/assets/scripts/scenes/SceneStart_20190620163657.ts
0 → 100644
View file @
9d5f3970
/**
* Created by rockyl on 2019-04-09.
*/
import
ScillaComponent
from
"scilla-components/src/base/ScillaComponent"
;
import
{
dynamic
,
Entity
,
Tween
}
from
"scilla/src"
;
import
{
setText
}
from
"../entityUtils"
;
import
{
alien
}
from
"../navigator/StackNavigator"
;
import
Wave
from
'components/animation/Wave'
import
{
INavigatorViewBase
}
from
"../navigator/VirtualNavigator"
;
import
{
Transform
}
from
'scilla-components/src'
;
import
{
createTween
,
ease
}
from
"scilla"
;
export
default
class
SceneStart
extends
ScillaComponent
implements
INavigatorViewBase
{
ajaxElement
:
dynamic
;
doJoin
:
dynamic
;
getNgameStartStatus
:
dynamic
;
countTxt
:
Entity
;
startbtn
:
Entity
;
recordbtn
:
Entity
;
pingziFront
:
Entity
;
pingziBack
:
Entity
;
rankbtn
:
Entity
;
rulebtn
:
Entity
;
gouzi
:
Entity
;
pingzi_1
:
Entity
;
pingzi_2
:
Entity
;
gouzi_pingzi
:
Entity
;
private
startBtnAnimation
;
pingziFrontTransform
:
Transform
;
pingziBackTransform
:
Transform
;
gouziTransform
:
Transform
;
pingzi_1Transform
:
Transform
;
pingzi_2Transform
:
Transform
;
gouzi_pingziTransform
:
Transform
;
onAwake
()
{
super
.
onAwake
();
this
.
setCountText
(
''
);
this
.
startBtnAnimation
=
this
.
startbtn
.
getComponent
(
Transform
);
this
.
pingziFrontTransform
=
this
.
pingziFront
.
getComponent
(
Transform
);
this
.
pingziBackTransform
=
this
.
pingziBack
.
getComponent
(
Transform
);
this
.
gouziTransform
=
this
.
gouzi
.
getComponent
(
Transform
);
this
.
pingzi_1Transform
=
this
.
pingzi_1
.
getComponent
(
Transform
);
this
.
pingzi_2Transform
=
this
.
pingzi_2
.
getComponent
(
Transform
);
this
.
gouzi_pingziTransform
=
this
.
gouzi_pingzi
.
getComponent
(
Transform
);
//Tween.
//egret.Tween.get(this.startBtn, {loop:true}).to({scaleX:0.9, scaleY:0.9}, 300).wait(1000).to({scaleX:1, scaleY:1}, 300);
// SingleSceneNavigator
console
.
log
(
"sd"
)
/* var sd=createTween(this.startBtnAnimation, this.startBtnAnimation)
.to({scaleX:1.2,scaleY:1.2}, 1200) */
/* createTween(this, this.startBtnAnimation)
.set({scale: {x: 0, y: 0}, alpha: 1})
.wait(100)
.to({scale: {x: 0.8, y: 0.8}}, 800)
.to({scale: {x: 1.1, y: 1.1}, alpha: 0}, 1200); */
createTween
(
this
,
this
.
startBtnAnimation
,
true
,{
loop
:
-
1
})
.
set
({
scale
:
{
x
:
1
,
y
:
1
}})
.
to
({
scale
:
{
x
:
.
9
,
y
:
.
9
}},
300
)
.
wait
(
1000
)
.
to
({
scale
:
{
x
:
1
,
y
:
1
}},
300
)
createTween
(
this
,
this
.
pingziFrontTransform
,
true
,{
loop
:
-
1
})
.
set
({
position
:
{
x
:
-
110
}})
.
to
({
position
:
{
x
:
110
}},
1000
)
createTween
(
this
,
this
.
pingziBackTransform
,
true
,{
loop
:
-
1
})
.
set
({
position
:
{
x
:
47.5
}})
.
to
({
position
:
{
x
:
-
152.5
}},
1000
)
createTween
(
this
,
this
.
gouziTransform
,
true
,{
loop
:
-
1
})
.
set
({
position
:
{
y
:
132.5
}})
.
to
({
position
:
{
y
:
335
}},
1000
)
.
to
({
position
:
{
y
:
132.5
}},
1000
)
//console.log(sd)
//.call(resolve);
}
private
setCountText
(
text
:
string
)
{
setText
(
this
.
countTxt
,
text
);
}
initGameStage
()
{
this
.
updateCountText
();
}
updateCountText
()
{
const
{
element
}
=
this
.
ajaxElement
;
let
text
=
''
if
(
element
.
freeLimit
>
0
)
{
text
=
`今日剩余免费次数:
${
element
.
freeLimit
}
次`
;
}
else
{
text
=
`
${
element
.
needCredits
}${
window
[
'CFG'
].
unitName
}
/次`
}
this
.
setCountText
(
text
);
}
onClick_startbtn
()
{
/* this.broadcast('callApi', 1, 'doJoin', {
activityId: window['CFG'].actId,
activityType: 'hdtool',
consumerId: window['CFG'].consumerId
}); */
if
(
window
[
'getDuibaToken'
])
{
window
[
'getDuibaToken'
]((
tokenObj
:
any
)
=>
{
this
.
broadcast
(
'callApi'
,
1
,
'doJoin'
,
{
token
:
tokenObj
.
token
,
activityId
:
window
[
'CFG'
].
actId
,
activityType
:
'hdtool'
,
consumerId
:
window
[
'CFG'
].
consumerId
});
},
(
key
:
string
,
messageObj
:
any
)
=>
{
this
.
onGotDojoinError
();
});
}
else
{
this
.
broadcast
(
'callApi'
,
1
,
'doJoin'
,
{
activityId
:
window
[
'CFG'
].
actId
,
activityType
:
'hdtool'
,
consumerId
:
window
[
'CFG'
].
consumerId
});
}
}
onGotDojoin
()
{
console
.
log
(
'onGotDojoin'
,
this
.
doJoin
);
this
.
broadcast
(
'callApi'
,
1
,
'getNgameStartStatus'
,
{
orderId
:
this
.
doJoin
});
}
onGotDojoinError
(
data
?)
{
console
.
log
(
'onGotDojoinError'
)
console
.
log
(
this
.
doJoin
)
console
.
log
(
data
)
}
onGot_getNgameStartStatus
()
{
console
.
log
(
'onGot_getNgameStartStatus'
,
this
.
getNgameStartStatus
);
//fuck 不可以循环引用
this
.
bubbling
(
'fuck'
,
'play'
);
}
onGotError_getNgameStartStatus
()
{
console
.
log
(
this
.
getNgameStartStatus
)
console
.
log
(
'onGotError_getNgameStartStatus'
);
}
onClick_rulebtn
()
{
console
.
log
(
'onClick_rulebtn'
);
this
.
bubbling
(
'showDialog'
,
'Rule'
);
}
onClick_recordbtn
()
{
console
.
log
(
'onClick_rulebtn'
);
//this.bubbling('showDialog', 'Rule');
}
onClick_rankbtn
()
{
alert
(
'onClick_rankbtn'
)
// globalEvent.emit('alert', {title: 'Success', content: 'You complete this puzzle', button: 'Next level'}, this.onAlertClose);
}
onDidEnter
(
last
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
):
void
{
this
.
entity
.
enabled
=
true
;
}
onDidLeave
(
next
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
):
void
{
this
.
entity
.
enabled
=
false
;
}
async
onWillEnter
(
last
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
)
{
}
async
onWillLeave
(
next
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
)
{
}
onWillMount
(
last
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
):
Promise
<
any
>
{
return
undefined
;
}
onWillUnMount
(
next
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
):
Promise
<
any
>
{
return
undefined
;
}
}
.history/assets/scripts/scenes/SceneStart_20190620163812.ts
0 → 100644
View file @
9d5f3970
/**
* Created by rockyl on 2019-04-09.
*/
import
ScillaComponent
from
"scilla-components/src/base/ScillaComponent"
;
import
{
dynamic
,
Entity
,
Tween
}
from
"scilla/src"
;
import
{
setText
}
from
"../entityUtils"
;
import
{
alien
}
from
"../navigator/StackNavigator"
;
import
Wave
from
'components/animation/Wave'
import
{
INavigatorViewBase
}
from
"../navigator/VirtualNavigator"
;
import
{
Transform
}
from
'scilla-components/src'
;
import
{
createTween
,
ease
}
from
"scilla"
;
export
default
class
SceneStart
extends
ScillaComponent
implements
INavigatorViewBase
{
ajaxElement
:
dynamic
;
doJoin
:
dynamic
;
getNgameStartStatus
:
dynamic
;
countTxt
:
Entity
;
startbtn
:
Entity
;
recordbtn
:
Entity
;
pingziFront
:
Entity
;
pingziBack
:
Entity
;
rankbtn
:
Entity
;
rulebtn
:
Entity
;
gouzi
:
Entity
;
pingzi_1
:
Entity
;
pingzi_2
:
Entity
;
gouzi_pingzi
:
Entity
;
private
startBtnAnimation
;
pingziFrontTransform
:
Transform
;
pingziBackTransform
:
Transform
;
gouziTransform
:
Transform
;
pingzi_1Transform
:
Transform
;
pingzi_2Transform
:
Transform
;
gouzi_pingziTransform
:
Transform
;
onAwake
()
{
super
.
onAwake
();
this
.
setCountText
(
''
);
this
.
startBtnAnimation
=
this
.
startbtn
.
getComponent
(
Transform
);
this
.
pingziFrontTransform
=
this
.
pingziFront
.
getComponent
(
Transform
);
this
.
pingziBackTransform
=
this
.
pingziBack
.
getComponent
(
Transform
);
this
.
gouziTransform
=
this
.
gouzi
.
getComponent
(
Transform
);
this
.
pingzi_1Transform
=
this
.
pingzi_1
.
getComponent
(
Transform
);
this
.
pingzi_2Transform
=
this
.
pingzi_2
.
getComponent
(
Transform
);
this
.
gouzi_pingziTransform
=
this
.
gouzi_pingzi
.
getComponent
(
Transform
);
//Tween.
//egret.Tween.get(this.startBtn, {loop:true}).to({scaleX:0.9, scaleY:0.9}, 300).wait(1000).to({scaleX:1, scaleY:1}, 300);
// SingleSceneNavigator
console
.
log
(
"sd"
)
/* var sd=createTween(this.startBtnAnimation, this.startBtnAnimation)
.to({scaleX:1.2,scaleY:1.2}, 1200) */
/* createTween(this, this.startBtnAnimation)
.set({scale: {x: 0, y: 0}, alpha: 1})
.wait(100)
.to({scale: {x: 0.8, y: 0.8}}, 800)
.to({scale: {x: 1.1, y: 1.1}, alpha: 0}, 1200); */
createTween
(
this
,
this
.
startBtnAnimation
,
true
,{
loop
:
-
1
})
.
set
({
scale
:
{
x
:
1
,
y
:
1
}})
.
to
({
scale
:
{
x
:
.
9
,
y
:
.
9
}},
300
)
.
wait
(
1000
)
.
to
({
scale
:
{
x
:
1
,
y
:
1
}},
300
)
createTween
(
this
,
this
.
pingziFrontTransform
,
true
,{
loop
:
-
1
})
.
set
({
position
:
{
x
:
-
110
}})
.
to
({
position
:
{
x
:
110
}},
1000
)
createTween
(
this
,
this
.
pingziBackTransform
,
true
,{
loop
:
-
1
})
.
set
({
position
:
{
x
:
47.5
}})
.
to
({
position
:
{
x
:
-
152.5
}},
1000
)
createTween
(
this
,
this
.
gouziTransform
,
true
,{
loop
:
0
})
.
set
({
position
:
{
y
:
132.5
}})
.
to
({
position
:
{
y
:
335
}},
1000
)
.
call
(()
=>
{
console
.
log
(
`1`
)
})
.
to
({
position
:
{
y
:
132.5
}},
1000
)
.
call
(()
=>
{
console
.
log
(
`2`
)
})
//console.log(sd)
//.call(resolve);
}
private
setCountText
(
text
:
string
)
{
setText
(
this
.
countTxt
,
text
);
}
initGameStage
()
{
this
.
updateCountText
();
}
updateCountText
()
{
const
{
element
}
=
this
.
ajaxElement
;
let
text
=
''
if
(
element
.
freeLimit
>
0
)
{
text
=
`今日剩余免费次数:
${
element
.
freeLimit
}
次`
;
}
else
{
text
=
`
${
element
.
needCredits
}${
window
[
'CFG'
].
unitName
}
/次`
}
this
.
setCountText
(
text
);
}
onClick_startbtn
()
{
/* this.broadcast('callApi', 1, 'doJoin', {
activityId: window['CFG'].actId,
activityType: 'hdtool',
consumerId: window['CFG'].consumerId
}); */
if
(
window
[
'getDuibaToken'
])
{
window
[
'getDuibaToken'
]((
tokenObj
:
any
)
=>
{
this
.
broadcast
(
'callApi'
,
1
,
'doJoin'
,
{
token
:
tokenObj
.
token
,
activityId
:
window
[
'CFG'
].
actId
,
activityType
:
'hdtool'
,
consumerId
:
window
[
'CFG'
].
consumerId
});
},
(
key
:
string
,
messageObj
:
any
)
=>
{
this
.
onGotDojoinError
();
});
}
else
{
this
.
broadcast
(
'callApi'
,
1
,
'doJoin'
,
{
activityId
:
window
[
'CFG'
].
actId
,
activityType
:
'hdtool'
,
consumerId
:
window
[
'CFG'
].
consumerId
});
}
}
onGotDojoin
()
{
console
.
log
(
'onGotDojoin'
,
this
.
doJoin
);
this
.
broadcast
(
'callApi'
,
1
,
'getNgameStartStatus'
,
{
orderId
:
this
.
doJoin
});
}
onGotDojoinError
(
data
?)
{
console
.
log
(
'onGotDojoinError'
)
console
.
log
(
this
.
doJoin
)
console
.
log
(
data
)
}
onGot_getNgameStartStatus
()
{
console
.
log
(
'onGot_getNgameStartStatus'
,
this
.
getNgameStartStatus
);
//fuck 不可以循环引用
this
.
bubbling
(
'fuck'
,
'play'
);
}
onGotError_getNgameStartStatus
()
{
console
.
log
(
this
.
getNgameStartStatus
)
console
.
log
(
'onGotError_getNgameStartStatus'
);
}
onClick_rulebtn
()
{
console
.
log
(
'onClick_rulebtn'
);
this
.
bubbling
(
'showDialog'
,
'Rule'
);
}
onClick_recordbtn
()
{
console
.
log
(
'onClick_rulebtn'
);
//this.bubbling('showDialog', 'Rule');
}
onClick_rankbtn
()
{
alert
(
'onClick_rankbtn'
)
// globalEvent.emit('alert', {title: 'Success', content: 'You complete this puzzle', button: 'Next level'}, this.onAlertClose);
}
onDidEnter
(
last
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
):
void
{
this
.
entity
.
enabled
=
true
;
}
onDidLeave
(
next
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
):
void
{
this
.
entity
.
enabled
=
false
;
}
async
onWillEnter
(
last
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
)
{
}
async
onWillLeave
(
next
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
)
{
}
onWillMount
(
last
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
):
Promise
<
any
>
{
return
undefined
;
}
onWillUnMount
(
next
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
):
Promise
<
any
>
{
return
undefined
;
}
}
.history/assets/scripts/scenes/SceneStart_20190620163840.ts
0 → 100644
View file @
9d5f3970
/**
* Created by rockyl on 2019-04-09.
*/
import
ScillaComponent
from
"scilla-components/src/base/ScillaComponent"
;
import
{
dynamic
,
Entity
,
Tween
}
from
"scilla/src"
;
import
{
setText
}
from
"../entityUtils"
;
import
{
alien
}
from
"../navigator/StackNavigator"
;
import
Wave
from
'components/animation/Wave'
import
{
INavigatorViewBase
}
from
"../navigator/VirtualNavigator"
;
import
{
Transform
}
from
'scilla-components/src'
;
import
{
createTween
,
ease
}
from
"scilla"
;
export
default
class
SceneStart
extends
ScillaComponent
implements
INavigatorViewBase
{
ajaxElement
:
dynamic
;
doJoin
:
dynamic
;
getNgameStartStatus
:
dynamic
;
countTxt
:
Entity
;
startbtn
:
Entity
;
recordbtn
:
Entity
;
pingziFront
:
Entity
;
pingziBack
:
Entity
;
rankbtn
:
Entity
;
rulebtn
:
Entity
;
gouzi
:
Entity
;
pingzi_1
:
Entity
;
pingzi_2
:
Entity
;
gouzi_pingzi
:
Entity
;
private
startBtnAnimation
;
pingziFrontTransform
:
Transform
;
pingziBackTransform
:
Transform
;
gouziTransform
:
Transform
;
pingzi_1Transform
:
Transform
;
pingzi_2Transform
:
Transform
;
gouzi_pingziTransform
:
Transform
;
onAwake
()
{
super
.
onAwake
();
this
.
setCountText
(
''
);
this
.
startBtnAnimation
=
this
.
startbtn
.
getComponent
(
Transform
);
this
.
pingziFrontTransform
=
this
.
pingziFront
.
getComponent
(
Transform
);
this
.
pingziBackTransform
=
this
.
pingziBack
.
getComponent
(
Transform
);
this
.
gouziTransform
=
this
.
gouzi
.
getComponent
(
Transform
);
this
.
pingzi_1Transform
=
this
.
pingzi_1
.
getComponent
(
Transform
);
this
.
pingzi_2Transform
=
this
.
pingzi_2
.
getComponent
(
Transform
);
this
.
gouzi_pingziTransform
=
this
.
gouzi_pingzi
.
getComponent
(
Transform
);
//Tween.
//egret.Tween.get(this.startBtn, {loop:true}).to({scaleX:0.9, scaleY:0.9}, 300).wait(1000).to({scaleX:1, scaleY:1}, 300);
// SingleSceneNavigator
console
.
log
(
"sd"
)
/* var sd=createTween(this.startBtnAnimation, this.startBtnAnimation)
.to({scaleX:1.2,scaleY:1.2}, 1200) */
/* createTween(this, this.startBtnAnimation)
.set({scale: {x: 0, y: 0}, alpha: 1})
.wait(100)
.to({scale: {x: 0.8, y: 0.8}}, 800)
.to({scale: {x: 1.1, y: 1.1}, alpha: 0}, 1200); */
createTween
(
this
,
this
.
startBtnAnimation
,
true
,{
loop
:
-
1
})
.
set
({
scale
:
{
x
:
1
,
y
:
1
}})
.
to
({
scale
:
{
x
:
.
9
,
y
:
.
9
}},
300
)
.
wait
(
1000
)
.
to
({
scale
:
{
x
:
1
,
y
:
1
}},
300
)
createTween
(
this
,
this
.
pingziFrontTransform
,
true
,{
loop
:
-
1
})
.
set
({
position
:
{
x
:
-
110
}})
.
to
({
position
:
{
x
:
110
}},
1000
)
createTween
(
this
,
this
.
pingziBackTransform
,
true
,{
loop
:
-
1
})
.
set
({
position
:
{
x
:
47.5
}})
.
to
({
position
:
{
x
:
-
152.5
}},
1000
)
createTween
(
this
,
this
.
gouziTransform
,
true
,{
loop
:
-
1
})
.
set
({
position
:
{
y
:
132.5
}})
.
to
({
position
:
{
y
:
335
}},
1000
)
.
call
(()
=>
{
console
.
log
(
`1`
)
})
.
to
({
position
:
{
y
:
132.5
}},
1000
)
.
call
(()
=>
{
console
.
log
(
`2`
)
})
//console.log(sd)
//.call(resolve);
}
private
setCountText
(
text
:
string
)
{
setText
(
this
.
countTxt
,
text
);
}
initGameStage
()
{
this
.
updateCountText
();
}
updateCountText
()
{
const
{
element
}
=
this
.
ajaxElement
;
let
text
=
''
if
(
element
.
freeLimit
>
0
)
{
text
=
`今日剩余免费次数:
${
element
.
freeLimit
}
次`
;
}
else
{
text
=
`
${
element
.
needCredits
}${
window
[
'CFG'
].
unitName
}
/次`
}
this
.
setCountText
(
text
);
}
onClick_startbtn
()
{
/* this.broadcast('callApi', 1, 'doJoin', {
activityId: window['CFG'].actId,
activityType: 'hdtool',
consumerId: window['CFG'].consumerId
}); */
if
(
window
[
'getDuibaToken'
])
{
window
[
'getDuibaToken'
]((
tokenObj
:
any
)
=>
{
this
.
broadcast
(
'callApi'
,
1
,
'doJoin'
,
{
token
:
tokenObj
.
token
,
activityId
:
window
[
'CFG'
].
actId
,
activityType
:
'hdtool'
,
consumerId
:
window
[
'CFG'
].
consumerId
});
},
(
key
:
string
,
messageObj
:
any
)
=>
{
this
.
onGotDojoinError
();
});
}
else
{
this
.
broadcast
(
'callApi'
,
1
,
'doJoin'
,
{
activityId
:
window
[
'CFG'
].
actId
,
activityType
:
'hdtool'
,
consumerId
:
window
[
'CFG'
].
consumerId
});
}
}
onGotDojoin
()
{
console
.
log
(
'onGotDojoin'
,
this
.
doJoin
);
this
.
broadcast
(
'callApi'
,
1
,
'getNgameStartStatus'
,
{
orderId
:
this
.
doJoin
});
}
onGotDojoinError
(
data
?)
{
console
.
log
(
'onGotDojoinError'
)
console
.
log
(
this
.
doJoin
)
console
.
log
(
data
)
}
onGot_getNgameStartStatus
()
{
console
.
log
(
'onGot_getNgameStartStatus'
,
this
.
getNgameStartStatus
);
//fuck 不可以循环引用
this
.
bubbling
(
'fuck'
,
'play'
);
}
onGotError_getNgameStartStatus
()
{
console
.
log
(
this
.
getNgameStartStatus
)
console
.
log
(
'onGotError_getNgameStartStatus'
);
}
onClick_rulebtn
()
{
console
.
log
(
'onClick_rulebtn'
);
this
.
bubbling
(
'showDialog'
,
'Rule'
);
}
onClick_recordbtn
()
{
console
.
log
(
'onClick_rulebtn'
);
//this.bubbling('showDialog', 'Rule');
}
onClick_rankbtn
()
{
alert
(
'onClick_rankbtn'
)
// globalEvent.emit('alert', {title: 'Success', content: 'You complete this puzzle', button: 'Next level'}, this.onAlertClose);
}
onDidEnter
(
last
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
):
void
{
this
.
entity
.
enabled
=
true
;
}
onDidLeave
(
next
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
):
void
{
this
.
entity
.
enabled
=
false
;
}
async
onWillEnter
(
last
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
)
{
}
async
onWillLeave
(
next
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
)
{
}
onWillMount
(
last
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
):
Promise
<
any
>
{
return
undefined
;
}
onWillUnMount
(
next
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
):
Promise
<
any
>
{
return
undefined
;
}
}
.history/assets/scripts/scenes/SceneStart_20190620164131.ts
0 → 100644
View file @
9d5f3970
/**
* Created by rockyl on 2019-04-09.
*/
import
ScillaComponent
from
"scilla-components/src/base/ScillaComponent"
;
import
{
dynamic
,
Entity
,
Tween
}
from
"scilla/src"
;
import
{
setText
}
from
"../entityUtils"
;
import
{
alien
}
from
"../navigator/StackNavigator"
;
import
Wave
from
'components/animation/Wave'
import
{
INavigatorViewBase
}
from
"../navigator/VirtualNavigator"
;
import
{
Transform
}
from
'scilla-components/src'
;
import
{
createTween
,
ease
}
from
"scilla"
;
export
default
class
SceneStart
extends
ScillaComponent
implements
INavigatorViewBase
{
ajaxElement
:
dynamic
;
doJoin
:
dynamic
;
getNgameStartStatus
:
dynamic
;
countTxt
:
Entity
;
startbtn
:
Entity
;
recordbtn
:
Entity
;
pingziFront
:
Entity
;
pingziBack
:
Entity
;
rankbtn
:
Entity
;
rulebtn
:
Entity
;
gouzi
:
Entity
;
pingzi_1
:
Entity
;
pingzi_2
:
Entity
;
gouzi_pingzi
:
Entity
;
private
startBtnAnimation
;
pingziFrontTransform
:
Transform
;
pingziBackTransform
:
Transform
;
gouziTransform
:
Transform
;
pingzi_1Transform
:
Transform
;
pingzi_2Transform
:
Transform
;
gouzi_pingziTransform
:
Transform
;
onAwake
()
{
super
.
onAwake
();
this
.
setCountText
(
''
);
this
.
startBtnAnimation
=
this
.
startbtn
.
getComponent
(
Transform
);
this
.
pingziFrontTransform
=
this
.
pingziFront
.
getComponent
(
Transform
);
this
.
pingziBackTransform
=
this
.
pingziBack
.
getComponent
(
Transform
);
this
.
gouziTransform
=
this
.
gouzi
.
getComponent
(
Transform
);
this
.
pingzi_1Transform
=
this
.
pingzi_1
.
getComponent
(
Transform
);
this
.
pingzi_2Transform
=
this
.
pingzi_2
.
getComponent
(
Transform
);
this
.
gouzi_pingziTransform
=
this
.
gouzi_pingzi
.
getComponent
(
Transform
);
this
.
grabState
=
false
;
this
.
hasPrize
=
false
;
//Tween.
//egret.Tween.get(this.startBtn, {loop:true}).to({scaleX:0.9, scaleY:0.9}, 300).wait(1000).to({scaleX:1, scaleY:1}, 300);
// SingleSceneNavigator
console
.
log
(
"sd"
)
/* var sd=createTween(this.startBtnAnimation, this.startBtnAnimation)
.to({scaleX:1.2,scaleY:1.2}, 1200) */
/* createTween(this, this.startBtnAnimation)
.set({scale: {x: 0, y: 0}, alpha: 1})
.wait(100)
.to({scale: {x: 0.8, y: 0.8}}, 800)
.to({scale: {x: 1.1, y: 1.1}, alpha: 0}, 1200); */
createTween
(
this
,
this
.
startBtnAnimation
,
true
,{
loop
:
-
1
})
.
set
({
scale
:
{
x
:
1
,
y
:
1
}})
.
to
({
scale
:
{
x
:
.
9
,
y
:
.
9
}},
300
)
.
wait
(
1000
)
.
to
({
scale
:
{
x
:
1
,
y
:
1
}},
300
)
createTween
(
this
,
this
.
pingziFrontTransform
,
true
,{
loop
:
-
1
})
.
set
({
position
:
{
x
:
-
110
}})
.
to
({
position
:
{
x
:
110
}},
1000
)
createTween
(
this
,
this
.
pingziBackTransform
,
true
,{
loop
:
-
1
})
.
set
({
position
:
{
x
:
47.5
}})
.
to
({
position
:
{
x
:
-
152.5
}},
1000
)
createTween
(
this
,
this
.
gouziTransform
,
true
,{
loop
:
-
1
})
.
set
({
position
:
{
y
:
132.5
}})
.
to
({
position
:
{
y
:
335
}},
1000
)
.
call
(()
=>
{
console
.
log
(
`1`
)
})
.
to
({
position
:
{
y
:
132.5
}},
1000
)
.
call
(()
=>
{
console
.
log
(
`2`
)
})
//console.log(sd)
//.call(resolve);
}
private
setCountText
(
text
:
string
)
{
setText
(
this
.
countTxt
,
text
);
}
initGameStage
()
{
this
.
updateCountText
();
}
updateCountText
()
{
const
{
element
}
=
this
.
ajaxElement
;
let
text
=
''
if
(
element
.
freeLimit
>
0
)
{
text
=
`今日剩余免费次数:
${
element
.
freeLimit
}
次`
;
}
else
{
text
=
`
${
element
.
needCredits
}${
window
[
'CFG'
].
unitName
}
/次`
}
this
.
setCountText
(
text
);
}
grabState
=
false
;
hasPrize
=
false
;
onClick_startbtn
()
{
this
.
grabState
=
true
;
this
.
hasPrize
=
true
;
/* if (window['getDuibaToken']) {
window['getDuibaToken']((tokenObj: any) => {
this.broadcast('callApi', 1, 'doJoin', {
token:tokenObj.token,
activityId: window['CFG'].actId,
activityType: 'hdtool',
consumerId: window['CFG'].consumerId
});
}, (key: string, messageObj: any) => {
this.onGotDojoinError();
});
} else {
this.broadcast('callApi', 1, 'doJoin', {
activityId: window['CFG'].actId,
activityType: 'hdtool',
consumerId: window['CFG'].consumerId
});
} */
}
onGotDojoin
()
{
console
.
log
(
'onGotDojoin'
,
this
.
doJoin
);
this
.
broadcast
(
'callApi'
,
1
,
'getNgameStartStatus'
,
{
orderId
:
this
.
doJoin
});
}
onGotDojoinError
(
data
?)
{
console
.
log
(
'onGotDojoinError'
)
console
.
log
(
this
.
doJoin
)
console
.
log
(
data
)
}
onGot_getNgameStartStatus
()
{
console
.
log
(
'onGot_getNgameStartStatus'
,
this
.
getNgameStartStatus
);
//fuck 不可以循环引用
this
.
bubbling
(
'fuck'
,
'play'
);
}
onGotError_getNgameStartStatus
()
{
console
.
log
(
this
.
getNgameStartStatus
)
console
.
log
(
'onGotError_getNgameStartStatus'
);
}
onClick_rulebtn
()
{
console
.
log
(
'onClick_rulebtn'
);
this
.
bubbling
(
'showDialog'
,
'Rule'
);
}
onClick_recordbtn
()
{
console
.
log
(
'onClick_rulebtn'
);
//this.bubbling('showDialog', 'Rule');
}
onClick_rankbtn
()
{
alert
(
'onClick_rankbtn'
)
// globalEvent.emit('alert', {title: 'Success', content: 'You complete this puzzle', button: 'Next level'}, this.onAlertClose);
}
onDidEnter
(
last
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
):
void
{
this
.
entity
.
enabled
=
true
;
}
onDidLeave
(
next
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
):
void
{
this
.
entity
.
enabled
=
false
;
}
async
onWillEnter
(
last
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
)
{
}
async
onWillLeave
(
next
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
)
{
}
onWillMount
(
last
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
):
Promise
<
any
>
{
return
undefined
;
}
onWillUnMount
(
next
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
):
Promise
<
any
>
{
return
undefined
;
}
}
.history/assets/scripts/scenes/SceneStart_20190620164507.ts
0 → 100644
View file @
9d5f3970
/**
* Created by rockyl on 2019-04-09.
*/
import
ScillaComponent
from
"scilla-components/src/base/ScillaComponent"
;
import
{
dynamic
,
Entity
,
Tween
}
from
"scilla/src"
;
import
{
setText
}
from
"../entityUtils"
;
import
{
alien
}
from
"../navigator/StackNavigator"
;
import
Wave
from
'components/animation/Wave'
import
{
INavigatorViewBase
}
from
"../navigator/VirtualNavigator"
;
import
{
Transform
}
from
'scilla-components/src'
;
import
{
createTween
,
ease
}
from
"scilla"
;
export
default
class
SceneStart
extends
ScillaComponent
implements
INavigatorViewBase
{
ajaxElement
:
dynamic
;
doJoin
:
dynamic
;
getNgameStartStatus
:
dynamic
;
countTxt
:
Entity
;
startbtn
:
Entity
;
recordbtn
:
Entity
;
pingziFront
:
Entity
;
pingziBack
:
Entity
;
rankbtn
:
Entity
;
rulebtn
:
Entity
;
gouzi
:
Entity
;
pingzi_1
:
Entity
;
pingzi_2
:
Entity
;
gouzi_pingzi
:
Entity
;
private
startBtnAnimation
;
pingziFrontTransform
:
Transform
;
pingziBackTransform
:
Transform
;
gouziTransform
:
Transform
;
pingzi_1Transform
:
Transform
;
pingzi_2Transform
:
Transform
;
gouzi_pingziTransform
:
Transform
;
onAwake
()
{
super
.
onAwake
();
this
.
setCountText
(
''
);
this
.
startBtnAnimation
=
this
.
startbtn
.
getComponent
(
Transform
);
this
.
pingziFrontTransform
=
this
.
pingziFront
.
getComponent
(
Transform
);
this
.
pingziBackTransform
=
this
.
pingziBack
.
getComponent
(
Transform
);
this
.
gouziTransform
=
this
.
gouzi
.
getComponent
(
Transform
);
this
.
pingzi_1Transform
=
this
.
pingzi_1
.
getComponent
(
Transform
);
this
.
pingzi_2Transform
=
this
.
pingzi_2
.
getComponent
(
Transform
);
this
.
gouzi_pingziTransform
=
this
.
gouzi_pingzi
.
getComponent
(
Transform
);
this
.
grabState
=
false
;
this
.
hasPrize
=
false
;
//Tween.
//egret.Tween.get(this.startBtn, {loop:true}).to({scaleX:0.9, scaleY:0.9}, 300).wait(1000).to({scaleX:1, scaleY:1}, 300);
// SingleSceneNavigator
console
.
log
(
"sd"
)
/* var sd=createTween(this.startBtnAnimation, this.startBtnAnimation)
.to({scaleX:1.2,scaleY:1.2}, 1200) */
/* createTween(this, this.startBtnAnimation)
.set({scale: {x: 0, y: 0}, alpha: 1})
.wait(100)
.to({scale: {x: 0.8, y: 0.8}}, 800)
.to({scale: {x: 1.1, y: 1.1}, alpha: 0}, 1200); */
this
.
gouzi_pingziTransform
.
alpha
=
0
createTween
(
this
,
this
.
startBtnAnimation
,
true
,{
loop
:
-
1
})
.
set
({
scale
:
{
x
:
1
,
y
:
1
}})
.
to
({
scale
:
{
x
:
.
9
,
y
:
.
9
}},
300
)
.
wait
(
1000
)
.
to
({
scale
:
{
x
:
1
,
y
:
1
}},
300
)
createTween
(
this
,
this
.
pingziBackTransform
,
true
,{
loop
:
-
1
})
.
set
({
position
:
{
x
:
47.5
}})
.
to
({
position
:
{
x
:
-
152.5
}},
1000
)
createTween
(
this
,
this
.
pingziFrontTransform
,
true
,{
loop
:
-
1
})
.
set
({
position
:
{
x
:
-
110
}})
.
to
({
position
:
{
x
:
110
}},
1000
)
.
call
(()
=>
{
//console.log(`2`)
if
(
this
.
grabState
){
var
time
=
1000
;
if
(
this
.
hasPrize
){
time
=
1000
;
}
else
{
time
=
1500
;
}
createTween
(
this
,
this
.
gouziTransform
,
true
,{
loop
:
0
})
.
set
({
position
:
{
y
:
132.5
}})
.
to
({
position
:
{
y
:
335
}},
1000
)
.
call
(()
=>
{
//console.log(`1`)
this
.
gouzi_pingziTransform
.
alpha
=
1
})
.
to
({
position
:
{
y
:
132.5
}},
1000
)
.
call
(()
=>
{
this
.
gouzi_pingziTransform
.
alpha
=
0
console
.
log
(
`2`
)
})
//
}
})
//console.log(sd)
//.call(resolve);
}
private
setCountText
(
text
:
string
)
{
setText
(
this
.
countTxt
,
text
);
}
initGameStage
()
{
this
.
updateCountText
();
}
updateCountText
()
{
const
{
element
}
=
this
.
ajaxElement
;
let
text
=
''
if
(
element
.
freeLimit
>
0
)
{
text
=
`今日剩余免费次数:
${
element
.
freeLimit
}
次`
;
}
else
{
text
=
`
${
element
.
needCredits
}${
window
[
'CFG'
].
unitName
}
/次`
}
this
.
setCountText
(
text
);
}
grabState
=
false
;
hasPrize
=
false
;
onClick_startbtn
()
{
this
.
grabState
=
true
;
this
.
hasPrize
=
true
;
/* if (window['getDuibaToken']) {
window['getDuibaToken']((tokenObj: any) => {
this.broadcast('callApi', 1, 'doJoin', {
token:tokenObj.token,
activityId: window['CFG'].actId,
activityType: 'hdtool',
consumerId: window['CFG'].consumerId
});
}, (key: string, messageObj: any) => {
this.onGotDojoinError();
});
} else {
this.broadcast('callApi', 1, 'doJoin', {
activityId: window['CFG'].actId,
activityType: 'hdtool',
consumerId: window['CFG'].consumerId
});
} */
}
onGotDojoin
()
{
console
.
log
(
'onGotDojoin'
,
this
.
doJoin
);
this
.
broadcast
(
'callApi'
,
1
,
'getNgameStartStatus'
,
{
orderId
:
this
.
doJoin
});
}
onGotDojoinError
(
data
?)
{
console
.
log
(
'onGotDojoinError'
)
console
.
log
(
this
.
doJoin
)
console
.
log
(
data
)
}
onGot_getNgameStartStatus
()
{
console
.
log
(
'onGot_getNgameStartStatus'
,
this
.
getNgameStartStatus
);
//fuck 不可以循环引用
this
.
bubbling
(
'fuck'
,
'play'
);
}
onGotError_getNgameStartStatus
()
{
console
.
log
(
this
.
getNgameStartStatus
)
console
.
log
(
'onGotError_getNgameStartStatus'
);
}
onClick_rulebtn
()
{
console
.
log
(
'onClick_rulebtn'
);
this
.
bubbling
(
'showDialog'
,
'Rule'
);
}
onClick_recordbtn
()
{
console
.
log
(
'onClick_rulebtn'
);
//this.bubbling('showDialog', 'Rule');
}
onClick_rankbtn
()
{
alert
(
'onClick_rankbtn'
)
// globalEvent.emit('alert', {title: 'Success', content: 'You complete this puzzle', button: 'Next level'}, this.onAlertClose);
}
onDidEnter
(
last
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
):
void
{
this
.
entity
.
enabled
=
true
;
}
onDidLeave
(
next
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
):
void
{
this
.
entity
.
enabled
=
false
;
}
async
onWillEnter
(
last
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
)
{
}
async
onWillLeave
(
next
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
)
{
}
onWillMount
(
last
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
):
Promise
<
any
>
{
return
undefined
;
}
onWillUnMount
(
next
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
):
Promise
<
any
>
{
return
undefined
;
}
}
.history/assets/scripts/scenes/SceneStart_20190620164511.ts
0 → 100644
View file @
9d5f3970
/**
* Created by rockyl on 2019-04-09.
*/
import
ScillaComponent
from
"scilla-components/src/base/ScillaComponent"
;
import
{
dynamic
,
Entity
,
Tween
}
from
"scilla/src"
;
import
{
setText
}
from
"../entityUtils"
;
import
{
alien
}
from
"../navigator/StackNavigator"
;
import
Wave
from
'components/animation/Wave'
import
{
INavigatorViewBase
}
from
"../navigator/VirtualNavigator"
;
import
{
Transform
}
from
'scilla-components/src'
;
import
{
createTween
,
ease
}
from
"scilla"
;
export
default
class
SceneStart
extends
ScillaComponent
implements
INavigatorViewBase
{
ajaxElement
:
dynamic
;
doJoin
:
dynamic
;
getNgameStartStatus
:
dynamic
;
countTxt
:
Entity
;
startbtn
:
Entity
;
recordbtn
:
Entity
;
pingziFront
:
Entity
;
pingziBack
:
Entity
;
rankbtn
:
Entity
;
rulebtn
:
Entity
;
gouzi
:
Entity
;
pingzi_1
:
Entity
;
pingzi_2
:
Entity
;
gouzi_pingzi
:
Entity
;
private
startBtnAnimation
;
pingziFrontTransform
:
Transform
;
pingziBackTransform
:
Transform
;
gouziTransform
:
Transform
;
pingzi_1Transform
:
Transform
;
pingzi_2Transform
:
Transform
;
gouzi_pingziTransform
:
Transform
;
onAwake
()
{
super
.
onAwake
();
this
.
setCountText
(
''
);
this
.
startBtnAnimation
=
this
.
startbtn
.
getComponent
(
Transform
);
this
.
pingziFrontTransform
=
this
.
pingziFront
.
getComponent
(
Transform
);
this
.
pingziBackTransform
=
this
.
pingziBack
.
getComponent
(
Transform
);
this
.
gouziTransform
=
this
.
gouzi
.
getComponent
(
Transform
);
this
.
pingzi_1Transform
=
this
.
pingzi_1
.
getComponent
(
Transform
);
this
.
pingzi_2Transform
=
this
.
pingzi_2
.
getComponent
(
Transform
);
this
.
gouzi_pingziTransform
=
this
.
gouzi_pingzi
.
getComponent
(
Transform
);
this
.
grabState
=
false
;
this
.
hasPrize
=
false
;
//Tween.
//egret.Tween.get(this.startBtn, {loop:true}).to({scaleX:0.9, scaleY:0.9}, 300).wait(1000).to({scaleX:1, scaleY:1}, 300);
// SingleSceneNavigator
console
.
log
(
"sd"
)
/* var sd=createTween(this.startBtnAnimation, this.startBtnAnimation)
.to({scaleX:1.2,scaleY:1.2}, 1200) */
/* createTween(this, this.startBtnAnimation)
.set({scale: {x: 0, y: 0}, alpha: 1})
.wait(100)
.to({scale: {x: 0.8, y: 0.8}}, 800)
.to({scale: {x: 1.1, y: 1.1}, alpha: 0}, 1200); */
this
.
gouzi_pingziTransform
.
alpha
=
0
createTween
(
this
,
this
.
startBtnAnimation
,
true
,{
loop
:
-
1
})
.
set
({
scale
:
{
x
:
1
,
y
:
1
}})
.
to
({
scale
:
{
x
:
.
9
,
y
:
.
9
}},
300
)
.
wait
(
1000
)
.
to
({
scale
:
{
x
:
1
,
y
:
1
}},
300
)
createTween
(
this
,
this
.
pingziBackTransform
,
true
,{
loop
:
-
1
})
.
set
({
position
:
{
x
:
47.5
}})
.
to
({
position
:
{
x
:
-
152.5
}},
1000
)
createTween
(
this
,
this
.
pingziFrontTransform
,
true
,{
loop
:
-
1
})
.
set
({
position
:
{
x
:
-
110
}})
.
to
({
position
:
{
x
:
110
}},
1000
)
.
call
(()
=>
{
//console.log(`2`)
if
(
this
.
grabState
){
var
time
=
1000
;
if
(
this
.
hasPrize
){
time
=
1000
;
}
else
{
time
=
1500
;
}
createTween
(
this
,
this
.
gouziTransform
,
true
,{
loop
:
0
})
.
set
({
position
:
{
y
:
132.5
}})
.
to
({
position
:
{
y
:
335
}},
time
)
.
call
(()
=>
{
//console.log(`1`)
this
.
gouzi_pingziTransform
.
alpha
=
1
})
.
to
({
position
:
{
y
:
132.5
}},
1000
)
.
call
(()
=>
{
this
.
gouzi_pingziTransform
.
alpha
=
0
console
.
log
(
`2`
)
})
//
}
})
//console.log(sd)
//.call(resolve);
}
private
setCountText
(
text
:
string
)
{
setText
(
this
.
countTxt
,
text
);
}
initGameStage
()
{
this
.
updateCountText
();
}
updateCountText
()
{
const
{
element
}
=
this
.
ajaxElement
;
let
text
=
''
if
(
element
.
freeLimit
>
0
)
{
text
=
`今日剩余免费次数:
${
element
.
freeLimit
}
次`
;
}
else
{
text
=
`
${
element
.
needCredits
}${
window
[
'CFG'
].
unitName
}
/次`
}
this
.
setCountText
(
text
);
}
grabState
=
false
;
hasPrize
=
false
;
onClick_startbtn
()
{
this
.
grabState
=
true
;
this
.
hasPrize
=
true
;
/* if (window['getDuibaToken']) {
window['getDuibaToken']((tokenObj: any) => {
this.broadcast('callApi', 1, 'doJoin', {
token:tokenObj.token,
activityId: window['CFG'].actId,
activityType: 'hdtool',
consumerId: window['CFG'].consumerId
});
}, (key: string, messageObj: any) => {
this.onGotDojoinError();
});
} else {
this.broadcast('callApi', 1, 'doJoin', {
activityId: window['CFG'].actId,
activityType: 'hdtool',
consumerId: window['CFG'].consumerId
});
} */
}
onGotDojoin
()
{
console
.
log
(
'onGotDojoin'
,
this
.
doJoin
);
this
.
broadcast
(
'callApi'
,
1
,
'getNgameStartStatus'
,
{
orderId
:
this
.
doJoin
});
}
onGotDojoinError
(
data
?)
{
console
.
log
(
'onGotDojoinError'
)
console
.
log
(
this
.
doJoin
)
console
.
log
(
data
)
}
onGot_getNgameStartStatus
()
{
console
.
log
(
'onGot_getNgameStartStatus'
,
this
.
getNgameStartStatus
);
//fuck 不可以循环引用
this
.
bubbling
(
'fuck'
,
'play'
);
}
onGotError_getNgameStartStatus
()
{
console
.
log
(
this
.
getNgameStartStatus
)
console
.
log
(
'onGotError_getNgameStartStatus'
);
}
onClick_rulebtn
()
{
console
.
log
(
'onClick_rulebtn'
);
this
.
bubbling
(
'showDialog'
,
'Rule'
);
}
onClick_recordbtn
()
{
console
.
log
(
'onClick_rulebtn'
);
//this.bubbling('showDialog', 'Rule');
}
onClick_rankbtn
()
{
alert
(
'onClick_rankbtn'
)
// globalEvent.emit('alert', {title: 'Success', content: 'You complete this puzzle', button: 'Next level'}, this.onAlertClose);
}
onDidEnter
(
last
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
):
void
{
this
.
entity
.
enabled
=
true
;
}
onDidLeave
(
next
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
):
void
{
this
.
entity
.
enabled
=
false
;
}
async
onWillEnter
(
last
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
)
{
}
async
onWillLeave
(
next
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
)
{
}
onWillMount
(
last
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
):
Promise
<
any
>
{
return
undefined
;
}
onWillUnMount
(
next
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
):
Promise
<
any
>
{
return
undefined
;
}
}
.history/assets/scripts/scenes/SceneStart_20190620164601.ts
0 → 100644
View file @
9d5f3970
/**
* Created by rockyl on 2019-04-09.
*/
import
ScillaComponent
from
"scilla-components/src/base/ScillaComponent"
;
import
{
dynamic
,
Entity
,
Tween
}
from
"scilla/src"
;
import
{
setText
}
from
"../entityUtils"
;
import
{
alien
}
from
"../navigator/StackNavigator"
;
import
Wave
from
'components/animation/Wave'
import
{
INavigatorViewBase
}
from
"../navigator/VirtualNavigator"
;
import
{
Transform
}
from
'scilla-components/src'
;
import
{
createTween
,
ease
}
from
"scilla"
;
export
default
class
SceneStart
extends
ScillaComponent
implements
INavigatorViewBase
{
ajaxElement
:
dynamic
;
doJoin
:
dynamic
;
getNgameStartStatus
:
dynamic
;
countTxt
:
Entity
;
startbtn
:
Entity
;
recordbtn
:
Entity
;
pingziFront
:
Entity
;
pingziBack
:
Entity
;
rankbtn
:
Entity
;
rulebtn
:
Entity
;
gouzi
:
Entity
;
pingzi_1
:
Entity
;
pingzi_2
:
Entity
;
gouzi_pingzi
:
Entity
;
private
startBtnAnimation
;
pingziFrontTransform
:
Transform
;
pingziBackTransform
:
Transform
;
gouziTransform
:
Transform
;
pingzi_1Transform
:
Transform
;
pingzi_2Transform
:
Transform
;
gouzi_pingziTransform
:
Transform
;
onAwake
()
{
super
.
onAwake
();
this
.
setCountText
(
''
);
this
.
startBtnAnimation
=
this
.
startbtn
.
getComponent
(
Transform
);
this
.
pingziFrontTransform
=
this
.
pingziFront
.
getComponent
(
Transform
);
this
.
pingziBackTransform
=
this
.
pingziBack
.
getComponent
(
Transform
);
this
.
gouziTransform
=
this
.
gouzi
.
getComponent
(
Transform
);
this
.
pingzi_1Transform
=
this
.
pingzi_1
.
getComponent
(
Transform
);
this
.
pingzi_2Transform
=
this
.
pingzi_2
.
getComponent
(
Transform
);
this
.
gouzi_pingziTransform
=
this
.
gouzi_pingzi
.
getComponent
(
Transform
);
this
.
grabState
=
false
;
this
.
hasPrize
=
false
;
//Tween.
//egret.Tween.get(this.startBtn, {loop:true}).to({scaleX:0.9, scaleY:0.9}, 300).wait(1000).to({scaleX:1, scaleY:1}, 300);
// SingleSceneNavigator
console
.
log
(
"sd"
)
/* var sd=createTween(this.startBtnAnimation, this.startBtnAnimation)
.to({scaleX:1.2,scaleY:1.2}, 1200) */
/* createTween(this, this.startBtnAnimation)
.set({scale: {x: 0, y: 0}, alpha: 1})
.wait(100)
.to({scale: {x: 0.8, y: 0.8}}, 800)
.to({scale: {x: 1.1, y: 1.1}, alpha: 0}, 1200); */
this
.
gouzi_pingziTransform
.
alpha
=
0
createTween
(
this
,
this
.
startBtnAnimation
,
true
,{
loop
:
-
1
})
.
set
({
scale
:
{
x
:
1
,
y
:
1
}})
.
to
({
scale
:
{
x
:
.
9
,
y
:
.
9
}},
300
)
.
wait
(
1000
)
.
to
({
scale
:
{
x
:
1
,
y
:
1
}},
300
)
createTween
(
this
,
this
.
pingziBackTransform
,
true
,{
loop
:
-
1
})
.
set
({
position
:
{
x
:
47.5
}})
.
to
({
position
:
{
x
:
-
152.5
}},
1000
)
createTween
(
this
,
this
.
pingziFrontTransform
,
true
,{
loop
:
-
1
})
.
set
({
position
:
{
x
:
-
110
}})
.
to
({
position
:
{
x
:
110
}},
1000
)
.
call
(()
=>
{
//console.log(`2`)
if
(
this
.
grabState
){
var
time
=
1000
;
if
(
this
.
hasPrize
){
time
=
1000
;
}
else
{
time
=
1500
;
}
createTween
(
this
,
this
.
gouziTransform
,
true
,{
loop
:
0
})
.
set
({
position
:
{
y
:
132.5
}})
.
to
({
position
:
{
y
:
335
}},
time
)
.
call
(()
=>
{
this
.
pingzi_1Transform
.
alpha
=
0
this
.
gouzi_pingziTransform
.
alpha
=
1
})
.
to
({
position
:
{
y
:
132.5
}},
1000
)
.
call
(()
=>
{
this
.
pingzi_1Transform
.
alpha
=
1
this
.
gouzi_pingziTransform
.
alpha
=
0
})
}
})
//console.log(sd)
//.call(resolve);
}
private
setCountText
(
text
:
string
)
{
setText
(
this
.
countTxt
,
text
);
}
initGameStage
()
{
this
.
updateCountText
();
}
updateCountText
()
{
const
{
element
}
=
this
.
ajaxElement
;
let
text
=
''
if
(
element
.
freeLimit
>
0
)
{
text
=
`今日剩余免费次数:
${
element
.
freeLimit
}
次`
;
}
else
{
text
=
`
${
element
.
needCredits
}${
window
[
'CFG'
].
unitName
}
/次`
}
this
.
setCountText
(
text
);
}
grabState
=
false
;
hasPrize
=
false
;
onClick_startbtn
()
{
this
.
grabState
=
true
;
this
.
hasPrize
=
true
;
/* if (window['getDuibaToken']) {
window['getDuibaToken']((tokenObj: any) => {
this.broadcast('callApi', 1, 'doJoin', {
token:tokenObj.token,
activityId: window['CFG'].actId,
activityType: 'hdtool',
consumerId: window['CFG'].consumerId
});
}, (key: string, messageObj: any) => {
this.onGotDojoinError();
});
} else {
this.broadcast('callApi', 1, 'doJoin', {
activityId: window['CFG'].actId,
activityType: 'hdtool',
consumerId: window['CFG'].consumerId
});
} */
}
onGotDojoin
()
{
console
.
log
(
'onGotDojoin'
,
this
.
doJoin
);
this
.
broadcast
(
'callApi'
,
1
,
'getNgameStartStatus'
,
{
orderId
:
this
.
doJoin
});
}
onGotDojoinError
(
data
?)
{
console
.
log
(
'onGotDojoinError'
)
console
.
log
(
this
.
doJoin
)
console
.
log
(
data
)
}
onGot_getNgameStartStatus
()
{
console
.
log
(
'onGot_getNgameStartStatus'
,
this
.
getNgameStartStatus
);
//fuck 不可以循环引用
this
.
bubbling
(
'fuck'
,
'play'
);
}
onGotError_getNgameStartStatus
()
{
console
.
log
(
this
.
getNgameStartStatus
)
console
.
log
(
'onGotError_getNgameStartStatus'
);
}
onClick_rulebtn
()
{
console
.
log
(
'onClick_rulebtn'
);
this
.
bubbling
(
'showDialog'
,
'Rule'
);
}
onClick_recordbtn
()
{
console
.
log
(
'onClick_rulebtn'
);
//this.bubbling('showDialog', 'Rule');
}
onClick_rankbtn
()
{
alert
(
'onClick_rankbtn'
)
// globalEvent.emit('alert', {title: 'Success', content: 'You complete this puzzle', button: 'Next level'}, this.onAlertClose);
}
onDidEnter
(
last
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
):
void
{
this
.
entity
.
enabled
=
true
;
}
onDidLeave
(
next
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
):
void
{
this
.
entity
.
enabled
=
false
;
}
async
onWillEnter
(
last
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
)
{
}
async
onWillLeave
(
next
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
)
{
}
onWillMount
(
last
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
):
Promise
<
any
>
{
return
undefined
;
}
onWillUnMount
(
next
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
):
Promise
<
any
>
{
return
undefined
;
}
}
.history/assets/scripts/scenes/SceneStart_20190620164638.ts
0 → 100644
View file @
9d5f3970
/**
* Created by rockyl on 2019-04-09.
*/
import
ScillaComponent
from
"scilla-components/src/base/ScillaComponent"
;
import
{
dynamic
,
Entity
,
Tween
}
from
"scilla/src"
;
import
{
setText
}
from
"../entityUtils"
;
import
{
alien
}
from
"../navigator/StackNavigator"
;
import
Wave
from
'components/animation/Wave'
import
{
INavigatorViewBase
}
from
"../navigator/VirtualNavigator"
;
import
{
Transform
}
from
'scilla-components/src'
;
import
{
createTween
,
ease
}
from
"scilla"
;
export
default
class
SceneStart
extends
ScillaComponent
implements
INavigatorViewBase
{
ajaxElement
:
dynamic
;
doJoin
:
dynamic
;
getNgameStartStatus
:
dynamic
;
countTxt
:
Entity
;
startbtn
:
Entity
;
recordbtn
:
Entity
;
pingziFront
:
Entity
;
pingziBack
:
Entity
;
rankbtn
:
Entity
;
rulebtn
:
Entity
;
gouzi
:
Entity
;
pingzi_1
:
Entity
;
pingzi_2
:
Entity
;
gouzi_pingzi
:
Entity
;
private
startBtnAnimation
;
pingziFrontTransform
:
Transform
;
pingziBackTransform
:
Transform
;
gouziTransform
:
Transform
;
pingzi_1Transform
:
Transform
;
pingzi_2Transform
:
Transform
;
gouzi_pingziTransform
:
Transform
;
onAwake
()
{
super
.
onAwake
();
this
.
setCountText
(
''
);
this
.
startBtnAnimation
=
this
.
startbtn
.
getComponent
(
Transform
);
this
.
pingziFrontTransform
=
this
.
pingziFront
.
getComponent
(
Transform
);
this
.
pingziBackTransform
=
this
.
pingziBack
.
getComponent
(
Transform
);
this
.
gouziTransform
=
this
.
gouzi
.
getComponent
(
Transform
);
this
.
pingzi_1Transform
=
this
.
pingzi_1
.
getComponent
(
Transform
);
this
.
pingzi_2Transform
=
this
.
pingzi_2
.
getComponent
(
Transform
);
this
.
gouzi_pingziTransform
=
this
.
gouzi_pingzi
.
getComponent
(
Transform
);
this
.
grabState
=
false
;
this
.
hasPrize
=
false
;
//Tween.
//egret.Tween.get(this.startBtn, {loop:true}).to({scaleX:0.9, scaleY:0.9}, 300).wait(1000).to({scaleX:1, scaleY:1}, 300);
// SingleSceneNavigator
console
.
log
(
"sd"
)
/* var sd=createTween(this.startBtnAnimation, this.startBtnAnimation)
.to({scaleX:1.2,scaleY:1.2}, 1200) */
/* createTween(this, this.startBtnAnimation)
.set({scale: {x: 0, y: 0}, alpha: 1})
.wait(100)
.to({scale: {x: 0.8, y: 0.8}}, 800)
.to({scale: {x: 1.1, y: 1.1}, alpha: 0}, 1200); */
this
.
gouzi_pingziTransform
.
alpha
=
0
createTween
(
this
,
this
.
startBtnAnimation
,
true
,{
loop
:
-
1
})
.
set
({
scale
:
{
x
:
1
,
y
:
1
}})
.
to
({
scale
:
{
x
:
.
9
,
y
:
.
9
}},
300
)
.
wait
(
1000
)
.
to
({
scale
:
{
x
:
1
,
y
:
1
}},
300
)
createTween
(
this
,
this
.
pingziBackTransform
,
true
,{
loop
:
-
1
})
.
set
({
position
:
{
x
:
47.5
}})
.
to
({
position
:
{
x
:
-
152.5
}},
1000
)
createTween
(
this
,
this
.
pingziFrontTransform
,
true
,{
loop
:
-
1
})
.
set
({
position
:
{
x
:
-
110
}})
.
to
({
position
:
{
x
:
110
}},
1000
)
.
call
(()
=>
{
//console.log(`2`)
if
(
this
.
grabState
){
var
time
=
1000
;
if
(
this
.
hasPrize
){
time
=
1000
;
}
else
{
time
=
1500
;
}
createTween
(
this
,
this
.
gouziTransform
,
true
,{
loop
:
0
})
.
set
({
position
:
{
y
:
132.5
}})
.
to
({
position
:
{
y
:
335
}},
time
)
.
call
(()
=>
{
if
(
this
.
hasPrize
){
this
.
pingzi_1Transform
.
alpha
=
0
this
.
gouzi_pingziTransform
.
alpha
=
1
}
})
.
to
({
position
:
{
y
:
132.5
}},
1000
)
.
call
(()
=>
{
this
.
pingzi_1Transform
.
alpha
=
1
this
.
gouzi_pingziTransform
.
alpha
=
0
})
}
})
//console.log(sd)
//.call(resolve);
}
private
setCountText
(
text
:
string
)
{
setText
(
this
.
countTxt
,
text
);
}
initGameStage
()
{
this
.
updateCountText
();
}
updateCountText
()
{
const
{
element
}
=
this
.
ajaxElement
;
let
text
=
''
if
(
element
.
freeLimit
>
0
)
{
text
=
`今日剩余免费次数:
${
element
.
freeLimit
}
次`
;
}
else
{
text
=
`
${
element
.
needCredits
}${
window
[
'CFG'
].
unitName
}
/次`
}
this
.
setCountText
(
text
);
}
grabState
=
false
;
hasPrize
=
false
;
onClick_startbtn
()
{
this
.
grabState
=
true
;
this
.
hasPrize
=
true
;
/* if (window['getDuibaToken']) {
window['getDuibaToken']((tokenObj: any) => {
this.broadcast('callApi', 1, 'doJoin', {
token:tokenObj.token,
activityId: window['CFG'].actId,
activityType: 'hdtool',
consumerId: window['CFG'].consumerId
});
}, (key: string, messageObj: any) => {
this.onGotDojoinError();
});
} else {
this.broadcast('callApi', 1, 'doJoin', {
activityId: window['CFG'].actId,
activityType: 'hdtool',
consumerId: window['CFG'].consumerId
});
} */
}
onGotDojoin
()
{
console
.
log
(
'onGotDojoin'
,
this
.
doJoin
);
this
.
broadcast
(
'callApi'
,
1
,
'getNgameStartStatus'
,
{
orderId
:
this
.
doJoin
});
}
onGotDojoinError
(
data
?)
{
console
.
log
(
'onGotDojoinError'
)
console
.
log
(
this
.
doJoin
)
console
.
log
(
data
)
}
onGot_getNgameStartStatus
()
{
console
.
log
(
'onGot_getNgameStartStatus'
,
this
.
getNgameStartStatus
);
//fuck 不可以循环引用
this
.
bubbling
(
'fuck'
,
'play'
);
}
onGotError_getNgameStartStatus
()
{
console
.
log
(
this
.
getNgameStartStatus
)
console
.
log
(
'onGotError_getNgameStartStatus'
);
}
onClick_rulebtn
()
{
console
.
log
(
'onClick_rulebtn'
);
this
.
bubbling
(
'showDialog'
,
'Rule'
);
}
onClick_recordbtn
()
{
console
.
log
(
'onClick_rulebtn'
);
//this.bubbling('showDialog', 'Rule');
}
onClick_rankbtn
()
{
alert
(
'onClick_rankbtn'
)
// globalEvent.emit('alert', {title: 'Success', content: 'You complete this puzzle', button: 'Next level'}, this.onAlertClose);
}
onDidEnter
(
last
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
):
void
{
this
.
entity
.
enabled
=
true
;
}
onDidLeave
(
next
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
):
void
{
this
.
entity
.
enabled
=
false
;
}
async
onWillEnter
(
last
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
)
{
}
async
onWillLeave
(
next
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
)
{
}
onWillMount
(
last
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
):
Promise
<
any
>
{
return
undefined
;
}
onWillUnMount
(
next
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
):
Promise
<
any
>
{
return
undefined
;
}
}
.history/assets/scripts/scenes/SceneStart_20190620164741.ts
0 → 100644
View file @
9d5f3970
/**
* Created by rockyl on 2019-04-09.
*/
import
ScillaComponent
from
"scilla-components/src/base/ScillaComponent"
;
import
{
dynamic
,
Entity
,
Tween
}
from
"scilla/src"
;
import
{
setText
}
from
"../entityUtils"
;
import
{
alien
}
from
"../navigator/StackNavigator"
;
import
Wave
from
'components/animation/Wave'
import
{
INavigatorViewBase
}
from
"../navigator/VirtualNavigator"
;
import
{
Transform
}
from
'scilla-components/src'
;
import
{
createTween
,
ease
}
from
"scilla"
;
export
default
class
SceneStart
extends
ScillaComponent
implements
INavigatorViewBase
{
ajaxElement
:
dynamic
;
doJoin
:
dynamic
;
getNgameStartStatus
:
dynamic
;
countTxt
:
Entity
;
startbtn
:
Entity
;
recordbtn
:
Entity
;
pingziFront
:
Entity
;
pingziBack
:
Entity
;
rankbtn
:
Entity
;
rulebtn
:
Entity
;
gouzi
:
Entity
;
pingzi_1
:
Entity
;
pingzi_2
:
Entity
;
gouzi_pingzi
:
Entity
;
private
startBtnAnimation
;
pingziFrontTransform
:
Transform
;
pingziBackTransform
:
Transform
;
gouziTransform
:
Transform
;
pingzi_1Transform
:
Transform
;
pingzi_2Transform
:
Transform
;
gouzi_pingziTransform
:
Transform
;
onAwake
()
{
super
.
onAwake
();
this
.
setCountText
(
''
);
this
.
startBtnAnimation
=
this
.
startbtn
.
getComponent
(
Transform
);
this
.
pingziFrontTransform
=
this
.
pingziFront
.
getComponent
(
Transform
);
this
.
pingziBackTransform
=
this
.
pingziBack
.
getComponent
(
Transform
);
this
.
gouziTransform
=
this
.
gouzi
.
getComponent
(
Transform
);
this
.
pingzi_1Transform
=
this
.
pingzi_1
.
getComponent
(
Transform
);
this
.
pingzi_2Transform
=
this
.
pingzi_2
.
getComponent
(
Transform
);
this
.
gouzi_pingziTransform
=
this
.
gouzi_pingzi
.
getComponent
(
Transform
);
this
.
grabState
=
false
;
this
.
hasPrize
=
false
;
//Tween.
//egret.Tween.get(this.startBtn, {loop:true}).to({scaleX:0.9, scaleY:0.9}, 300).wait(1000).to({scaleX:1, scaleY:1}, 300);
// SingleSceneNavigator
console
.
log
(
"sd"
)
/* var sd=createTween(this.startBtnAnimation, this.startBtnAnimation)
.to({scaleX:1.2,scaleY:1.2}, 1200) */
/* createTween(this, this.startBtnAnimation)
.set({scale: {x: 0, y: 0}, alpha: 1})
.wait(100)
.to({scale: {x: 0.8, y: 0.8}}, 800)
.to({scale: {x: 1.1, y: 1.1}, alpha: 0}, 1200); */
this
.
gouzi_pingziTransform
.
alpha
=
0
createTween
(
this
,
this
.
startBtnAnimation
,
true
,{
loop
:
-
1
})
.
set
({
scale
:
{
x
:
1
,
y
:
1
}})
.
to
({
scale
:
{
x
:
.
9
,
y
:
.
9
}},
300
)
.
wait
(
1000
)
.
to
({
scale
:
{
x
:
1
,
y
:
1
}},
300
)
createTween
(
this
,
this
.
pingziBackTransform
,
true
,{
loop
:
-
1
})
.
set
({
position
:
{
x
:
47.5
}})
.
to
({
position
:
{
x
:
-
152.5
}},
1000
)
createTween
(
this
,
this
.
pingziFrontTransform
,
true
,{
loop
:
-
1
})
.
set
({
position
:
{
x
:
-
110
}})
.
to
({
position
:
{
x
:
110
}},
1000
)
.
call
(()
=>
{
//console.log(`2`)
if
(
this
.
grabState
){
this
.
grabState
=
false
;
var
time
=
1000
;
if
(
this
.
hasPrize
){
time
=
1000
;
}
else
{
time
=
1500
;
}
createTween
(
this
,
this
.
gouziTransform
,
true
,{
loop
:
0
})
.
set
({
position
:
{
y
:
132.5
}})
.
to
({
position
:
{
y
:
335
}},
time
)
.
call
(()
=>
{
if
(
this
.
hasPrize
){
this
.
hasPrize
=
false
;
this
.
pingzi_1Transform
.
alpha
=
0
this
.
gouzi_pingziTransform
.
alpha
=
1
}
})
.
to
({
position
:
{
y
:
132.5
}},
1000
)
.
call
(()
=>
{
this
.
pingzi_1Transform
.
alpha
=
1
this
.
gouzi_pingziTransform
.
alpha
=
0
})
}
})
//console.log(sd)
//.call(resolve);
}
private
setCountText
(
text
:
string
)
{
setText
(
this
.
countTxt
,
text
);
}
initGameStage
()
{
this
.
updateCountText
();
}
updateCountText
()
{
const
{
element
}
=
this
.
ajaxElement
;
let
text
=
''
if
(
element
.
freeLimit
>
0
)
{
text
=
`今日剩余免费次数:
${
element
.
freeLimit
}
次`
;
}
else
{
text
=
`
${
element
.
needCredits
}${
window
[
'CFG'
].
unitName
}
/次`
}
this
.
setCountText
(
text
);
}
grabState
=
false
;
hasPrize
=
false
;
onClick_startbtn
()
{
this
.
grabState
=
true
;
this
.
hasPrize
=
true
;
/* if (window['getDuibaToken']) {
window['getDuibaToken']((tokenObj: any) => {
this.broadcast('callApi', 1, 'doJoin', {
token:tokenObj.token,
activityId: window['CFG'].actId,
activityType: 'hdtool',
consumerId: window['CFG'].consumerId
});
}, (key: string, messageObj: any) => {
this.onGotDojoinError();
});
} else {
this.broadcast('callApi', 1, 'doJoin', {
activityId: window['CFG'].actId,
activityType: 'hdtool',
consumerId: window['CFG'].consumerId
});
} */
}
onGotDojoin
()
{
console
.
log
(
'onGotDojoin'
,
this
.
doJoin
);
this
.
broadcast
(
'callApi'
,
1
,
'getNgameStartStatus'
,
{
orderId
:
this
.
doJoin
});
}
onGotDojoinError
(
data
?)
{
console
.
log
(
'onGotDojoinError'
)
console
.
log
(
this
.
doJoin
)
console
.
log
(
data
)
}
onGot_getNgameStartStatus
()
{
console
.
log
(
'onGot_getNgameStartStatus'
,
this
.
getNgameStartStatus
);
//fuck 不可以循环引用
this
.
bubbling
(
'fuck'
,
'play'
);
}
onGotError_getNgameStartStatus
()
{
console
.
log
(
this
.
getNgameStartStatus
)
console
.
log
(
'onGotError_getNgameStartStatus'
);
}
onClick_rulebtn
()
{
console
.
log
(
'onClick_rulebtn'
);
this
.
bubbling
(
'showDialog'
,
'Rule'
);
}
onClick_recordbtn
()
{
console
.
log
(
'onClick_rulebtn'
);
//this.bubbling('showDialog', 'Rule');
}
onClick_rankbtn
()
{
alert
(
'onClick_rankbtn'
)
// globalEvent.emit('alert', {title: 'Success', content: 'You complete this puzzle', button: 'Next level'}, this.onAlertClose);
}
onDidEnter
(
last
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
):
void
{
this
.
entity
.
enabled
=
true
;
}
onDidLeave
(
next
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
):
void
{
this
.
entity
.
enabled
=
false
;
}
async
onWillEnter
(
last
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
)
{
}
async
onWillLeave
(
next
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
)
{
}
onWillMount
(
last
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
):
Promise
<
any
>
{
return
undefined
;
}
onWillUnMount
(
next
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
):
Promise
<
any
>
{
return
undefined
;
}
}
.history/assets/scripts/scenes/SceneStart_20190620164814.ts
0 → 100644
View file @
9d5f3970
/**
* Created by rockyl on 2019-04-09.
*/
import
ScillaComponent
from
"scilla-components/src/base/ScillaComponent"
;
import
{
dynamic
,
Entity
,
Tween
}
from
"scilla/src"
;
import
{
setText
}
from
"../entityUtils"
;
import
{
alien
}
from
"../navigator/StackNavigator"
;
import
Wave
from
'components/animation/Wave'
import
{
INavigatorViewBase
}
from
"../navigator/VirtualNavigator"
;
import
{
Transform
}
from
'scilla-components/src'
;
import
{
createTween
,
ease
}
from
"scilla"
;
export
default
class
SceneStart
extends
ScillaComponent
implements
INavigatorViewBase
{
ajaxElement
:
dynamic
;
doJoin
:
dynamic
;
getNgameStartStatus
:
dynamic
;
countTxt
:
Entity
;
startbtn
:
Entity
;
recordbtn
:
Entity
;
pingziFront
:
Entity
;
pingziBack
:
Entity
;
rankbtn
:
Entity
;
rulebtn
:
Entity
;
gouzi
:
Entity
;
pingzi_1
:
Entity
;
pingzi_2
:
Entity
;
gouzi_pingzi
:
Entity
;
private
startBtnAnimation
;
pingziFrontTransform
:
Transform
;
pingziBackTransform
:
Transform
;
gouziTransform
:
Transform
;
pingzi_1Transform
:
Transform
;
pingzi_2Transform
:
Transform
;
gouzi_pingziTransform
:
Transform
;
onAwake
()
{
super
.
onAwake
();
this
.
setCountText
(
''
);
this
.
startBtnAnimation
=
this
.
startbtn
.
getComponent
(
Transform
);
this
.
pingziFrontTransform
=
this
.
pingziFront
.
getComponent
(
Transform
);
this
.
pingziBackTransform
=
this
.
pingziBack
.
getComponent
(
Transform
);
this
.
gouziTransform
=
this
.
gouzi
.
getComponent
(
Transform
);
this
.
pingzi_1Transform
=
this
.
pingzi_1
.
getComponent
(
Transform
);
this
.
pingzi_2Transform
=
this
.
pingzi_2
.
getComponent
(
Transform
);
this
.
gouzi_pingziTransform
=
this
.
gouzi_pingzi
.
getComponent
(
Transform
);
this
.
grabState
=
false
;
this
.
hasPrize
=
false
;
//Tween.
//egret.Tween.get(this.startBtn, {loop:true}).to({scaleX:0.9, scaleY:0.9}, 300).wait(1000).to({scaleX:1, scaleY:1}, 300);
// SingleSceneNavigator
console
.
log
(
"sd"
)
/* var sd=createTween(this.startBtnAnimation, this.startBtnAnimation)
.to({scaleX:1.2,scaleY:1.2}, 1200) */
/* createTween(this, this.startBtnAnimation)
.set({scale: {x: 0, y: 0}, alpha: 1})
.wait(100)
.to({scale: {x: 0.8, y: 0.8}}, 800)
.to({scale: {x: 1.1, y: 1.1}, alpha: 0}, 1200); */
this
.
gouzi_pingziTransform
.
alpha
=
0
createTween
(
this
,
this
.
startBtnAnimation
,
true
,{
loop
:
-
1
})
.
set
({
scale
:
{
x
:
1
,
y
:
1
}})
.
to
({
scale
:
{
x
:
.
9
,
y
:
.
9
}},
300
)
.
wait
(
1000
)
.
to
({
scale
:
{
x
:
1
,
y
:
1
}},
300
)
createTween
(
this
,
this
.
pingziBackTransform
,
true
,{
loop
:
-
1
})
.
set
({
position
:
{
x
:
47.5
}})
.
to
({
position
:
{
x
:
-
152.5
}},
1000
)
createTween
(
this
,
this
.
pingziFrontTransform
,
true
,{
loop
:
-
1
})
.
set
({
position
:
{
x
:
-
110
}})
.
to
({
position
:
{
x
:
110
}},
1000
)
.
call
(()
=>
{
//console.log(`2`)
if
(
this
.
grabState
){
this
.
grabState
=
false
;
var
time
=
1000
;
if
(
this
.
hasPrize
){
time
=
1000
;
}
else
{
time
=
1500
;
}
createTween
(
this
,
this
.
gouziTransform
,
true
,{
loop
:
0
})
.
set
({
position
:
{
y
:
132.5
}})
.
to
({
position
:
{
y
:
335
}},
time
)
.
call
(()
=>
{
if
(
this
.
hasPrize
){
this
.
hasPrize
=
false
;
this
.
pingzi_2Transform
.
alpha
=
0
this
.
gouzi_pingziTransform
.
alpha
=
1
}
})
.
to
({
position
:
{
y
:
132.5
}},
1000
)
.
call
(()
=>
{
this
.
pingzi_2Transform
.
alpha
=
1
this
.
gouzi_pingziTransform
.
alpha
=
0
})
}
})
//console.log(sd)
//.call(resolve);
}
private
setCountText
(
text
:
string
)
{
setText
(
this
.
countTxt
,
text
);
}
initGameStage
()
{
this
.
updateCountText
();
}
updateCountText
()
{
const
{
element
}
=
this
.
ajaxElement
;
let
text
=
''
if
(
element
.
freeLimit
>
0
)
{
text
=
`今日剩余免费次数:
${
element
.
freeLimit
}
次`
;
}
else
{
text
=
`
${
element
.
needCredits
}${
window
[
'CFG'
].
unitName
}
/次`
}
this
.
setCountText
(
text
);
}
grabState
=
false
;
hasPrize
=
false
;
onClick_startbtn
()
{
this
.
grabState
=
true
;
this
.
hasPrize
=
true
;
/* if (window['getDuibaToken']) {
window['getDuibaToken']((tokenObj: any) => {
this.broadcast('callApi', 1, 'doJoin', {
token:tokenObj.token,
activityId: window['CFG'].actId,
activityType: 'hdtool',
consumerId: window['CFG'].consumerId
});
}, (key: string, messageObj: any) => {
this.onGotDojoinError();
});
} else {
this.broadcast('callApi', 1, 'doJoin', {
activityId: window['CFG'].actId,
activityType: 'hdtool',
consumerId: window['CFG'].consumerId
});
} */
}
onGotDojoin
()
{
console
.
log
(
'onGotDojoin'
,
this
.
doJoin
);
this
.
broadcast
(
'callApi'
,
1
,
'getNgameStartStatus'
,
{
orderId
:
this
.
doJoin
});
}
onGotDojoinError
(
data
?)
{
console
.
log
(
'onGotDojoinError'
)
console
.
log
(
this
.
doJoin
)
console
.
log
(
data
)
}
onGot_getNgameStartStatus
()
{
console
.
log
(
'onGot_getNgameStartStatus'
,
this
.
getNgameStartStatus
);
//fuck 不可以循环引用
this
.
bubbling
(
'fuck'
,
'play'
);
}
onGotError_getNgameStartStatus
()
{
console
.
log
(
this
.
getNgameStartStatus
)
console
.
log
(
'onGotError_getNgameStartStatus'
);
}
onClick_rulebtn
()
{
console
.
log
(
'onClick_rulebtn'
);
this
.
bubbling
(
'showDialog'
,
'Rule'
);
}
onClick_recordbtn
()
{
console
.
log
(
'onClick_rulebtn'
);
//this.bubbling('showDialog', 'Rule');
}
onClick_rankbtn
()
{
alert
(
'onClick_rankbtn'
)
// globalEvent.emit('alert', {title: 'Success', content: 'You complete this puzzle', button: 'Next level'}, this.onAlertClose);
}
onDidEnter
(
last
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
):
void
{
this
.
entity
.
enabled
=
true
;
}
onDidLeave
(
next
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
):
void
{
this
.
entity
.
enabled
=
false
;
}
async
onWillEnter
(
last
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
)
{
}
async
onWillLeave
(
next
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
)
{
}
onWillMount
(
last
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
):
Promise
<
any
>
{
return
undefined
;
}
onWillUnMount
(
next
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
):
Promise
<
any
>
{
return
undefined
;
}
}
.history/assets/scripts/scenes/SceneStart_20190620164822.ts
0 → 100644
View file @
9d5f3970
/**
* Created by rockyl on 2019-04-09.
*/
import
ScillaComponent
from
"scilla-components/src/base/ScillaComponent"
;
import
{
dynamic
,
Entity
,
Tween
}
from
"scilla/src"
;
import
{
setText
}
from
"../entityUtils"
;
import
{
alien
}
from
"../navigator/StackNavigator"
;
import
Wave
from
'components/animation/Wave'
import
{
INavigatorViewBase
}
from
"../navigator/VirtualNavigator"
;
import
{
Transform
}
from
'scilla-components/src'
;
import
{
createTween
,
ease
}
from
"scilla"
;
export
default
class
SceneStart
extends
ScillaComponent
implements
INavigatorViewBase
{
ajaxElement
:
dynamic
;
doJoin
:
dynamic
;
getNgameStartStatus
:
dynamic
;
countTxt
:
Entity
;
startbtn
:
Entity
;
recordbtn
:
Entity
;
pingziFront
:
Entity
;
pingziBack
:
Entity
;
rankbtn
:
Entity
;
rulebtn
:
Entity
;
gouzi
:
Entity
;
pingzi_1
:
Entity
;
pingzi_2
:
Entity
;
gouzi_pingzi
:
Entity
;
private
startBtnAnimation
;
pingziFrontTransform
:
Transform
;
pingziBackTransform
:
Transform
;
gouziTransform
:
Transform
;
pingzi_1Transform
:
Transform
;
pingzi_2Transform
:
Transform
;
gouzi_pingziTransform
:
Transform
;
onAwake
()
{
super
.
onAwake
();
this
.
setCountText
(
''
);
this
.
startBtnAnimation
=
this
.
startbtn
.
getComponent
(
Transform
);
this
.
pingziFrontTransform
=
this
.
pingziFront
.
getComponent
(
Transform
);
this
.
pingziBackTransform
=
this
.
pingziBack
.
getComponent
(
Transform
);
this
.
gouziTransform
=
this
.
gouzi
.
getComponent
(
Transform
);
this
.
pingzi_1Transform
=
this
.
pingzi_1
.
getComponent
(
Transform
);
this
.
pingzi_2Transform
=
this
.
pingzi_2
.
getComponent
(
Transform
);
this
.
gouzi_pingziTransform
=
this
.
gouzi_pingzi
.
getComponent
(
Transform
);
this
.
grabState
=
false
;
this
.
hasPrize
=
false
;
//Tween.
//egret.Tween.get(this.startBtn, {loop:true}).to({scaleX:0.9, scaleY:0.9}, 300).wait(1000).to({scaleX:1, scaleY:1}, 300);
// SingleSceneNavigator
console
.
log
(
"sd"
)
/* var sd=createTween(this.startBtnAnimation, this.startBtnAnimation)
.to({scaleX:1.2,scaleY:1.2}, 1200) */
/* createTween(this, this.startBtnAnimation)
.set({scale: {x: 0, y: 0}, alpha: 1})
.wait(100)
.to({scale: {x: 0.8, y: 0.8}}, 800)
.to({scale: {x: 1.1, y: 1.1}, alpha: 0}, 1200); */
this
.
gouzi_pingziTransform
.
alpha
=
0
createTween
(
this
,
this
.
startBtnAnimation
,
true
,{
loop
:
-
1
})
.
set
({
scale
:
{
x
:
1
,
y
:
1
}})
.
to
({
scale
:
{
x
:
.
9
,
y
:
.
9
}},
300
)
.
wait
(
1000
)
.
to
({
scale
:
{
x
:
1
,
y
:
1
}},
300
)
createTween
(
this
,
this
.
pingziBackTransform
,
true
,{
loop
:
-
1
})
.
set
({
position
:
{
x
:
47.5
}})
.
to
({
position
:
{
x
:
-
152.5
}},
1000
)
createTween
(
this
,
this
.
pingziFrontTransform
,
true
,{
loop
:
-
1
})
.
set
({
position
:
{
x
:
-
110
}})
.
to
({
position
:
{
x
:
110
}},
1000
)
.
call
(()
=>
{
//console.log(`2`)
if
(
this
.
grabState
){
this
.
grabState
=
false
;
var
time
=
1000
;
if
(
this
.
hasPrize
){
time
=
1000
;
}
else
{
time
=
1500
;
}
createTween
(
this
,
this
.
gouziTransform
,
true
,{
loop
:
0
})
.
set
({
position
:
{
y
:
132.5
}})
.
to
({
position
:
{
y
:
335
}},
time
)
.
call
(()
=>
{
if
(
this
.
hasPrize
){
this
.
hasPrize
=
false
;
this
.
pingzi_2Transform
.
alpha
=
0
this
.
gouzi_pingziTransform
.
alpha
=
1
}
})
.
to
({
position
:
{
y
:
132.5
}},
1000
)
.
call
(()
=>
{
this
.
pingzi_2Transform
.
alpha
=
1
this
.
gouzi_pingziTransform
.
alpha
=
1
})
}
})
//console.log(sd)
//.call(resolve);
}
private
setCountText
(
text
:
string
)
{
setText
(
this
.
countTxt
,
text
);
}
initGameStage
()
{
this
.
updateCountText
();
}
updateCountText
()
{
const
{
element
}
=
this
.
ajaxElement
;
let
text
=
''
if
(
element
.
freeLimit
>
0
)
{
text
=
`今日剩余免费次数:
${
element
.
freeLimit
}
次`
;
}
else
{
text
=
`
${
element
.
needCredits
}${
window
[
'CFG'
].
unitName
}
/次`
}
this
.
setCountText
(
text
);
}
grabState
=
false
;
hasPrize
=
false
;
onClick_startbtn
()
{
this
.
grabState
=
true
;
this
.
hasPrize
=
true
;
/* if (window['getDuibaToken']) {
window['getDuibaToken']((tokenObj: any) => {
this.broadcast('callApi', 1, 'doJoin', {
token:tokenObj.token,
activityId: window['CFG'].actId,
activityType: 'hdtool',
consumerId: window['CFG'].consumerId
});
}, (key: string, messageObj: any) => {
this.onGotDojoinError();
});
} else {
this.broadcast('callApi', 1, 'doJoin', {
activityId: window['CFG'].actId,
activityType: 'hdtool',
consumerId: window['CFG'].consumerId
});
} */
}
onGotDojoin
()
{
console
.
log
(
'onGotDojoin'
,
this
.
doJoin
);
this
.
broadcast
(
'callApi'
,
1
,
'getNgameStartStatus'
,
{
orderId
:
this
.
doJoin
});
}
onGotDojoinError
(
data
?)
{
console
.
log
(
'onGotDojoinError'
)
console
.
log
(
this
.
doJoin
)
console
.
log
(
data
)
}
onGot_getNgameStartStatus
()
{
console
.
log
(
'onGot_getNgameStartStatus'
,
this
.
getNgameStartStatus
);
//fuck 不可以循环引用
this
.
bubbling
(
'fuck'
,
'play'
);
}
onGotError_getNgameStartStatus
()
{
console
.
log
(
this
.
getNgameStartStatus
)
console
.
log
(
'onGotError_getNgameStartStatus'
);
}
onClick_rulebtn
()
{
console
.
log
(
'onClick_rulebtn'
);
this
.
bubbling
(
'showDialog'
,
'Rule'
);
}
onClick_recordbtn
()
{
console
.
log
(
'onClick_rulebtn'
);
//this.bubbling('showDialog', 'Rule');
}
onClick_rankbtn
()
{
alert
(
'onClick_rankbtn'
)
// globalEvent.emit('alert', {title: 'Success', content: 'You complete this puzzle', button: 'Next level'}, this.onAlertClose);
}
onDidEnter
(
last
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
):
void
{
this
.
entity
.
enabled
=
true
;
}
onDidLeave
(
next
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
):
void
{
this
.
entity
.
enabled
=
false
;
}
async
onWillEnter
(
last
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
)
{
}
async
onWillLeave
(
next
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
)
{
}
onWillMount
(
last
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
):
Promise
<
any
>
{
return
undefined
;
}
onWillUnMount
(
next
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
):
Promise
<
any
>
{
return
undefined
;
}
}
.history/assets/scripts/scenes/SceneStart_20190620164829.ts
0 → 100644
View file @
9d5f3970
/**
* Created by rockyl on 2019-04-09.
*/
import
ScillaComponent
from
"scilla-components/src/base/ScillaComponent"
;
import
{
dynamic
,
Entity
,
Tween
}
from
"scilla/src"
;
import
{
setText
}
from
"../entityUtils"
;
import
{
alien
}
from
"../navigator/StackNavigator"
;
import
Wave
from
'components/animation/Wave'
import
{
INavigatorViewBase
}
from
"../navigator/VirtualNavigator"
;
import
{
Transform
}
from
'scilla-components/src'
;
import
{
createTween
,
ease
}
from
"scilla"
;
export
default
class
SceneStart
extends
ScillaComponent
implements
INavigatorViewBase
{
ajaxElement
:
dynamic
;
doJoin
:
dynamic
;
getNgameStartStatus
:
dynamic
;
countTxt
:
Entity
;
startbtn
:
Entity
;
recordbtn
:
Entity
;
pingziFront
:
Entity
;
pingziBack
:
Entity
;
rankbtn
:
Entity
;
rulebtn
:
Entity
;
gouzi
:
Entity
;
pingzi_1
:
Entity
;
pingzi_2
:
Entity
;
gouzi_pingzi
:
Entity
;
private
startBtnAnimation
;
pingziFrontTransform
:
Transform
;
pingziBackTransform
:
Transform
;
gouziTransform
:
Transform
;
pingzi_1Transform
:
Transform
;
pingzi_2Transform
:
Transform
;
gouzi_pingziTransform
:
Transform
;
onAwake
()
{
super
.
onAwake
();
this
.
setCountText
(
''
);
this
.
startBtnAnimation
=
this
.
startbtn
.
getComponent
(
Transform
);
this
.
pingziFrontTransform
=
this
.
pingziFront
.
getComponent
(
Transform
);
this
.
pingziBackTransform
=
this
.
pingziBack
.
getComponent
(
Transform
);
this
.
gouziTransform
=
this
.
gouzi
.
getComponent
(
Transform
);
this
.
pingzi_1Transform
=
this
.
pingzi_1
.
getComponent
(
Transform
);
this
.
pingzi_2Transform
=
this
.
pingzi_2
.
getComponent
(
Transform
);
this
.
gouzi_pingziTransform
=
this
.
gouzi_pingzi
.
getComponent
(
Transform
);
this
.
grabState
=
false
;
this
.
hasPrize
=
false
;
//Tween.
//egret.Tween.get(this.startBtn, {loop:true}).to({scaleX:0.9, scaleY:0.9}, 300).wait(1000).to({scaleX:1, scaleY:1}, 300);
// SingleSceneNavigator
console
.
log
(
"sd"
)
/* var sd=createTween(this.startBtnAnimation, this.startBtnAnimation)
.to({scaleX:1.2,scaleY:1.2}, 1200) */
/* createTween(this, this.startBtnAnimation)
.set({scale: {x: 0, y: 0}, alpha: 1})
.wait(100)
.to({scale: {x: 0.8, y: 0.8}}, 800)
.to({scale: {x: 1.1, y: 1.1}, alpha: 0}, 1200); */
this
.
gouzi_pingziTransform
.
alpha
=
0
createTween
(
this
,
this
.
startBtnAnimation
,
true
,{
loop
:
-
1
})
.
set
({
scale
:
{
x
:
1
,
y
:
1
}})
.
to
({
scale
:
{
x
:
.
9
,
y
:
.
9
}},
300
)
.
wait
(
1000
)
.
to
({
scale
:
{
x
:
1
,
y
:
1
}},
300
)
createTween
(
this
,
this
.
pingziBackTransform
,
true
,{
loop
:
-
1
})
.
set
({
position
:
{
x
:
47.5
}})
.
to
({
position
:
{
x
:
-
152.5
}},
1000
)
createTween
(
this
,
this
.
pingziFrontTransform
,
true
,{
loop
:
-
1
})
.
set
({
position
:
{
x
:
-
110
}})
.
to
({
position
:
{
x
:
110
}},
1000
)
.
call
(()
=>
{
//console.log(`2`)
if
(
this
.
grabState
){
this
.
grabState
=
false
;
var
time
=
1000
;
if
(
this
.
hasPrize
){
time
=
1000
;
}
else
{
time
=
1500
;
}
createTween
(
this
,
this
.
gouziTransform
,
true
,{
loop
:
0
})
.
set
({
position
:
{
y
:
132.5
}})
.
to
({
position
:
{
y
:
335
}},
time
)
.
call
(()
=>
{
if
(
this
.
hasPrize
){
this
.
hasPrize
=
false
;
this
.
pingzi_2Transform
.
alpha
=
0
this
.
gouzi_pingziTransform
.
alpha
=
1
}
})
.
to
({
position
:
{
y
:
132.5
}},
1000
)
.
call
(()
=>
{
this
.
pingzi_2Transform
.
alpha
=
1
this
.
gouzi_pingziTransform
.
alpha
=
0
})
}
})
//console.log(sd)
//.call(resolve);
}
private
setCountText
(
text
:
string
)
{
setText
(
this
.
countTxt
,
text
);
}
initGameStage
()
{
this
.
updateCountText
();
}
updateCountText
()
{
const
{
element
}
=
this
.
ajaxElement
;
let
text
=
''
if
(
element
.
freeLimit
>
0
)
{
text
=
`今日剩余免费次数:
${
element
.
freeLimit
}
次`
;
}
else
{
text
=
`
${
element
.
needCredits
}${
window
[
'CFG'
].
unitName
}
/次`
}
this
.
setCountText
(
text
);
}
grabState
=
false
;
hasPrize
=
false
;
onClick_startbtn
()
{
this
.
grabState
=
true
;
this
.
hasPrize
=
true
;
/* if (window['getDuibaToken']) {
window['getDuibaToken']((tokenObj: any) => {
this.broadcast('callApi', 1, 'doJoin', {
token:tokenObj.token,
activityId: window['CFG'].actId,
activityType: 'hdtool',
consumerId: window['CFG'].consumerId
});
}, (key: string, messageObj: any) => {
this.onGotDojoinError();
});
} else {
this.broadcast('callApi', 1, 'doJoin', {
activityId: window['CFG'].actId,
activityType: 'hdtool',
consumerId: window['CFG'].consumerId
});
} */
}
onGotDojoin
()
{
console
.
log
(
'onGotDojoin'
,
this
.
doJoin
);
this
.
broadcast
(
'callApi'
,
1
,
'getNgameStartStatus'
,
{
orderId
:
this
.
doJoin
});
}
onGotDojoinError
(
data
?)
{
console
.
log
(
'onGotDojoinError'
)
console
.
log
(
this
.
doJoin
)
console
.
log
(
data
)
}
onGot_getNgameStartStatus
()
{
console
.
log
(
'onGot_getNgameStartStatus'
,
this
.
getNgameStartStatus
);
//fuck 不可以循环引用
this
.
bubbling
(
'fuck'
,
'play'
);
}
onGotError_getNgameStartStatus
()
{
console
.
log
(
this
.
getNgameStartStatus
)
console
.
log
(
'onGotError_getNgameStartStatus'
);
}
onClick_rulebtn
()
{
console
.
log
(
'onClick_rulebtn'
);
this
.
bubbling
(
'showDialog'
,
'Rule'
);
}
onClick_recordbtn
()
{
console
.
log
(
'onClick_rulebtn'
);
//this.bubbling('showDialog', 'Rule');
}
onClick_rankbtn
()
{
alert
(
'onClick_rankbtn'
)
// globalEvent.emit('alert', {title: 'Success', content: 'You complete this puzzle', button: 'Next level'}, this.onAlertClose);
}
onDidEnter
(
last
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
):
void
{
this
.
entity
.
enabled
=
true
;
}
onDidLeave
(
next
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
):
void
{
this
.
entity
.
enabled
=
false
;
}
async
onWillEnter
(
last
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
)
{
}
async
onWillLeave
(
next
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
)
{
}
onWillMount
(
last
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
):
Promise
<
any
>
{
return
undefined
;
}
onWillUnMount
(
next
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
):
Promise
<
any
>
{
return
undefined
;
}
}
.history/assets/scripts/scenes/SceneStart_20190620165016.ts
0 → 100644
View file @
9d5f3970
/**
* Created by rockyl on 2019-04-09.
*/
import
ScillaComponent
from
"scilla-components/src/base/ScillaComponent"
;
import
{
dynamic
,
Entity
,
Tween
}
from
"scilla/src"
;
import
{
setText
}
from
"../entityUtils"
;
import
{
alien
}
from
"../navigator/StackNavigator"
;
import
Wave
from
'components/animation/Wave'
import
{
INavigatorViewBase
}
from
"../navigator/VirtualNavigator"
;
import
{
Transform
}
from
'scilla-components/src'
;
import
{
createTween
,
ease
}
from
"scilla"
;
export
default
class
SceneStart
extends
ScillaComponent
implements
INavigatorViewBase
{
ajaxElement
:
dynamic
;
doJoin
:
dynamic
;
getNgameStartStatus
:
dynamic
;
countTxt
:
Entity
;
startbtn
:
Entity
;
recordbtn
:
Entity
;
pingziFront
:
Entity
;
pingziBack
:
Entity
;
rankbtn
:
Entity
;
rulebtn
:
Entity
;
gouzi
:
Entity
;
pingzi_1
:
Entity
;
pingzi_2
:
Entity
;
gouzi_pingzi
:
Entity
;
private
startBtnAnimation
;
pingziFrontTransform
:
Transform
;
pingziBackTransform
:
Transform
;
gouziTransform
:
Transform
;
pingzi_1Transform
:
Transform
;
pingzi_2Transform
:
Transform
;
gouzi_pingziTransform
:
Transform
;
onAwake
()
{
super
.
onAwake
();
this
.
setCountText
(
''
);
this
.
startBtnAnimation
=
this
.
startbtn
.
getComponent
(
Transform
);
this
.
pingziFrontTransform
=
this
.
pingziFront
.
getComponent
(
Transform
);
this
.
pingziBackTransform
=
this
.
pingziBack
.
getComponent
(
Transform
);
this
.
gouziTransform
=
this
.
gouzi
.
getComponent
(
Transform
);
this
.
pingzi_1Transform
=
this
.
pingzi_1
.
getComponent
(
Transform
);
this
.
pingzi_2Transform
=
this
.
pingzi_2
.
getComponent
(
Transform
);
this
.
gouzi_pingziTransform
=
this
.
gouzi_pingzi
.
getComponent
(
Transform
);
this
.
grabState
=
false
;
this
.
hasPrize
=
false
;
//Tween.
//egret.Tween.get(this.startBtn, {loop:true}).to({scaleX:0.9, scaleY:0.9}, 300).wait(1000).to({scaleX:1, scaleY:1}, 300);
// SingleSceneNavigator
console
.
log
(
"sd"
)
/* var sd=createTween(this.startBtnAnimation, this.startBtnAnimation)
.to({scaleX:1.2,scaleY:1.2}, 1200) */
/* createTween(this, this.startBtnAnimation)
.set({scale: {x: 0, y: 0}, alpha: 1})
.wait(100)
.to({scale: {x: 0.8, y: 0.8}}, 800)
.to({scale: {x: 1.1, y: 1.1}, alpha: 0}, 1200); */
this
.
gouzi_pingziTransform
.
alpha
=
0
createTween
(
this
,
this
.
startBtnAnimation
,
true
,{
loop
:
-
1
})
.
set
({
scale
:
{
x
:
1
,
y
:
1
}})
.
to
({
scale
:
{
x
:
.
9
,
y
:
.
9
}},
300
)
.
wait
(
1000
)
.
to
({
scale
:
{
x
:
1
,
y
:
1
}},
300
)
createTween
(
this
,
this
.
pingziBackTransform
,
true
,{
loop
:
-
1
})
.
set
({
position
:
{
x
:
47.5
}})
.
to
({
position
:
{
x
:
-
152.5
}},
1000
)
createTween
(
this
,
this
.
pingziFrontTransform
,
true
,{
loop
:
-
1
})
.
set
({
position
:
{
x
:
-
110
}})
.
to
({
position
:
{
x
:
110
}},
1000
)
.
call
(()
=>
{
//console.log(`2`)
if
(
this
.
grabState
){
this
.
grabState
=
false
;
var
time
=
1000
;
if
(
this
.
hasPrize
){
time
=
1000
;
}
else
{
time
=
1500
;
}
createTween
(
this
,
this
.
gouziTransform
,
true
,{
loop
:
0
})
.
set
({
position
:
{
y
:
132.5
}})
.
to
({
position
:
{
y
:
335
}},
time
)
.
call
(()
=>
{
if
(
this
.
hasPrize
){
this
.
hasPrize
=
false
;
this
.
pingzi_2Transform
.
alpha
=
0
this
.
gouzi_pingziTransform
.
alpha
=
1
}
})
.
to
({
position
:
{
y
:
132.5
}},
1000
)
.
call
(()
=>
{
this
.
pingzi_2Transform
.
alpha
=
1
this
.
gouzi_pingziTransform
.
alpha
=
0
})
}
})
//console.log(sd)
//.call(resolve);
}
private
setCountText
(
text
:
string
)
{
setText
(
this
.
countTxt
,
text
);
}
initGameStage
()
{
this
.
updateCountText
();
}
updateCountText
()
{
const
{
element
}
=
this
.
ajaxElement
;
let
text
=
''
if
(
element
.
freeLimit
>
0
)
{
text
=
`今日剩余免费次数:
${
element
.
freeLimit
}
次`
;
}
else
{
text
=
`
${
element
.
needCredits
}${
window
[
'CFG'
].
unitName
}
/次`
}
this
.
setCountText
(
text
);
}
grabState
=
false
;
hasPrize
=
false
;
onClick_startbtn
()
{
this
.
grabState
=
true
;
this
.
hasPrize
=
false
;
/* if (window['getDuibaToken']) {
window['getDuibaToken']((tokenObj: any) => {
this.broadcast('callApi', 1, 'doJoin', {
token:tokenObj.token,
activityId: window['CFG'].actId,
activityType: 'hdtool',
consumerId: window['CFG'].consumerId
});
}, (key: string, messageObj: any) => {
this.onGotDojoinError();
});
} else {
this.broadcast('callApi', 1, 'doJoin', {
activityId: window['CFG'].actId,
activityType: 'hdtool',
consumerId: window['CFG'].consumerId
});
} */
}
onGotDojoin
()
{
console
.
log
(
'onGotDojoin'
,
this
.
doJoin
);
this
.
broadcast
(
'callApi'
,
1
,
'getNgameStartStatus'
,
{
orderId
:
this
.
doJoin
});
}
onGotDojoinError
(
data
?)
{
console
.
log
(
'onGotDojoinError'
)
console
.
log
(
this
.
doJoin
)
console
.
log
(
data
)
}
onGot_getNgameStartStatus
()
{
console
.
log
(
'onGot_getNgameStartStatus'
,
this
.
getNgameStartStatus
);
//fuck 不可以循环引用
this
.
bubbling
(
'fuck'
,
'play'
);
}
onGotError_getNgameStartStatus
()
{
console
.
log
(
this
.
getNgameStartStatus
)
console
.
log
(
'onGotError_getNgameStartStatus'
);
}
onClick_rulebtn
()
{
console
.
log
(
'onClick_rulebtn'
);
this
.
bubbling
(
'showDialog'
,
'Rule'
);
}
onClick_recordbtn
()
{
console
.
log
(
'onClick_rulebtn'
);
//this.bubbling('showDialog', 'Rule');
}
onClick_rankbtn
()
{
alert
(
'onClick_rankbtn'
)
// globalEvent.emit('alert', {title: 'Success', content: 'You complete this puzzle', button: 'Next level'}, this.onAlertClose);
}
onDidEnter
(
last
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
):
void
{
this
.
entity
.
enabled
=
true
;
}
onDidLeave
(
next
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
):
void
{
this
.
entity
.
enabled
=
false
;
}
async
onWillEnter
(
last
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
)
{
}
async
onWillLeave
(
next
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
)
{
}
onWillMount
(
last
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
):
Promise
<
any
>
{
return
undefined
;
}
onWillUnMount
(
next
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
):
Promise
<
any
>
{
return
undefined
;
}
}
.history/assets/scripts/scenes/SceneStart_20190620165200.ts
0 → 100644
View file @
9d5f3970
/**
* Created by rockyl on 2019-04-09.
*/
import
ScillaComponent
from
"scilla-components/src/base/ScillaComponent"
;
import
{
dynamic
,
Entity
,
Tween
}
from
"scilla/src"
;
import
{
setText
}
from
"../entityUtils"
;
import
{
alien
}
from
"../navigator/StackNavigator"
;
import
Wave
from
'components/animation/Wave'
import
{
INavigatorViewBase
}
from
"../navigator/VirtualNavigator"
;
import
{
Transform
}
from
'scilla-components/src'
;
import
{
createTween
,
ease
}
from
"scilla"
;
export
default
class
SceneStart
extends
ScillaComponent
implements
INavigatorViewBase
{
ajaxElement
:
dynamic
;
doJoin
:
dynamic
;
getNgameStartStatus
:
dynamic
;
countTxt
:
Entity
;
startbtn
:
Entity
;
recordbtn
:
Entity
;
pingziFront
:
Entity
;
pingziBack
:
Entity
;
rankbtn
:
Entity
;
rulebtn
:
Entity
;
gouzi
:
Entity
;
pingzi_1
:
Entity
;
pingzi_2
:
Entity
;
gouzi_pingzi
:
Entity
;
private
startBtnAnimation
;
pingziFrontTransform
:
Transform
;
pingziBackTransform
:
Transform
;
gouziTransform
:
Transform
;
pingzi_1Transform
:
Transform
;
pingzi_2Transform
:
Transform
;
gouzi_pingziTransform
:
Transform
;
onAwake
()
{
super
.
onAwake
();
this
.
setCountText
(
''
);
this
.
startBtnAnimation
=
this
.
startbtn
.
getComponent
(
Transform
);
this
.
pingziFrontTransform
=
this
.
pingziFront
.
getComponent
(
Transform
);
this
.
pingziBackTransform
=
this
.
pingziBack
.
getComponent
(
Transform
);
this
.
gouziTransform
=
this
.
gouzi
.
getComponent
(
Transform
);
this
.
pingzi_1Transform
=
this
.
pingzi_1
.
getComponent
(
Transform
);
this
.
pingzi_2Transform
=
this
.
pingzi_2
.
getComponent
(
Transform
);
this
.
gouzi_pingziTransform
=
this
.
gouzi_pingzi
.
getComponent
(
Transform
);
this
.
grabState
=
false
;
this
.
hasPrize
=
false
;
//Tween.
//egret.Tween.get(this.startBtn, {loop:true}).to({scaleX:0.9, scaleY:0.9}, 300).wait(1000).to({scaleX:1, scaleY:1}, 300);
// SingleSceneNavigator
console
.
log
(
"sd"
)
/* var sd=createTween(this.startBtnAnimation, this.startBtnAnimation)
.to({scaleX:1.2,scaleY:1.2}, 1200) */
/* createTween(this, this.startBtnAnimation)
.set({scale: {x: 0, y: 0}, alpha: 1})
.wait(100)
.to({scale: {x: 0.8, y: 0.8}}, 800)
.to({scale: {x: 1.1, y: 1.1}, alpha: 0}, 1200); */
this
.
gouzi_pingziTransform
.
alpha
=
0
createTween
(
this
,
this
.
startBtnAnimation
,
true
,{
loop
:
-
1
})
.
set
({
scale
:
{
x
:
1
,
y
:
1
}})
.
to
({
scale
:
{
x
:
.
9
,
y
:
.
9
}},
300
)
.
wait
(
1000
)
.
to
({
scale
:
{
x
:
1
,
y
:
1
}},
300
)
createTween
(
this
,
this
.
pingziBackTransform
,
true
,{
loop
:
-
1
})
.
set
({
position
:
{
x
:
47.5
}})
.
to
({
position
:
{
x
:
-
152.5
}},
1000
)
createTween
(
this
,
this
.
pingziFrontTransform
,
true
,{
loop
:
-
1
})
.
set
({
position
:
{
x
:
-
110
}})
.
to
({
position
:
{
x
:
110
}},
1000
)
.
call
(()
=>
{
//console.log(`2`)
if
(
this
.
grabState
){
this
.
grabState
=
false
;
var
time
=
1000
;
if
(
this
.
hasPrize
){
time
=
1000
;
}
else
{
time
=
1500
;
}
createTween
(
this
,
this
.
gouziTransform
,
true
,{
loop
:
0
})
.
set
({
position
:
{
y
:
132.5
}})
.
to
({
position
:
{
y
:
335
}},
time
)
.
call
(()
=>
{
if
(
this
.
hasPrize
){
this
.
hasPrize
=
false
;
this
.
pingzi_2Transform
.
alpha
=
0
this
.
gouzi_pingziTransform
.
alpha
=
1
}
})
.
to
({
position
:
{
y
:
132.5
}},
1000
)
.
call
(()
=>
{
this
.
pingzi_2Transform
.
alpha
=
1
this
.
gouzi_pingziTransform
.
alpha
=
0
})
}
})
//console.log(sd)
//.call(resolve);
}
private
setCountText
(
text
:
string
)
{
setText
(
this
.
countTxt
,
text
);
}
initGameStage
()
{
this
.
updateCountText
();
}
updateCountText
()
{
const
{
element
}
=
this
.
ajaxElement
;
let
text
=
''
if
(
element
.
freeLimit
>
0
)
{
text
=
`今日剩余免费次数:
${
element
.
freeLimit
}
次`
;
}
else
{
text
=
`
${
element
.
needCredits
}${
window
[
'CFG'
].
unitName
}
/次`
}
this
.
setCountText
(
text
);
}
grabState
=
false
;
hasPrize
=
false
;
onClick_startbtn
()
{
this
.
grabState
=
true
;
this
.
hasPrize
=
true
;
/* if (window['getDuibaToken']) {
window['getDuibaToken']((tokenObj: any) => {
this.broadcast('callApi', 1, 'doJoin', {
token:tokenObj.token,
activityId: window['CFG'].actId,
activityType: 'hdtool',
consumerId: window['CFG'].consumerId
});
}, (key: string, messageObj: any) => {
this.onGotDojoinError();
});
} else {
this.broadcast('callApi', 1, 'doJoin', {
activityId: window['CFG'].actId,
activityType: 'hdtool',
consumerId: window['CFG'].consumerId
});
} */
}
onGotDojoin
()
{
console
.
log
(
'onGotDojoin'
,
this
.
doJoin
);
this
.
broadcast
(
'callApi'
,
1
,
'getNgameStartStatus'
,
{
orderId
:
this
.
doJoin
});
}
onGotDojoinError
(
data
?)
{
console
.
log
(
'onGotDojoinError'
)
console
.
log
(
this
.
doJoin
)
console
.
log
(
data
)
}
onGot_getNgameStartStatus
()
{
console
.
log
(
'onGot_getNgameStartStatus'
,
this
.
getNgameStartStatus
);
//fuck 不可以循环引用
this
.
bubbling
(
'fuck'
,
'play'
);
}
onGotError_getNgameStartStatus
()
{
console
.
log
(
this
.
getNgameStartStatus
)
console
.
log
(
'onGotError_getNgameStartStatus'
);
}
onClick_rulebtn
()
{
console
.
log
(
'onClick_rulebtn'
);
this
.
bubbling
(
'showDialog'
,
'Rule'
);
}
onClick_recordbtn
()
{
console
.
log
(
'onClick_rulebtn'
);
//this.bubbling('showDialog', 'Rule');
}
onClick_rankbtn
()
{
alert
(
'onClick_rankbtn'
)
// globalEvent.emit('alert', {title: 'Success', content: 'You complete this puzzle', button: 'Next level'}, this.onAlertClose);
}
onDidEnter
(
last
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
):
void
{
this
.
entity
.
enabled
=
true
;
}
onDidLeave
(
next
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
):
void
{
this
.
entity
.
enabled
=
false
;
}
async
onWillEnter
(
last
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
)
{
}
async
onWillLeave
(
next
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
)
{
}
onWillMount
(
last
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
):
Promise
<
any
>
{
return
undefined
;
}
onWillUnMount
(
next
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
):
Promise
<
any
>
{
return
undefined
;
}
}
.history/assets/scripts/scenes/SceneStart_20190620165216.ts
0 → 100644
View file @
9d5f3970
/**
* Created by rockyl on 2019-04-09.
*/
import
ScillaComponent
from
"scilla-components/src/base/ScillaComponent"
;
import
{
dynamic
,
Entity
,
Tween
}
from
"scilla/src"
;
import
{
setText
}
from
"../entityUtils"
;
import
{
alien
}
from
"../navigator/StackNavigator"
;
import
Wave
from
'components/animation/Wave'
import
{
INavigatorViewBase
}
from
"../navigator/VirtualNavigator"
;
import
{
Transform
}
from
'scilla-components/src'
;
import
{
createTween
,
ease
}
from
"scilla"
;
export
default
class
SceneStart
extends
ScillaComponent
implements
INavigatorViewBase
{
ajaxElement
:
dynamic
;
doJoin
:
dynamic
;
getNgameStartStatus
:
dynamic
;
countTxt
:
Entity
;
startbtn
:
Entity
;
recordbtn
:
Entity
;
pingziFront
:
Entity
;
pingziBack
:
Entity
;
rankbtn
:
Entity
;
rulebtn
:
Entity
;
gouzi
:
Entity
;
pingzi_1
:
Entity
;
pingzi_2
:
Entity
;
gouzi_pingzi
:
Entity
;
private
startBtnAnimation
;
pingziFrontTransform
:
Transform
;
pingziBackTransform
:
Transform
;
gouziTransform
:
Transform
;
pingzi_1Transform
:
Transform
;
pingzi_2Transform
:
Transform
;
gouzi_pingziTransform
:
Transform
;
onAwake
()
{
super
.
onAwake
();
this
.
setCountText
(
''
);
this
.
startBtnAnimation
=
this
.
startbtn
.
getComponent
(
Transform
);
this
.
pingziFrontTransform
=
this
.
pingziFront
.
getComponent
(
Transform
);
this
.
pingziBackTransform
=
this
.
pingziBack
.
getComponent
(
Transform
);
this
.
gouziTransform
=
this
.
gouzi
.
getComponent
(
Transform
);
this
.
pingzi_1Transform
=
this
.
pingzi_1
.
getComponent
(
Transform
);
this
.
pingzi_2Transform
=
this
.
pingzi_2
.
getComponent
(
Transform
);
this
.
gouzi_pingziTransform
=
this
.
gouzi_pingzi
.
getComponent
(
Transform
);
this
.
grabState
=
false
;
this
.
hasPrize
=
false
;
//Tween.
//egret.Tween.get(this.startBtn, {loop:true}).to({scaleX:0.9, scaleY:0.9}, 300).wait(1000).to({scaleX:1, scaleY:1}, 300);
// SingleSceneNavigator
console
.
log
(
"sd"
)
/* var sd=createTween(this.startBtnAnimation, this.startBtnAnimation)
.to({scaleX:1.2,scaleY:1.2}, 1200) */
/* createTween(this, this.startBtnAnimation)
.set({scale: {x: 0, y: 0}, alpha: 1})
.wait(100)
.to({scale: {x: 0.8, y: 0.8}}, 800)
.to({scale: {x: 1.1, y: 1.1}, alpha: 0}, 1200); */
this
.
gouzi_pingziTransform
.
alpha
=
0
createTween
(
this
,
this
.
startBtnAnimation
,
true
,{
loop
:
-
1
})
.
set
({
scale
:
{
x
:
1
,
y
:
1
}})
.
to
({
scale
:
{
x
:
.
9
,
y
:
.
9
}},
300
)
.
wait
(
1000
)
.
to
({
scale
:
{
x
:
1
,
y
:
1
}},
300
)
createTween
(
this
,
this
.
pingziBackTransform
,
true
,{
loop
:
-
1
})
.
set
({
position
:
{
x
:
47.5
}})
.
to
({
position
:
{
x
:
-
152.5
}},
1000
)
createTween
(
this
,
this
.
pingziFrontTransform
,
true
,{
loop
:
-
1
})
.
set
({
position
:
{
x
:
-
110
}})
.
to
({
position
:
{
x
:
110
}},
1000
)
.
call
(()
=>
{
//console.log(`2`)
if
(
this
.
grabState
){
this
.
grabState
=
false
;
var
time
=
1000
;
if
(
this
.
hasPrize
){
time
=
1000
;
}
else
{
time
=
1500
;
}
createTween
(
this
,
this
.
gouziTransform
,
true
,{
loop
:
0
})
.
set
({
position
:
{
y
:
132.5
}})
.
to
({
position
:
{
y
:
335
}},
time
)
.
call
(()
=>
{
if
(
this
.
hasPrize
){
this
.
hasPrize
=
false
;
this
.
pingzi_2Transform
.
alpha
=
0
this
.
gouzi_pingziTransform
.
alpha
=
1
}
})
.
to
({
position
:
{
y
:
132.5
}},
2000
)
.
call
(()
=>
{
this
.
pingzi_2Transform
.
alpha
=
1
this
.
gouzi_pingziTransform
.
alpha
=
0
})
}
})
//console.log(sd)
//.call(resolve);
}
private
setCountText
(
text
:
string
)
{
setText
(
this
.
countTxt
,
text
);
}
initGameStage
()
{
this
.
updateCountText
();
}
updateCountText
()
{
const
{
element
}
=
this
.
ajaxElement
;
let
text
=
''
if
(
element
.
freeLimit
>
0
)
{
text
=
`今日剩余免费次数:
${
element
.
freeLimit
}
次`
;
}
else
{
text
=
`
${
element
.
needCredits
}${
window
[
'CFG'
].
unitName
}
/次`
}
this
.
setCountText
(
text
);
}
grabState
=
false
;
hasPrize
=
false
;
onClick_startbtn
()
{
this
.
grabState
=
true
;
this
.
hasPrize
=
true
;
/* if (window['getDuibaToken']) {
window['getDuibaToken']((tokenObj: any) => {
this.broadcast('callApi', 1, 'doJoin', {
token:tokenObj.token,
activityId: window['CFG'].actId,
activityType: 'hdtool',
consumerId: window['CFG'].consumerId
});
}, (key: string, messageObj: any) => {
this.onGotDojoinError();
});
} else {
this.broadcast('callApi', 1, 'doJoin', {
activityId: window['CFG'].actId,
activityType: 'hdtool',
consumerId: window['CFG'].consumerId
});
} */
}
onGotDojoin
()
{
console
.
log
(
'onGotDojoin'
,
this
.
doJoin
);
this
.
broadcast
(
'callApi'
,
1
,
'getNgameStartStatus'
,
{
orderId
:
this
.
doJoin
});
}
onGotDojoinError
(
data
?)
{
console
.
log
(
'onGotDojoinError'
)
console
.
log
(
this
.
doJoin
)
console
.
log
(
data
)
}
onGot_getNgameStartStatus
()
{
console
.
log
(
'onGot_getNgameStartStatus'
,
this
.
getNgameStartStatus
);
//fuck 不可以循环引用
this
.
bubbling
(
'fuck'
,
'play'
);
}
onGotError_getNgameStartStatus
()
{
console
.
log
(
this
.
getNgameStartStatus
)
console
.
log
(
'onGotError_getNgameStartStatus'
);
}
onClick_rulebtn
()
{
console
.
log
(
'onClick_rulebtn'
);
this
.
bubbling
(
'showDialog'
,
'Rule'
);
}
onClick_recordbtn
()
{
console
.
log
(
'onClick_rulebtn'
);
//this.bubbling('showDialog', 'Rule');
}
onClick_rankbtn
()
{
alert
(
'onClick_rankbtn'
)
// globalEvent.emit('alert', {title: 'Success', content: 'You complete this puzzle', button: 'Next level'}, this.onAlertClose);
}
onDidEnter
(
last
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
):
void
{
this
.
entity
.
enabled
=
true
;
}
onDidLeave
(
next
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
):
void
{
this
.
entity
.
enabled
=
false
;
}
async
onWillEnter
(
last
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
)
{
}
async
onWillLeave
(
next
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
)
{
}
onWillMount
(
last
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
):
Promise
<
any
>
{
return
undefined
;
}
onWillUnMount
(
next
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
):
Promise
<
any
>
{
return
undefined
;
}
}
.history/assets/scripts/scenes/SceneStart_20190620165228.ts
0 → 100644
View file @
9d5f3970
/**
* Created by rockyl on 2019-04-09.
*/
import
ScillaComponent
from
"scilla-components/src/base/ScillaComponent"
;
import
{
dynamic
,
Entity
,
Tween
}
from
"scilla/src"
;
import
{
setText
}
from
"../entityUtils"
;
import
{
alien
}
from
"../navigator/StackNavigator"
;
import
Wave
from
'components/animation/Wave'
import
{
INavigatorViewBase
}
from
"../navigator/VirtualNavigator"
;
import
{
Transform
}
from
'scilla-components/src'
;
import
{
createTween
,
ease
}
from
"scilla"
;
export
default
class
SceneStart
extends
ScillaComponent
implements
INavigatorViewBase
{
ajaxElement
:
dynamic
;
doJoin
:
dynamic
;
getNgameStartStatus
:
dynamic
;
countTxt
:
Entity
;
startbtn
:
Entity
;
recordbtn
:
Entity
;
pingziFront
:
Entity
;
pingziBack
:
Entity
;
rankbtn
:
Entity
;
rulebtn
:
Entity
;
gouzi
:
Entity
;
pingzi_1
:
Entity
;
pingzi_2
:
Entity
;
gouzi_pingzi
:
Entity
;
private
startBtnAnimation
;
pingziFrontTransform
:
Transform
;
pingziBackTransform
:
Transform
;
gouziTransform
:
Transform
;
pingzi_1Transform
:
Transform
;
pingzi_2Transform
:
Transform
;
gouzi_pingziTransform
:
Transform
;
onAwake
()
{
super
.
onAwake
();
this
.
setCountText
(
''
);
this
.
startBtnAnimation
=
this
.
startbtn
.
getComponent
(
Transform
);
this
.
pingziFrontTransform
=
this
.
pingziFront
.
getComponent
(
Transform
);
this
.
pingziBackTransform
=
this
.
pingziBack
.
getComponent
(
Transform
);
this
.
gouziTransform
=
this
.
gouzi
.
getComponent
(
Transform
);
this
.
pingzi_1Transform
=
this
.
pingzi_1
.
getComponent
(
Transform
);
this
.
pingzi_2Transform
=
this
.
pingzi_2
.
getComponent
(
Transform
);
this
.
gouzi_pingziTransform
=
this
.
gouzi_pingzi
.
getComponent
(
Transform
);
this
.
grabState
=
false
;
this
.
hasPrize
=
false
;
//Tween.
//egret.Tween.get(this.startBtn, {loop:true}).to({scaleX:0.9, scaleY:0.9}, 300).wait(1000).to({scaleX:1, scaleY:1}, 300);
// SingleSceneNavigator
console
.
log
(
"sd"
)
/* var sd=createTween(this.startBtnAnimation, this.startBtnAnimation)
.to({scaleX:1.2,scaleY:1.2}, 1200) */
/* createTween(this, this.startBtnAnimation)
.set({scale: {x: 0, y: 0}, alpha: 1})
.wait(100)
.to({scale: {x: 0.8, y: 0.8}}, 800)
.to({scale: {x: 1.1, y: 1.1}, alpha: 0}, 1200); */
this
.
gouzi_pingziTransform
.
alpha
=
0
createTween
(
this
,
this
.
startBtnAnimation
,
true
,{
loop
:
-
1
})
.
set
({
scale
:
{
x
:
1
,
y
:
1
}})
.
to
({
scale
:
{
x
:
.
9
,
y
:
.
9
}},
300
)
.
wait
(
1000
)
.
to
({
scale
:
{
x
:
1
,
y
:
1
}},
300
)
createTween
(
this
,
this
.
pingziBackTransform
,
true
,{
loop
:
-
1
})
.
set
({
position
:
{
x
:
47.5
}})
.
to
({
position
:
{
x
:
-
152.5
}},
1000
)
createTween
(
this
,
this
.
pingziFrontTransform
,
true
,{
loop
:
-
1
})
.
set
({
position
:
{
x
:
-
110
}})
.
to
({
position
:
{
x
:
110
}},
1000
)
.
call
(()
=>
{
//console.log(`2`)
if
(
this
.
grabState
){
this
.
grabState
=
false
;
var
time
=
1000
;
if
(
this
.
hasPrize
){
time
=
1000
;
}
else
{
time
=
1500
;
}
createTween
(
this
,
this
.
gouziTransform
,
true
,{
loop
:
0
})
.
set
({
position
:
{
y
:
132.5
}})
.
to
({
position
:
{
y
:
335
}},
time
)
.
call
(()
=>
{
if
(
this
.
hasPrize
){
this
.
hasPrize
=
false
;
this
.
pingzi_2Transform
.
alpha
=
0
this
.
gouzi_pingziTransform
.
alpha
=
1
}
})
.
to
({
position
:
{
y
:
132.5
}},
1000
)
.
call
(()
=>
{
this
.
pingzi_2Transform
.
alpha
=
1
this
.
gouzi_pingziTransform
.
alpha
=
0
})
}
})
//console.log(sd)
//.call(resolve);
}
private
setCountText
(
text
:
string
)
{
setText
(
this
.
countTxt
,
text
);
}
initGameStage
()
{
this
.
updateCountText
();
}
updateCountText
()
{
const
{
element
}
=
this
.
ajaxElement
;
let
text
=
''
if
(
element
.
freeLimit
>
0
)
{
text
=
`今日剩余免费次数:
${
element
.
freeLimit
}
次`
;
}
else
{
text
=
`
${
element
.
needCredits
}${
window
[
'CFG'
].
unitName
}
/次`
}
this
.
setCountText
(
text
);
}
grabState
=
false
;
hasPrize
=
false
;
onClick_startbtn
()
{
this
.
grabState
=
true
;
this
.
hasPrize
=
true
;
/* if (window['getDuibaToken']) {
window['getDuibaToken']((tokenObj: any) => {
this.broadcast('callApi', 1, 'doJoin', {
token:tokenObj.token,
activityId: window['CFG'].actId,
activityType: 'hdtool',
consumerId: window['CFG'].consumerId
});
}, (key: string, messageObj: any) => {
this.onGotDojoinError();
});
} else {
this.broadcast('callApi', 1, 'doJoin', {
activityId: window['CFG'].actId,
activityType: 'hdtool',
consumerId: window['CFG'].consumerId
});
} */
}
onGotDojoin
()
{
console
.
log
(
'onGotDojoin'
,
this
.
doJoin
);
this
.
broadcast
(
'callApi'
,
1
,
'getNgameStartStatus'
,
{
orderId
:
this
.
doJoin
});
}
onGotDojoinError
(
data
?)
{
console
.
log
(
'onGotDojoinError'
)
console
.
log
(
this
.
doJoin
)
console
.
log
(
data
)
}
onGot_getNgameStartStatus
()
{
console
.
log
(
'onGot_getNgameStartStatus'
,
this
.
getNgameStartStatus
);
//fuck 不可以循环引用
this
.
bubbling
(
'fuck'
,
'play'
);
}
onGotError_getNgameStartStatus
()
{
console
.
log
(
this
.
getNgameStartStatus
)
console
.
log
(
'onGotError_getNgameStartStatus'
);
}
onClick_rulebtn
()
{
console
.
log
(
'onClick_rulebtn'
);
this
.
bubbling
(
'showDialog'
,
'Rule'
);
}
onClick_recordbtn
()
{
console
.
log
(
'onClick_rulebtn'
);
//this.bubbling('showDialog', 'Rule');
}
onClick_rankbtn
()
{
alert
(
'onClick_rankbtn'
)
// globalEvent.emit('alert', {title: 'Success', content: 'You complete this puzzle', button: 'Next level'}, this.onAlertClose);
}
onDidEnter
(
last
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
):
void
{
this
.
entity
.
enabled
=
true
;
}
onDidLeave
(
next
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
):
void
{
this
.
entity
.
enabled
=
false
;
}
async
onWillEnter
(
last
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
)
{
}
async
onWillLeave
(
next
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
)
{
}
onWillMount
(
last
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
):
Promise
<
any
>
{
return
undefined
;
}
onWillUnMount
(
next
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
):
Promise
<
any
>
{
return
undefined
;
}
}
.history/assets/scripts/scenes/SceneStart_20190620165300.ts
0 → 100644
View file @
9d5f3970
/**
* Created by rockyl on 2019-04-09.
*/
import
ScillaComponent
from
"scilla-components/src/base/ScillaComponent"
;
import
{
dynamic
,
Entity
,
Tween
}
from
"scilla/src"
;
import
{
setText
}
from
"../entityUtils"
;
import
{
alien
}
from
"../navigator/StackNavigator"
;
import
Wave
from
'components/animation/Wave'
import
{
INavigatorViewBase
}
from
"../navigator/VirtualNavigator"
;
import
{
Transform
}
from
'scilla-components/src'
;
import
{
createTween
,
ease
}
from
"scilla"
;
export
default
class
SceneStart
extends
ScillaComponent
implements
INavigatorViewBase
{
ajaxElement
:
dynamic
;
doJoin
:
dynamic
;
getNgameStartStatus
:
dynamic
;
countTxt
:
Entity
;
startbtn
:
Entity
;
recordbtn
:
Entity
;
pingziFront
:
Entity
;
pingziBack
:
Entity
;
rankbtn
:
Entity
;
rulebtn
:
Entity
;
gouzi
:
Entity
;
pingzi_1
:
Entity
;
pingzi_2
:
Entity
;
gouzi_pingzi
:
Entity
;
private
startBtnAnimation
;
pingziFrontTransform
:
Transform
;
pingziBackTransform
:
Transform
;
gouziTransform
:
Transform
;
pingzi_1Transform
:
Transform
;
pingzi_2Transform
:
Transform
;
gouzi_pingziTransform
:
Transform
;
onAwake
()
{
super
.
onAwake
();
this
.
setCountText
(
''
);
this
.
startBtnAnimation
=
this
.
startbtn
.
getComponent
(
Transform
);
this
.
pingziFrontTransform
=
this
.
pingziFront
.
getComponent
(
Transform
);
this
.
pingziBackTransform
=
this
.
pingziBack
.
getComponent
(
Transform
);
this
.
gouziTransform
=
this
.
gouzi
.
getComponent
(
Transform
);
this
.
pingzi_1Transform
=
this
.
pingzi_1
.
getComponent
(
Transform
);
this
.
pingzi_2Transform
=
this
.
pingzi_2
.
getComponent
(
Transform
);
this
.
gouzi_pingziTransform
=
this
.
gouzi_pingzi
.
getComponent
(
Transform
);
this
.
grabState
=
false
;
this
.
hasPrize
=
false
;
//Tween.
//egret.Tween.get(this.startBtn, {loop:true}).to({scaleX:0.9, scaleY:0.9}, 300).wait(1000).to({scaleX:1, scaleY:1}, 300);
// SingleSceneNavigator
console
.
log
(
"sd"
)
/* var sd=createTween(this.startBtnAnimation, this.startBtnAnimation)
.to({scaleX:1.2,scaleY:1.2}, 1200) */
/* createTween(this, this.startBtnAnimation)
.set({scale: {x: 0, y: 0}, alpha: 1})
.wait(100)
.to({scale: {x: 0.8, y: 0.8}}, 800)
.to({scale: {x: 1.1, y: 1.1}, alpha: 0}, 1200); */
this
.
gouzi_pingziTransform
.
alpha
=
0
createTween
(
this
,
this
.
startBtnAnimation
,
true
,{
loop
:
-
1
})
.
set
({
scale
:
{
x
:
1
,
y
:
1
}})
.
to
({
scale
:
{
x
:
.
9
,
y
:
.
9
}},
300
)
.
wait
(
1000
)
.
to
({
scale
:
{
x
:
1
,
y
:
1
}},
300
)
createTween
(
this
,
this
.
pingziBackTransform
,
true
,{
loop
:
-
1
})
.
set
({
position
:
{
x
:
47.5
}})
.
to
({
position
:
{
x
:
-
152.5
}},
1000
)
createTween
(
this
,
this
.
pingziFrontTransform
,
true
,{
loop
:
-
1
})
.
set
({
position
:
{
x
:
-
110
}})
.
to
({
position
:
{
x
:
110
}},
1000
)
.
call
(()
=>
{
//console.log(`2`)
if
(
this
.
grabState
){
this
.
grabState
=
false
;
var
time
=
1000
;
if
(
this
.
hasPrize
){
time
=
1000
;
}
else
{
time
=
500
;
}
createTween
(
this
,
this
.
gouziTransform
,
true
,{
loop
:
0
})
.
set
({
position
:
{
y
:
132.5
}})
.
to
({
position
:
{
y
:
335
}},
time
)
.
call
(()
=>
{
if
(
this
.
hasPrize
){
this
.
hasPrize
=
false
;
this
.
pingzi_2Transform
.
alpha
=
0
this
.
gouzi_pingziTransform
.
alpha
=
1
}
})
.
to
({
position
:
{
y
:
132.5
}},
1000
)
.
call
(()
=>
{
this
.
pingzi_2Transform
.
alpha
=
1
this
.
gouzi_pingziTransform
.
alpha
=
0
})
}
})
//console.log(sd)
//.call(resolve);
}
private
setCountText
(
text
:
string
)
{
setText
(
this
.
countTxt
,
text
);
}
initGameStage
()
{
this
.
updateCountText
();
}
updateCountText
()
{
const
{
element
}
=
this
.
ajaxElement
;
let
text
=
''
if
(
element
.
freeLimit
>
0
)
{
text
=
`今日剩余免费次数:
${
element
.
freeLimit
}
次`
;
}
else
{
text
=
`
${
element
.
needCredits
}${
window
[
'CFG'
].
unitName
}
/次`
}
this
.
setCountText
(
text
);
}
grabState
=
false
;
hasPrize
=
false
;
onClick_startbtn
()
{
this
.
grabState
=
true
;
this
.
hasPrize
=
true
;
/* if (window['getDuibaToken']) {
window['getDuibaToken']((tokenObj: any) => {
this.broadcast('callApi', 1, 'doJoin', {
token:tokenObj.token,
activityId: window['CFG'].actId,
activityType: 'hdtool',
consumerId: window['CFG'].consumerId
});
}, (key: string, messageObj: any) => {
this.onGotDojoinError();
});
} else {
this.broadcast('callApi', 1, 'doJoin', {
activityId: window['CFG'].actId,
activityType: 'hdtool',
consumerId: window['CFG'].consumerId
});
} */
}
onGotDojoin
()
{
console
.
log
(
'onGotDojoin'
,
this
.
doJoin
);
this
.
broadcast
(
'callApi'
,
1
,
'getNgameStartStatus'
,
{
orderId
:
this
.
doJoin
});
}
onGotDojoinError
(
data
?)
{
console
.
log
(
'onGotDojoinError'
)
console
.
log
(
this
.
doJoin
)
console
.
log
(
data
)
}
onGot_getNgameStartStatus
()
{
console
.
log
(
'onGot_getNgameStartStatus'
,
this
.
getNgameStartStatus
);
//fuck 不可以循环引用
this
.
bubbling
(
'fuck'
,
'play'
);
}
onGotError_getNgameStartStatus
()
{
console
.
log
(
this
.
getNgameStartStatus
)
console
.
log
(
'onGotError_getNgameStartStatus'
);
}
onClick_rulebtn
()
{
console
.
log
(
'onClick_rulebtn'
);
this
.
bubbling
(
'showDialog'
,
'Rule'
);
}
onClick_recordbtn
()
{
console
.
log
(
'onClick_rulebtn'
);
//this.bubbling('showDialog', 'Rule');
}
onClick_rankbtn
()
{
alert
(
'onClick_rankbtn'
)
// globalEvent.emit('alert', {title: 'Success', content: 'You complete this puzzle', button: 'Next level'}, this.onAlertClose);
}
onDidEnter
(
last
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
):
void
{
this
.
entity
.
enabled
=
true
;
}
onDidLeave
(
next
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
):
void
{
this
.
entity
.
enabled
=
false
;
}
async
onWillEnter
(
last
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
)
{
}
async
onWillLeave
(
next
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
)
{
}
onWillMount
(
last
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
):
Promise
<
any
>
{
return
undefined
;
}
onWillUnMount
(
next
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
):
Promise
<
any
>
{
return
undefined
;
}
}
.history/assets/scripts/scenes/SceneStart_20190620165308.ts
0 → 100644
View file @
9d5f3970
/**
* Created by rockyl on 2019-04-09.
*/
import
ScillaComponent
from
"scilla-components/src/base/ScillaComponent"
;
import
{
dynamic
,
Entity
,
Tween
}
from
"scilla/src"
;
import
{
setText
}
from
"../entityUtils"
;
import
{
alien
}
from
"../navigator/StackNavigator"
;
import
Wave
from
'components/animation/Wave'
import
{
INavigatorViewBase
}
from
"../navigator/VirtualNavigator"
;
import
{
Transform
}
from
'scilla-components/src'
;
import
{
createTween
,
ease
}
from
"scilla"
;
export
default
class
SceneStart
extends
ScillaComponent
implements
INavigatorViewBase
{
ajaxElement
:
dynamic
;
doJoin
:
dynamic
;
getNgameStartStatus
:
dynamic
;
countTxt
:
Entity
;
startbtn
:
Entity
;
recordbtn
:
Entity
;
pingziFront
:
Entity
;
pingziBack
:
Entity
;
rankbtn
:
Entity
;
rulebtn
:
Entity
;
gouzi
:
Entity
;
pingzi_1
:
Entity
;
pingzi_2
:
Entity
;
gouzi_pingzi
:
Entity
;
private
startBtnAnimation
;
pingziFrontTransform
:
Transform
;
pingziBackTransform
:
Transform
;
gouziTransform
:
Transform
;
pingzi_1Transform
:
Transform
;
pingzi_2Transform
:
Transform
;
gouzi_pingziTransform
:
Transform
;
onAwake
()
{
super
.
onAwake
();
this
.
setCountText
(
''
);
this
.
startBtnAnimation
=
this
.
startbtn
.
getComponent
(
Transform
);
this
.
pingziFrontTransform
=
this
.
pingziFront
.
getComponent
(
Transform
);
this
.
pingziBackTransform
=
this
.
pingziBack
.
getComponent
(
Transform
);
this
.
gouziTransform
=
this
.
gouzi
.
getComponent
(
Transform
);
this
.
pingzi_1Transform
=
this
.
pingzi_1
.
getComponent
(
Transform
);
this
.
pingzi_2Transform
=
this
.
pingzi_2
.
getComponent
(
Transform
);
this
.
gouzi_pingziTransform
=
this
.
gouzi_pingzi
.
getComponent
(
Transform
);
this
.
grabState
=
false
;
this
.
hasPrize
=
false
;
//Tween.
//egret.Tween.get(this.startBtn, {loop:true}).to({scaleX:0.9, scaleY:0.9}, 300).wait(1000).to({scaleX:1, scaleY:1}, 300);
// SingleSceneNavigator
console
.
log
(
"sd"
)
/* var sd=createTween(this.startBtnAnimation, this.startBtnAnimation)
.to({scaleX:1.2,scaleY:1.2}, 1200) */
/* createTween(this, this.startBtnAnimation)
.set({scale: {x: 0, y: 0}, alpha: 1})
.wait(100)
.to({scale: {x: 0.8, y: 0.8}}, 800)
.to({scale: {x: 1.1, y: 1.1}, alpha: 0}, 1200); */
this
.
gouzi_pingziTransform
.
alpha
=
0
createTween
(
this
,
this
.
startBtnAnimation
,
true
,{
loop
:
-
1
})
.
set
({
scale
:
{
x
:
1
,
y
:
1
}})
.
to
({
scale
:
{
x
:
.
9
,
y
:
.
9
}},
300
)
.
wait
(
1000
)
.
to
({
scale
:
{
x
:
1
,
y
:
1
}},
300
)
createTween
(
this
,
this
.
pingziBackTransform
,
true
,{
loop
:
-
1
})
.
set
({
position
:
{
x
:
47.5
}})
.
to
({
position
:
{
x
:
-
152.5
}},
1000
)
createTween
(
this
,
this
.
pingziFrontTransform
,
true
,{
loop
:
-
1
})
.
set
({
position
:
{
x
:
-
110
}})
.
to
({
position
:
{
x
:
110
}},
1000
)
.
call
(()
=>
{
//console.log(`2`)
if
(
this
.
grabState
){
this
.
grabState
=
false
;
var
time
=
1000
;
if
(
this
.
hasPrize
){
time
=
1000
;
}
else
{
time
=
500
;
}
createTween
(
this
,
this
.
gouziTransform
,
true
,{
loop
:
0
})
.
set
({
position
:
{
y
:
132.5
}})
.
to
({
position
:
{
y
:
335
}},
time
)
.
call
(()
=>
{
if
(
this
.
hasPrize
){
this
.
hasPrize
=
false
;
this
.
pingzi_2Transform
.
alpha
=
0
this
.
gouzi_pingziTransform
.
alpha
=
1
}
})
.
to
({
position
:
{
y
:
132.5
}},
1000
)
.
call
(()
=>
{
this
.
pingzi_2Transform
.
alpha
=
1
this
.
gouzi_pingziTransform
.
alpha
=
0
})
}
})
//console.log(sd)
//.call(resolve);
}
private
setCountText
(
text
:
string
)
{
setText
(
this
.
countTxt
,
text
);
}
initGameStage
()
{
this
.
updateCountText
();
}
updateCountText
()
{
const
{
element
}
=
this
.
ajaxElement
;
let
text
=
''
if
(
element
.
freeLimit
>
0
)
{
text
=
`今日剩余免费次数:
${
element
.
freeLimit
}
次`
;
}
else
{
text
=
`
${
element
.
needCredits
}${
window
[
'CFG'
].
unitName
}
/次`
}
this
.
setCountText
(
text
);
}
grabState
=
false
;
hasPrize
=
false
;
onClick_startbtn
()
{
this
.
grabState
=
true
;
this
.
hasPrize
=
false
;
/* if (window['getDuibaToken']) {
window['getDuibaToken']((tokenObj: any) => {
this.broadcast('callApi', 1, 'doJoin', {
token:tokenObj.token,
activityId: window['CFG'].actId,
activityType: 'hdtool',
consumerId: window['CFG'].consumerId
});
}, (key: string, messageObj: any) => {
this.onGotDojoinError();
});
} else {
this.broadcast('callApi', 1, 'doJoin', {
activityId: window['CFG'].actId,
activityType: 'hdtool',
consumerId: window['CFG'].consumerId
});
} */
}
onGotDojoin
()
{
console
.
log
(
'onGotDojoin'
,
this
.
doJoin
);
this
.
broadcast
(
'callApi'
,
1
,
'getNgameStartStatus'
,
{
orderId
:
this
.
doJoin
});
}
onGotDojoinError
(
data
?)
{
console
.
log
(
'onGotDojoinError'
)
console
.
log
(
this
.
doJoin
)
console
.
log
(
data
)
}
onGot_getNgameStartStatus
()
{
console
.
log
(
'onGot_getNgameStartStatus'
,
this
.
getNgameStartStatus
);
//fuck 不可以循环引用
this
.
bubbling
(
'fuck'
,
'play'
);
}
onGotError_getNgameStartStatus
()
{
console
.
log
(
this
.
getNgameStartStatus
)
console
.
log
(
'onGotError_getNgameStartStatus'
);
}
onClick_rulebtn
()
{
console
.
log
(
'onClick_rulebtn'
);
this
.
bubbling
(
'showDialog'
,
'Rule'
);
}
onClick_recordbtn
()
{
console
.
log
(
'onClick_rulebtn'
);
//this.bubbling('showDialog', 'Rule');
}
onClick_rankbtn
()
{
alert
(
'onClick_rankbtn'
)
// globalEvent.emit('alert', {title: 'Success', content: 'You complete this puzzle', button: 'Next level'}, this.onAlertClose);
}
onDidEnter
(
last
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
):
void
{
this
.
entity
.
enabled
=
true
;
}
onDidLeave
(
next
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
):
void
{
this
.
entity
.
enabled
=
false
;
}
async
onWillEnter
(
last
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
)
{
}
async
onWillLeave
(
next
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
)
{
}
onWillMount
(
last
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
):
Promise
<
any
>
{
return
undefined
;
}
onWillUnMount
(
next
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
):
Promise
<
any
>
{
return
undefined
;
}
}
.history/assets/scripts/scenes/SceneStart_20190620165446.ts
0 → 100644
View file @
9d5f3970
/**
* Created by rockyl on 2019-04-09.
*/
import
ScillaComponent
from
"scilla-components/src/base/ScillaComponent"
;
import
{
dynamic
,
Entity
,
Tween
}
from
"scilla/src"
;
import
{
setText
}
from
"../entityUtils"
;
import
{
alien
}
from
"../navigator/StackNavigator"
;
import
Wave
from
'components/animation/Wave'
import
{
INavigatorViewBase
}
from
"../navigator/VirtualNavigator"
;
import
{
Transform
}
from
'scilla-components/src'
;
import
{
createTween
,
ease
}
from
"scilla"
;
export
default
class
SceneStart
extends
ScillaComponent
implements
INavigatorViewBase
{
ajaxElement
:
dynamic
;
doJoin
:
dynamic
;
getNgameStartStatus
:
dynamic
;
countTxt
:
Entity
;
startbtn
:
Entity
;
recordbtn
:
Entity
;
pingziFront
:
Entity
;
pingziBack
:
Entity
;
rankbtn
:
Entity
;
rulebtn
:
Entity
;
gouzi
:
Entity
;
pingzi_1
:
Entity
;
pingzi_2
:
Entity
;
gouzi_pingzi
:
Entity
;
private
startBtnAnimation
;
pingziFrontTransform
:
Transform
;
pingziBackTransform
:
Transform
;
gouziTransform
:
Transform
;
pingzi_1Transform
:
Transform
;
pingzi_2Transform
:
Transform
;
gouzi_pingziTransform
:
Transform
;
onAwake
()
{
super
.
onAwake
();
this
.
setCountText
(
''
);
this
.
startBtnAnimation
=
this
.
startbtn
.
getComponent
(
Transform
);
this
.
pingziFrontTransform
=
this
.
pingziFront
.
getComponent
(
Transform
);
this
.
pingziBackTransform
=
this
.
pingziBack
.
getComponent
(
Transform
);
this
.
gouziTransform
=
this
.
gouzi
.
getComponent
(
Transform
);
this
.
pingzi_1Transform
=
this
.
pingzi_1
.
getComponent
(
Transform
);
this
.
pingzi_2Transform
=
this
.
pingzi_2
.
getComponent
(
Transform
);
this
.
gouzi_pingziTransform
=
this
.
gouzi_pingzi
.
getComponent
(
Transform
);
this
.
grabState
=
false
;
this
.
hasPrize
=
false
;
//Tween.
//egret.Tween.get(this.startBtn, {loop:true}).to({scaleX:0.9, scaleY:0.9}, 300).wait(1000).to({scaleX:1, scaleY:1}, 300);
// SingleSceneNavigator
console
.
log
(
"sd"
)
/* var sd=createTween(this.startBtnAnimation, this.startBtnAnimation)
.to({scaleX:1.2,scaleY:1.2}, 1200) */
/* createTween(this, this.startBtnAnimation)
.set({scale: {x: 0, y: 0}, alpha: 1})
.wait(100)
.to({scale: {x: 0.8, y: 0.8}}, 800)
.to({scale: {x: 1.1, y: 1.1}, alpha: 0}, 1200); */
this
.
gouzi_pingziTransform
.
alpha
=
0
createTween
(
this
,
this
.
startBtnAnimation
,
true
,{
loop
:
-
1
})
.
set
({
scale
:
{
x
:
1
,
y
:
1
}})
.
to
({
scale
:
{
x
:
.
9
,
y
:
.
9
}},
300
)
.
wait
(
1000
)
.
to
({
scale
:
{
x
:
1
,
y
:
1
}},
300
)
createTween
(
this
,
this
.
pingziBackTransform
,
true
,{
loop
:
-
1
})
.
set
({
position
:
{
x
:
47.5
}})
.
to
({
position
:
{
x
:
-
152.5
}},
1000
)
createTween
(
this
,
this
.
pingziFrontTransform
,
true
,{
loop
:
-
1
})
.
set
({
position
:
{
x
:
-
110
}})
.
to
({
position
:
{
x
:
110
}},
1000
)
.
call
(()
=>
{
//console.log(`2`)
if
(
this
.
grabState
){
this
.
grabState
=
false
;
var
time
=
1000
;
if
(
this
.
hasPrize
){
time
=
1000
;
}
else
{
time
=
500
;
}
createTween
(
this
,
this
.
gouziTransform
,
true
,{
loop
:
0
})
.
set
({
position
:
{
y
:
132.5
}})
.
to
({
position
:
{
y
:
335
}},
time
)
.
call
(()
=>
{
if
(
this
.
hasPrize
){
this
.
hasPrize
=
false
;
this
.
pingzi_2Transform
.
alpha
=
0
this
.
gouzi_pingziTransform
.
alpha
=
1
setTimeout
(()
=>
{
this
.
pingzi_2Transform
.
alpha
=
1
},
1000
)
}
})
.
to
({
position
:
{
y
:
132.5
}},
2000
)
.
call
(()
=>
{
this
.
pingzi_2Transform
.
alpha
=
1
this
.
gouzi_pingziTransform
.
alpha
=
0
})
}
})
//console.log(sd)
//.call(resolve);
}
private
setCountText
(
text
:
string
)
{
setText
(
this
.
countTxt
,
text
);
}
initGameStage
()
{
this
.
updateCountText
();
}
updateCountText
()
{
const
{
element
}
=
this
.
ajaxElement
;
let
text
=
''
if
(
element
.
freeLimit
>
0
)
{
text
=
`今日剩余免费次数:
${
element
.
freeLimit
}
次`
;
}
else
{
text
=
`
${
element
.
needCredits
}${
window
[
'CFG'
].
unitName
}
/次`
}
this
.
setCountText
(
text
);
}
grabState
=
false
;
hasPrize
=
false
;
onClick_startbtn
()
{
this
.
grabState
=
true
;
this
.
hasPrize
=
false
;
/* if (window['getDuibaToken']) {
window['getDuibaToken']((tokenObj: any) => {
this.broadcast('callApi', 1, 'doJoin', {
token:tokenObj.token,
activityId: window['CFG'].actId,
activityType: 'hdtool',
consumerId: window['CFG'].consumerId
});
}, (key: string, messageObj: any) => {
this.onGotDojoinError();
});
} else {
this.broadcast('callApi', 1, 'doJoin', {
activityId: window['CFG'].actId,
activityType: 'hdtool',
consumerId: window['CFG'].consumerId
});
} */
}
onGotDojoin
()
{
console
.
log
(
'onGotDojoin'
,
this
.
doJoin
);
this
.
broadcast
(
'callApi'
,
1
,
'getNgameStartStatus'
,
{
orderId
:
this
.
doJoin
});
}
onGotDojoinError
(
data
?)
{
console
.
log
(
'onGotDojoinError'
)
console
.
log
(
this
.
doJoin
)
console
.
log
(
data
)
}
onGot_getNgameStartStatus
()
{
console
.
log
(
'onGot_getNgameStartStatus'
,
this
.
getNgameStartStatus
);
//fuck 不可以循环引用
this
.
bubbling
(
'fuck'
,
'play'
);
}
onGotError_getNgameStartStatus
()
{
console
.
log
(
this
.
getNgameStartStatus
)
console
.
log
(
'onGotError_getNgameStartStatus'
);
}
onClick_rulebtn
()
{
console
.
log
(
'onClick_rulebtn'
);
this
.
bubbling
(
'showDialog'
,
'Rule'
);
}
onClick_recordbtn
()
{
console
.
log
(
'onClick_rulebtn'
);
//this.bubbling('showDialog', 'Rule');
}
onClick_rankbtn
()
{
alert
(
'onClick_rankbtn'
)
// globalEvent.emit('alert', {title: 'Success', content: 'You complete this puzzle', button: 'Next level'}, this.onAlertClose);
}
onDidEnter
(
last
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
):
void
{
this
.
entity
.
enabled
=
true
;
}
onDidLeave
(
next
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
):
void
{
this
.
entity
.
enabled
=
false
;
}
async
onWillEnter
(
last
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
)
{
}
async
onWillLeave
(
next
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
)
{
}
onWillMount
(
last
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
):
Promise
<
any
>
{
return
undefined
;
}
onWillUnMount
(
next
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
):
Promise
<
any
>
{
return
undefined
;
}
}
.history/assets/scripts/scenes/SceneStart_20190620165503.ts
0 → 100644
View file @
9d5f3970
/**
* Created by rockyl on 2019-04-09.
*/
import
ScillaComponent
from
"scilla-components/src/base/ScillaComponent"
;
import
{
dynamic
,
Entity
,
Tween
}
from
"scilla/src"
;
import
{
setText
}
from
"../entityUtils"
;
import
{
alien
}
from
"../navigator/StackNavigator"
;
import
Wave
from
'components/animation/Wave'
import
{
INavigatorViewBase
}
from
"../navigator/VirtualNavigator"
;
import
{
Transform
}
from
'scilla-components/src'
;
import
{
createTween
,
ease
}
from
"scilla"
;
export
default
class
SceneStart
extends
ScillaComponent
implements
INavigatorViewBase
{
ajaxElement
:
dynamic
;
doJoin
:
dynamic
;
getNgameStartStatus
:
dynamic
;
countTxt
:
Entity
;
startbtn
:
Entity
;
recordbtn
:
Entity
;
pingziFront
:
Entity
;
pingziBack
:
Entity
;
rankbtn
:
Entity
;
rulebtn
:
Entity
;
gouzi
:
Entity
;
pingzi_1
:
Entity
;
pingzi_2
:
Entity
;
gouzi_pingzi
:
Entity
;
private
startBtnAnimation
;
pingziFrontTransform
:
Transform
;
pingziBackTransform
:
Transform
;
gouziTransform
:
Transform
;
pingzi_1Transform
:
Transform
;
pingzi_2Transform
:
Transform
;
gouzi_pingziTransform
:
Transform
;
onAwake
()
{
super
.
onAwake
();
this
.
setCountText
(
''
);
this
.
startBtnAnimation
=
this
.
startbtn
.
getComponent
(
Transform
);
this
.
pingziFrontTransform
=
this
.
pingziFront
.
getComponent
(
Transform
);
this
.
pingziBackTransform
=
this
.
pingziBack
.
getComponent
(
Transform
);
this
.
gouziTransform
=
this
.
gouzi
.
getComponent
(
Transform
);
this
.
pingzi_1Transform
=
this
.
pingzi_1
.
getComponent
(
Transform
);
this
.
pingzi_2Transform
=
this
.
pingzi_2
.
getComponent
(
Transform
);
this
.
gouzi_pingziTransform
=
this
.
gouzi_pingzi
.
getComponent
(
Transform
);
this
.
grabState
=
false
;
this
.
hasPrize
=
false
;
//Tween.
//egret.Tween.get(this.startBtn, {loop:true}).to({scaleX:0.9, scaleY:0.9}, 300).wait(1000).to({scaleX:1, scaleY:1}, 300);
// SingleSceneNavigator
console
.
log
(
"sd"
)
/* var sd=createTween(this.startBtnAnimation, this.startBtnAnimation)
.to({scaleX:1.2,scaleY:1.2}, 1200) */
/* createTween(this, this.startBtnAnimation)
.set({scale: {x: 0, y: 0}, alpha: 1})
.wait(100)
.to({scale: {x: 0.8, y: 0.8}}, 800)
.to({scale: {x: 1.1, y: 1.1}, alpha: 0}, 1200); */
this
.
gouzi_pingziTransform
.
alpha
=
0
createTween
(
this
,
this
.
startBtnAnimation
,
true
,{
loop
:
-
1
})
.
set
({
scale
:
{
x
:
1
,
y
:
1
}})
.
to
({
scale
:
{
x
:
.
9
,
y
:
.
9
}},
300
)
.
wait
(
1000
)
.
to
({
scale
:
{
x
:
1
,
y
:
1
}},
300
)
createTween
(
this
,
this
.
pingziBackTransform
,
true
,{
loop
:
-
1
})
.
set
({
position
:
{
x
:
47.5
}})
.
to
({
position
:
{
x
:
-
152.5
}},
1000
)
createTween
(
this
,
this
.
pingziFrontTransform
,
true
,{
loop
:
-
1
})
.
set
({
position
:
{
x
:
-
110
}})
.
to
({
position
:
{
x
:
110
}},
1000
)
.
call
(()
=>
{
//console.log(`2`)
if
(
this
.
grabState
){
this
.
grabState
=
false
;
var
time
=
1000
;
if
(
this
.
hasPrize
){
time
=
1000
;
}
else
{
time
=
500
;
}
createTween
(
this
,
this
.
gouziTransform
,
true
,{
loop
:
0
})
.
set
({
position
:
{
y
:
132.5
}})
.
to
({
position
:
{
y
:
335
}},
time
)
.
call
(()
=>
{
if
(
this
.
hasPrize
){
this
.
hasPrize
=
false
;
this
.
pingzi_2Transform
.
alpha
=
0
this
.
gouzi_pingziTransform
.
alpha
=
1
setTimeout
(()
=>
{
this
.
pingzi_2Transform
.
alpha
=
1
},
500
)
}
})
.
to
({
position
:
{
y
:
132.5
}},
2000
)
.
call
(()
=>
{
this
.
pingzi_2Transform
.
alpha
=
1
this
.
gouzi_pingziTransform
.
alpha
=
0
})
}
})
//console.log(sd)
//.call(resolve);
}
private
setCountText
(
text
:
string
)
{
setText
(
this
.
countTxt
,
text
);
}
initGameStage
()
{
this
.
updateCountText
();
}
updateCountText
()
{
const
{
element
}
=
this
.
ajaxElement
;
let
text
=
''
if
(
element
.
freeLimit
>
0
)
{
text
=
`今日剩余免费次数:
${
element
.
freeLimit
}
次`
;
}
else
{
text
=
`
${
element
.
needCredits
}${
window
[
'CFG'
].
unitName
}
/次`
}
this
.
setCountText
(
text
);
}
grabState
=
false
;
hasPrize
=
false
;
onClick_startbtn
()
{
this
.
grabState
=
true
;
this
.
hasPrize
=
false
;
/* if (window['getDuibaToken']) {
window['getDuibaToken']((tokenObj: any) => {
this.broadcast('callApi', 1, 'doJoin', {
token:tokenObj.token,
activityId: window['CFG'].actId,
activityType: 'hdtool',
consumerId: window['CFG'].consumerId
});
}, (key: string, messageObj: any) => {
this.onGotDojoinError();
});
} else {
this.broadcast('callApi', 1, 'doJoin', {
activityId: window['CFG'].actId,
activityType: 'hdtool',
consumerId: window['CFG'].consumerId
});
} */
}
onGotDojoin
()
{
console
.
log
(
'onGotDojoin'
,
this
.
doJoin
);
this
.
broadcast
(
'callApi'
,
1
,
'getNgameStartStatus'
,
{
orderId
:
this
.
doJoin
});
}
onGotDojoinError
(
data
?)
{
console
.
log
(
'onGotDojoinError'
)
console
.
log
(
this
.
doJoin
)
console
.
log
(
data
)
}
onGot_getNgameStartStatus
()
{
console
.
log
(
'onGot_getNgameStartStatus'
,
this
.
getNgameStartStatus
);
//fuck 不可以循环引用
this
.
bubbling
(
'fuck'
,
'play'
);
}
onGotError_getNgameStartStatus
()
{
console
.
log
(
this
.
getNgameStartStatus
)
console
.
log
(
'onGotError_getNgameStartStatus'
);
}
onClick_rulebtn
()
{
console
.
log
(
'onClick_rulebtn'
);
this
.
bubbling
(
'showDialog'
,
'Rule'
);
}
onClick_recordbtn
()
{
console
.
log
(
'onClick_rulebtn'
);
//this.bubbling('showDialog', 'Rule');
}
onClick_rankbtn
()
{
alert
(
'onClick_rankbtn'
)
// globalEvent.emit('alert', {title: 'Success', content: 'You complete this puzzle', button: 'Next level'}, this.onAlertClose);
}
onDidEnter
(
last
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
):
void
{
this
.
entity
.
enabled
=
true
;
}
onDidLeave
(
next
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
):
void
{
this
.
entity
.
enabled
=
false
;
}
async
onWillEnter
(
last
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
)
{
}
async
onWillLeave
(
next
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
)
{
}
onWillMount
(
last
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
):
Promise
<
any
>
{
return
undefined
;
}
onWillUnMount
(
next
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
):
Promise
<
any
>
{
return
undefined
;
}
}
.history/assets/scripts/scenes/SceneStart_20190620165508.ts
0 → 100644
View file @
9d5f3970
/**
* Created by rockyl on 2019-04-09.
*/
import
ScillaComponent
from
"scilla-components/src/base/ScillaComponent"
;
import
{
dynamic
,
Entity
,
Tween
}
from
"scilla/src"
;
import
{
setText
}
from
"../entityUtils"
;
import
{
alien
}
from
"../navigator/StackNavigator"
;
import
Wave
from
'components/animation/Wave'
import
{
INavigatorViewBase
}
from
"../navigator/VirtualNavigator"
;
import
{
Transform
}
from
'scilla-components/src'
;
import
{
createTween
,
ease
}
from
"scilla"
;
export
default
class
SceneStart
extends
ScillaComponent
implements
INavigatorViewBase
{
ajaxElement
:
dynamic
;
doJoin
:
dynamic
;
getNgameStartStatus
:
dynamic
;
countTxt
:
Entity
;
startbtn
:
Entity
;
recordbtn
:
Entity
;
pingziFront
:
Entity
;
pingziBack
:
Entity
;
rankbtn
:
Entity
;
rulebtn
:
Entity
;
gouzi
:
Entity
;
pingzi_1
:
Entity
;
pingzi_2
:
Entity
;
gouzi_pingzi
:
Entity
;
private
startBtnAnimation
;
pingziFrontTransform
:
Transform
;
pingziBackTransform
:
Transform
;
gouziTransform
:
Transform
;
pingzi_1Transform
:
Transform
;
pingzi_2Transform
:
Transform
;
gouzi_pingziTransform
:
Transform
;
onAwake
()
{
super
.
onAwake
();
this
.
setCountText
(
''
);
this
.
startBtnAnimation
=
this
.
startbtn
.
getComponent
(
Transform
);
this
.
pingziFrontTransform
=
this
.
pingziFront
.
getComponent
(
Transform
);
this
.
pingziBackTransform
=
this
.
pingziBack
.
getComponent
(
Transform
);
this
.
gouziTransform
=
this
.
gouzi
.
getComponent
(
Transform
);
this
.
pingzi_1Transform
=
this
.
pingzi_1
.
getComponent
(
Transform
);
this
.
pingzi_2Transform
=
this
.
pingzi_2
.
getComponent
(
Transform
);
this
.
gouzi_pingziTransform
=
this
.
gouzi_pingzi
.
getComponent
(
Transform
);
this
.
grabState
=
false
;
this
.
hasPrize
=
false
;
//Tween.
//egret.Tween.get(this.startBtn, {loop:true}).to({scaleX:0.9, scaleY:0.9}, 300).wait(1000).to({scaleX:1, scaleY:1}, 300);
// SingleSceneNavigator
console
.
log
(
"sd"
)
/* var sd=createTween(this.startBtnAnimation, this.startBtnAnimation)
.to({scaleX:1.2,scaleY:1.2}, 1200) */
/* createTween(this, this.startBtnAnimation)
.set({scale: {x: 0, y: 0}, alpha: 1})
.wait(100)
.to({scale: {x: 0.8, y: 0.8}}, 800)
.to({scale: {x: 1.1, y: 1.1}, alpha: 0}, 1200); */
this
.
gouzi_pingziTransform
.
alpha
=
0
createTween
(
this
,
this
.
startBtnAnimation
,
true
,{
loop
:
-
1
})
.
set
({
scale
:
{
x
:
1
,
y
:
1
}})
.
to
({
scale
:
{
x
:
.
9
,
y
:
.
9
}},
300
)
.
wait
(
1000
)
.
to
({
scale
:
{
x
:
1
,
y
:
1
}},
300
)
createTween
(
this
,
this
.
pingziBackTransform
,
true
,{
loop
:
-
1
})
.
set
({
position
:
{
x
:
47.5
}})
.
to
({
position
:
{
x
:
-
152.5
}},
1000
)
createTween
(
this
,
this
.
pingziFrontTransform
,
true
,{
loop
:
-
1
})
.
set
({
position
:
{
x
:
-
110
}})
.
to
({
position
:
{
x
:
110
}},
1000
)
.
call
(()
=>
{
//console.log(`2`)
if
(
this
.
grabState
){
this
.
grabState
=
false
;
var
time
=
1000
;
if
(
this
.
hasPrize
){
time
=
1000
;
}
else
{
time
=
500
;
}
createTween
(
this
,
this
.
gouziTransform
,
true
,{
loop
:
0
})
.
set
({
position
:
{
y
:
132.5
}})
.
to
({
position
:
{
y
:
335
}},
time
)
.
call
(()
=>
{
if
(
this
.
hasPrize
){
this
.
hasPrize
=
false
;
this
.
pingzi_2Transform
.
alpha
=
0
this
.
gouzi_pingziTransform
.
alpha
=
1
setTimeout
(()
=>
{
this
.
pingzi_2Transform
.
alpha
=
1
},
500
)
}
})
.
to
({
position
:
{
y
:
132.5
}},
1000
)
.
call
(()
=>
{
this
.
pingzi_2Transform
.
alpha
=
1
this
.
gouzi_pingziTransform
.
alpha
=
0
})
}
})
//console.log(sd)
//.call(resolve);
}
private
setCountText
(
text
:
string
)
{
setText
(
this
.
countTxt
,
text
);
}
initGameStage
()
{
this
.
updateCountText
();
}
updateCountText
()
{
const
{
element
}
=
this
.
ajaxElement
;
let
text
=
''
if
(
element
.
freeLimit
>
0
)
{
text
=
`今日剩余免费次数:
${
element
.
freeLimit
}
次`
;
}
else
{
text
=
`
${
element
.
needCredits
}${
window
[
'CFG'
].
unitName
}
/次`
}
this
.
setCountText
(
text
);
}
grabState
=
false
;
hasPrize
=
false
;
onClick_startbtn
()
{
this
.
grabState
=
true
;
this
.
hasPrize
=
false
;
/* if (window['getDuibaToken']) {
window['getDuibaToken']((tokenObj: any) => {
this.broadcast('callApi', 1, 'doJoin', {
token:tokenObj.token,
activityId: window['CFG'].actId,
activityType: 'hdtool',
consumerId: window['CFG'].consumerId
});
}, (key: string, messageObj: any) => {
this.onGotDojoinError();
});
} else {
this.broadcast('callApi', 1, 'doJoin', {
activityId: window['CFG'].actId,
activityType: 'hdtool',
consumerId: window['CFG'].consumerId
});
} */
}
onGotDojoin
()
{
console
.
log
(
'onGotDojoin'
,
this
.
doJoin
);
this
.
broadcast
(
'callApi'
,
1
,
'getNgameStartStatus'
,
{
orderId
:
this
.
doJoin
});
}
onGotDojoinError
(
data
?)
{
console
.
log
(
'onGotDojoinError'
)
console
.
log
(
this
.
doJoin
)
console
.
log
(
data
)
}
onGot_getNgameStartStatus
()
{
console
.
log
(
'onGot_getNgameStartStatus'
,
this
.
getNgameStartStatus
);
//fuck 不可以循环引用
this
.
bubbling
(
'fuck'
,
'play'
);
}
onGotError_getNgameStartStatus
()
{
console
.
log
(
this
.
getNgameStartStatus
)
console
.
log
(
'onGotError_getNgameStartStatus'
);
}
onClick_rulebtn
()
{
console
.
log
(
'onClick_rulebtn'
);
this
.
bubbling
(
'showDialog'
,
'Rule'
);
}
onClick_recordbtn
()
{
console
.
log
(
'onClick_rulebtn'
);
//this.bubbling('showDialog', 'Rule');
}
onClick_rankbtn
()
{
alert
(
'onClick_rankbtn'
)
// globalEvent.emit('alert', {title: 'Success', content: 'You complete this puzzle', button: 'Next level'}, this.onAlertClose);
}
onDidEnter
(
last
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
):
void
{
this
.
entity
.
enabled
=
true
;
}
onDidLeave
(
next
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
):
void
{
this
.
entity
.
enabled
=
false
;
}
async
onWillEnter
(
last
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
)
{
}
async
onWillLeave
(
next
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
)
{
}
onWillMount
(
last
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
):
Promise
<
any
>
{
return
undefined
;
}
onWillUnMount
(
next
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
):
Promise
<
any
>
{
return
undefined
;
}
}
.history/assets/scripts/scenes/SceneStart_20190620165554.ts
0 → 100644
View file @
9d5f3970
/**
* Created by rockyl on 2019-04-09.
*/
import
ScillaComponent
from
"scilla-components/src/base/ScillaComponent"
;
import
{
dynamic
,
Entity
,
Tween
}
from
"scilla/src"
;
import
{
setText
}
from
"../entityUtils"
;
import
{
alien
}
from
"../navigator/StackNavigator"
;
import
Wave
from
'components/animation/Wave'
import
{
INavigatorViewBase
}
from
"../navigator/VirtualNavigator"
;
import
{
Transform
}
from
'scilla-components/src'
;
import
{
createTween
,
ease
}
from
"scilla"
;
export
default
class
SceneStart
extends
ScillaComponent
implements
INavigatorViewBase
{
ajaxElement
:
dynamic
;
doJoin
:
dynamic
;
getNgameStartStatus
:
dynamic
;
countTxt
:
Entity
;
startbtn
:
Entity
;
recordbtn
:
Entity
;
pingziFront
:
Entity
;
pingziBack
:
Entity
;
rankbtn
:
Entity
;
rulebtn
:
Entity
;
gouzi
:
Entity
;
pingzi_1
:
Entity
;
pingzi_2
:
Entity
;
gouzi_pingzi
:
Entity
;
private
startBtnAnimation
;
pingziFrontTransform
:
Transform
;
pingziBackTransform
:
Transform
;
gouziTransform
:
Transform
;
pingzi_1Transform
:
Transform
;
pingzi_2Transform
:
Transform
;
gouzi_pingziTransform
:
Transform
;
onAwake
()
{
super
.
onAwake
();
this
.
setCountText
(
''
);
this
.
startBtnAnimation
=
this
.
startbtn
.
getComponent
(
Transform
);
this
.
pingziFrontTransform
=
this
.
pingziFront
.
getComponent
(
Transform
);
this
.
pingziBackTransform
=
this
.
pingziBack
.
getComponent
(
Transform
);
this
.
gouziTransform
=
this
.
gouzi
.
getComponent
(
Transform
);
this
.
pingzi_1Transform
=
this
.
pingzi_1
.
getComponent
(
Transform
);
this
.
pingzi_2Transform
=
this
.
pingzi_2
.
getComponent
(
Transform
);
this
.
gouzi_pingziTransform
=
this
.
gouzi_pingzi
.
getComponent
(
Transform
);
this
.
grabState
=
false
;
this
.
hasPrize
=
false
;
//Tween.
//egret.Tween.get(this.startBtn, {loop:true}).to({scaleX:0.9, scaleY:0.9}, 300).wait(1000).to({scaleX:1, scaleY:1}, 300);
// SingleSceneNavigator
console
.
log
(
"sd"
)
/* var sd=createTween(this.startBtnAnimation, this.startBtnAnimation)
.to({scaleX:1.2,scaleY:1.2}, 1200) */
/* createTween(this, this.startBtnAnimation)
.set({scale: {x: 0, y: 0}, alpha: 1})
.wait(100)
.to({scale: {x: 0.8, y: 0.8}}, 800)
.to({scale: {x: 1.1, y: 1.1}, alpha: 0}, 1200); */
this
.
gouzi_pingziTransform
.
alpha
=
0
createTween
(
this
,
this
.
startBtnAnimation
,
true
,{
loop
:
-
1
})
.
set
({
scale
:
{
x
:
1
,
y
:
1
}})
.
to
({
scale
:
{
x
:
.
9
,
y
:
.
9
}},
300
)
.
wait
(
1000
)
.
to
({
scale
:
{
x
:
1
,
y
:
1
}},
300
)
createTween
(
this
,
this
.
pingziBackTransform
,
true
,{
loop
:
-
1
})
.
set
({
position
:
{
x
:
47.5
}})
.
to
({
position
:
{
x
:
-
152.5
}},
1000
)
createTween
(
this
,
this
.
pingziFrontTransform
,
true
,{
loop
:
-
1
})
.
set
({
position
:
{
x
:
-
110
}})
.
to
({
position
:
{
x
:
110
}},
1000
)
.
call
(()
=>
{
//console.log(`2`)
if
(
this
.
grabState
){
this
.
grabState
=
false
;
var
time
=
1000
;
if
(
this
.
hasPrize
){
time
=
1000
;
}
else
{
time
=
500
;
}
createTween
(
this
,
this
.
gouziTransform
,
true
,{
loop
:
0
})
.
set
({
position
:
{
y
:
132.5
}})
.
to
({
position
:
{
y
:
335
}},
time
)
.
call
(()
=>
{
if
(
this
.
hasPrize
){
this
.
hasPrize
=
false
;
this
.
pingzi_2Transform
.
alpha
=
0
this
.
gouzi_pingziTransform
.
alpha
=
1
setTimeout
(()
=>
{
this
.
pingzi_2Transform
.
alpha
=
1
},
500
)
}
})
.
to
({
position
:
{
y
:
132.5
}},
1000
)
.
call
(()
=>
{
this
.
pingzi_2Transform
.
alpha
=
1
this
.
gouzi_pingziTransform
.
alpha
=
0
})
}
})
//console.log(sd)
//.call(resolve);
}
private
setCountText
(
text
:
string
)
{
setText
(
this
.
countTxt
,
text
);
}
initGameStage
()
{
this
.
updateCountText
();
}
updateCountText
()
{
const
{
element
}
=
this
.
ajaxElement
;
let
text
=
''
if
(
element
.
freeLimit
>
0
)
{
text
=
`今日剩余免费次数:
${
element
.
freeLimit
}
次`
;
}
else
{
text
=
`
${
element
.
needCredits
}${
window
[
'CFG'
].
unitName
}
/次`
}
this
.
setCountText
(
text
);
}
grabState
=
false
;
hasPrize
=
false
;
onClick_startbtn
()
{
this
.
grabState
=
true
;
this
.
hasPrize
=
true
;
/* if (window['getDuibaToken']) {
window['getDuibaToken']((tokenObj: any) => {
this.broadcast('callApi', 1, 'doJoin', {
token:tokenObj.token,
activityId: window['CFG'].actId,
activityType: 'hdtool',
consumerId: window['CFG'].consumerId
});
}, (key: string, messageObj: any) => {
this.onGotDojoinError();
});
} else {
this.broadcast('callApi', 1, 'doJoin', {
activityId: window['CFG'].actId,
activityType: 'hdtool',
consumerId: window['CFG'].consumerId
});
} */
}
onGotDojoin
()
{
console
.
log
(
'onGotDojoin'
,
this
.
doJoin
);
this
.
broadcast
(
'callApi'
,
1
,
'getNgameStartStatus'
,
{
orderId
:
this
.
doJoin
});
}
onGotDojoinError
(
data
?)
{
console
.
log
(
'onGotDojoinError'
)
console
.
log
(
this
.
doJoin
)
console
.
log
(
data
)
}
onGot_getNgameStartStatus
()
{
console
.
log
(
'onGot_getNgameStartStatus'
,
this
.
getNgameStartStatus
);
//fuck 不可以循环引用
this
.
bubbling
(
'fuck'
,
'play'
);
}
onGotError_getNgameStartStatus
()
{
console
.
log
(
this
.
getNgameStartStatus
)
console
.
log
(
'onGotError_getNgameStartStatus'
);
}
onClick_rulebtn
()
{
console
.
log
(
'onClick_rulebtn'
);
this
.
bubbling
(
'showDialog'
,
'Rule'
);
}
onClick_recordbtn
()
{
console
.
log
(
'onClick_rulebtn'
);
//this.bubbling('showDialog', 'Rule');
}
onClick_rankbtn
()
{
alert
(
'onClick_rankbtn'
)
// globalEvent.emit('alert', {title: 'Success', content: 'You complete this puzzle', button: 'Next level'}, this.onAlertClose);
}
onDidEnter
(
last
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
):
void
{
this
.
entity
.
enabled
=
true
;
}
onDidLeave
(
next
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
):
void
{
this
.
entity
.
enabled
=
false
;
}
async
onWillEnter
(
last
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
)
{
}
async
onWillLeave
(
next
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
)
{
}
onWillMount
(
last
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
):
Promise
<
any
>
{
return
undefined
;
}
onWillUnMount
(
next
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
):
Promise
<
any
>
{
return
undefined
;
}
}
.history/assets/scripts/scenes/SceneStart_20190620165631.ts
0 → 100644
View file @
9d5f3970
/**
* Created by rockyl on 2019-04-09.
*/
import
ScillaComponent
from
"scilla-components/src/base/ScillaComponent"
;
import
{
dynamic
,
Entity
,
Tween
}
from
"scilla/src"
;
import
{
setText
}
from
"../entityUtils"
;
import
{
alien
}
from
"../navigator/StackNavigator"
;
import
Wave
from
'components/animation/Wave'
import
{
INavigatorViewBase
}
from
"../navigator/VirtualNavigator"
;
import
{
Transform
}
from
'scilla-components/src'
;
import
{
createTween
,
ease
}
from
"scilla"
;
export
default
class
SceneStart
extends
ScillaComponent
implements
INavigatorViewBase
{
ajaxElement
:
dynamic
;
doJoin
:
dynamic
;
getNgameStartStatus
:
dynamic
;
countTxt
:
Entity
;
startbtn
:
Entity
;
recordbtn
:
Entity
;
pingziFront
:
Entity
;
pingziBack
:
Entity
;
rankbtn
:
Entity
;
rulebtn
:
Entity
;
gouzi
:
Entity
;
pingzi_1
:
Entity
;
pingzi_2
:
Entity
;
gouzi_pingzi
:
Entity
;
private
startBtnAnimation
;
pingziFrontTransform
:
Transform
;
pingziBackTransform
:
Transform
;
gouziTransform
:
Transform
;
pingzi_1Transform
:
Transform
;
pingzi_2Transform
:
Transform
;
gouzi_pingziTransform
:
Transform
;
onAwake
()
{
super
.
onAwake
();
this
.
setCountText
(
''
);
this
.
startBtnAnimation
=
this
.
startbtn
.
getComponent
(
Transform
);
this
.
pingziFrontTransform
=
this
.
pingziFront
.
getComponent
(
Transform
);
this
.
pingziBackTransform
=
this
.
pingziBack
.
getComponent
(
Transform
);
this
.
gouziTransform
=
this
.
gouzi
.
getComponent
(
Transform
);
this
.
pingzi_1Transform
=
this
.
pingzi_1
.
getComponent
(
Transform
);
this
.
pingzi_2Transform
=
this
.
pingzi_2
.
getComponent
(
Transform
);
this
.
gouzi_pingziTransform
=
this
.
gouzi_pingzi
.
getComponent
(
Transform
);
this
.
grabState
=
false
;
this
.
hasPrize
=
false
;
//Tween.
//egret.Tween.get(this.startBtn, {loop:true}).to({scaleX:0.9, scaleY:0.9}, 300).wait(1000).to({scaleX:1, scaleY:1}, 300);
// SingleSceneNavigator
console
.
log
(
"sd"
)
/* var sd=createTween(this.startBtnAnimation, this.startBtnAnimation)
.to({scaleX:1.2,scaleY:1.2}, 1200) */
/* createTween(this, this.startBtnAnimation)
.set({scale: {x: 0, y: 0}, alpha: 1})
.wait(100)
.to({scale: {x: 0.8, y: 0.8}}, 800)
.to({scale: {x: 1.1, y: 1.1}, alpha: 0}, 1200); */
this
.
gouzi_pingziTransform
.
alpha
=
0
createTween
(
this
,
this
.
startBtnAnimation
,
true
,{
loop
:
-
1
})
.
set
({
scale
:
{
x
:
1
,
y
:
1
}})
.
to
({
scale
:
{
x
:
.
9
,
y
:
.
9
}},
300
)
.
wait
(
1000
)
.
to
({
scale
:
{
x
:
1
,
y
:
1
}},
300
)
createTween
(
this
,
this
.
pingziBackTransform
,
true
,{
loop
:
-
1
})
.
set
({
position
:
{
x
:
47.5
}})
.
to
({
position
:
{
x
:
-
152.5
}},
1000
)
createTween
(
this
,
this
.
pingziFrontTransform
,
true
,{
loop
:
-
1
})
.
set
({
position
:
{
x
:
-
110
}})
.
to
({
position
:
{
x
:
110
}},
1000
)
.
call
(()
=>
{
//console.log(`2`)
if
(
this
.
grabState
){
this
.
grabState
=
false
;
var
time
=
1000
;
if
(
this
.
hasPrize
){
time
=
1000
;
}
else
{
time
=
500
;
}
createTween
(
this
,
this
.
gouziTransform
,
true
,{
loop
:
0
})
.
set
({
position
:
{
y
:
132.5
}})
.
to
({
position
:
{
y
:
335
}},
time
)
.
call
(()
=>
{
if
(
this
.
hasPrize
){
this
.
hasPrize
=
false
;
this
.
pingzi_2Transform
.
alpha
=
0
this
.
gouzi_pingziTransform
.
alpha
=
1
setTimeout
(()
=>
{
this
.
pingzi_2Transform
.
alpha
=
1
},
500
)
}
})
.
to
({
position
:
{
y
:
132.5
}},
1500
)
.
call
(()
=>
{
this
.
pingzi_2Transform
.
alpha
=
1
this
.
gouzi_pingziTransform
.
alpha
=
0
})
}
})
//console.log(sd)
//.call(resolve);
}
private
setCountText
(
text
:
string
)
{
setText
(
this
.
countTxt
,
text
);
}
initGameStage
()
{
this
.
updateCountText
();
}
updateCountText
()
{
const
{
element
}
=
this
.
ajaxElement
;
let
text
=
''
if
(
element
.
freeLimit
>
0
)
{
text
=
`今日剩余免费次数:
${
element
.
freeLimit
}
次`
;
}
else
{
text
=
`
${
element
.
needCredits
}${
window
[
'CFG'
].
unitName
}
/次`
}
this
.
setCountText
(
text
);
}
grabState
=
false
;
hasPrize
=
false
;
onClick_startbtn
()
{
this
.
grabState
=
true
;
this
.
hasPrize
=
true
;
/* if (window['getDuibaToken']) {
window['getDuibaToken']((tokenObj: any) => {
this.broadcast('callApi', 1, 'doJoin', {
token:tokenObj.token,
activityId: window['CFG'].actId,
activityType: 'hdtool',
consumerId: window['CFG'].consumerId
});
}, (key: string, messageObj: any) => {
this.onGotDojoinError();
});
} else {
this.broadcast('callApi', 1, 'doJoin', {
activityId: window['CFG'].actId,
activityType: 'hdtool',
consumerId: window['CFG'].consumerId
});
} */
}
onGotDojoin
()
{
console
.
log
(
'onGotDojoin'
,
this
.
doJoin
);
this
.
broadcast
(
'callApi'
,
1
,
'getNgameStartStatus'
,
{
orderId
:
this
.
doJoin
});
}
onGotDojoinError
(
data
?)
{
console
.
log
(
'onGotDojoinError'
)
console
.
log
(
this
.
doJoin
)
console
.
log
(
data
)
}
onGot_getNgameStartStatus
()
{
console
.
log
(
'onGot_getNgameStartStatus'
,
this
.
getNgameStartStatus
);
//fuck 不可以循环引用
this
.
bubbling
(
'fuck'
,
'play'
);
}
onGotError_getNgameStartStatus
()
{
console
.
log
(
this
.
getNgameStartStatus
)
console
.
log
(
'onGotError_getNgameStartStatus'
);
}
onClick_rulebtn
()
{
console
.
log
(
'onClick_rulebtn'
);
this
.
bubbling
(
'showDialog'
,
'Rule'
);
}
onClick_recordbtn
()
{
console
.
log
(
'onClick_rulebtn'
);
//this.bubbling('showDialog', 'Rule');
}
onClick_rankbtn
()
{
alert
(
'onClick_rankbtn'
)
// globalEvent.emit('alert', {title: 'Success', content: 'You complete this puzzle', button: 'Next level'}, this.onAlertClose);
}
onDidEnter
(
last
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
):
void
{
this
.
entity
.
enabled
=
true
;
}
onDidLeave
(
next
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
):
void
{
this
.
entity
.
enabled
=
false
;
}
async
onWillEnter
(
last
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
)
{
}
async
onWillLeave
(
next
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
)
{
}
onWillMount
(
last
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
):
Promise
<
any
>
{
return
undefined
;
}
onWillUnMount
(
next
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
):
Promise
<
any
>
{
return
undefined
;
}
}
.history/assets/scripts/scenes/SceneStart_20190620165635.ts
0 → 100644
View file @
9d5f3970
/**
* Created by rockyl on 2019-04-09.
*/
import
ScillaComponent
from
"scilla-components/src/base/ScillaComponent"
;
import
{
dynamic
,
Entity
,
Tween
}
from
"scilla/src"
;
import
{
setText
}
from
"../entityUtils"
;
import
{
alien
}
from
"../navigator/StackNavigator"
;
import
Wave
from
'components/animation/Wave'
import
{
INavigatorViewBase
}
from
"../navigator/VirtualNavigator"
;
import
{
Transform
}
from
'scilla-components/src'
;
import
{
createTween
,
ease
}
from
"scilla"
;
export
default
class
SceneStart
extends
ScillaComponent
implements
INavigatorViewBase
{
ajaxElement
:
dynamic
;
doJoin
:
dynamic
;
getNgameStartStatus
:
dynamic
;
countTxt
:
Entity
;
startbtn
:
Entity
;
recordbtn
:
Entity
;
pingziFront
:
Entity
;
pingziBack
:
Entity
;
rankbtn
:
Entity
;
rulebtn
:
Entity
;
gouzi
:
Entity
;
pingzi_1
:
Entity
;
pingzi_2
:
Entity
;
gouzi_pingzi
:
Entity
;
private
startBtnAnimation
;
pingziFrontTransform
:
Transform
;
pingziBackTransform
:
Transform
;
gouziTransform
:
Transform
;
pingzi_1Transform
:
Transform
;
pingzi_2Transform
:
Transform
;
gouzi_pingziTransform
:
Transform
;
onAwake
()
{
super
.
onAwake
();
this
.
setCountText
(
''
);
this
.
startBtnAnimation
=
this
.
startbtn
.
getComponent
(
Transform
);
this
.
pingziFrontTransform
=
this
.
pingziFront
.
getComponent
(
Transform
);
this
.
pingziBackTransform
=
this
.
pingziBack
.
getComponent
(
Transform
);
this
.
gouziTransform
=
this
.
gouzi
.
getComponent
(
Transform
);
this
.
pingzi_1Transform
=
this
.
pingzi_1
.
getComponent
(
Transform
);
this
.
pingzi_2Transform
=
this
.
pingzi_2
.
getComponent
(
Transform
);
this
.
gouzi_pingziTransform
=
this
.
gouzi_pingzi
.
getComponent
(
Transform
);
this
.
grabState
=
false
;
this
.
hasPrize
=
false
;
//Tween.
//egret.Tween.get(this.startBtn, {loop:true}).to({scaleX:0.9, scaleY:0.9}, 300).wait(1000).to({scaleX:1, scaleY:1}, 300);
// SingleSceneNavigator
console
.
log
(
"sd"
)
/* var sd=createTween(this.startBtnAnimation, this.startBtnAnimation)
.to({scaleX:1.2,scaleY:1.2}, 1200) */
/* createTween(this, this.startBtnAnimation)
.set({scale: {x: 0, y: 0}, alpha: 1})
.wait(100)
.to({scale: {x: 0.8, y: 0.8}}, 800)
.to({scale: {x: 1.1, y: 1.1}, alpha: 0}, 1200); */
this
.
gouzi_pingziTransform
.
alpha
=
0
createTween
(
this
,
this
.
startBtnAnimation
,
true
,{
loop
:
-
1
})
.
set
({
scale
:
{
x
:
1
,
y
:
1
}})
.
to
({
scale
:
{
x
:
.
9
,
y
:
.
9
}},
300
)
.
wait
(
1000
)
.
to
({
scale
:
{
x
:
1
,
y
:
1
}},
300
)
createTween
(
this
,
this
.
pingziBackTransform
,
true
,{
loop
:
-
1
})
.
set
({
position
:
{
x
:
47.5
}})
.
to
({
position
:
{
x
:
-
152.5
}},
1000
)
createTween
(
this
,
this
.
pingziFrontTransform
,
true
,{
loop
:
-
1
})
.
set
({
position
:
{
x
:
-
110
}})
.
to
({
position
:
{
x
:
110
}},
1000
)
.
call
(()
=>
{
//console.log(`2`)
if
(
this
.
grabState
){
this
.
grabState
=
false
;
var
time
=
1000
;
if
(
this
.
hasPrize
){
time
=
1000
;
}
else
{
time
=
500
;
}
createTween
(
this
,
this
.
gouziTransform
,
true
,{
loop
:
0
})
.
set
({
position
:
{
y
:
132.5
}})
.
to
({
position
:
{
y
:
335
}},
time
)
.
call
(()
=>
{
if
(
this
.
hasPrize
){
this
.
hasPrize
=
false
;
this
.
pingzi_2Transform
.
alpha
=
0
this
.
gouzi_pingziTransform
.
alpha
=
1
setTimeout
(()
=>
{
this
.
pingzi_2Transform
.
alpha
=
1
},
1000
)
}
})
.
to
({
position
:
{
y
:
132.5
}},
1500
)
.
call
(()
=>
{
this
.
pingzi_2Transform
.
alpha
=
1
this
.
gouzi_pingziTransform
.
alpha
=
0
})
}
})
//console.log(sd)
//.call(resolve);
}
private
setCountText
(
text
:
string
)
{
setText
(
this
.
countTxt
,
text
);
}
initGameStage
()
{
this
.
updateCountText
();
}
updateCountText
()
{
const
{
element
}
=
this
.
ajaxElement
;
let
text
=
''
if
(
element
.
freeLimit
>
0
)
{
text
=
`今日剩余免费次数:
${
element
.
freeLimit
}
次`
;
}
else
{
text
=
`
${
element
.
needCredits
}${
window
[
'CFG'
].
unitName
}
/次`
}
this
.
setCountText
(
text
);
}
grabState
=
false
;
hasPrize
=
false
;
onClick_startbtn
()
{
this
.
grabState
=
true
;
this
.
hasPrize
=
true
;
/* if (window['getDuibaToken']) {
window['getDuibaToken']((tokenObj: any) => {
this.broadcast('callApi', 1, 'doJoin', {
token:tokenObj.token,
activityId: window['CFG'].actId,
activityType: 'hdtool',
consumerId: window['CFG'].consumerId
});
}, (key: string, messageObj: any) => {
this.onGotDojoinError();
});
} else {
this.broadcast('callApi', 1, 'doJoin', {
activityId: window['CFG'].actId,
activityType: 'hdtool',
consumerId: window['CFG'].consumerId
});
} */
}
onGotDojoin
()
{
console
.
log
(
'onGotDojoin'
,
this
.
doJoin
);
this
.
broadcast
(
'callApi'
,
1
,
'getNgameStartStatus'
,
{
orderId
:
this
.
doJoin
});
}
onGotDojoinError
(
data
?)
{
console
.
log
(
'onGotDojoinError'
)
console
.
log
(
this
.
doJoin
)
console
.
log
(
data
)
}
onGot_getNgameStartStatus
()
{
console
.
log
(
'onGot_getNgameStartStatus'
,
this
.
getNgameStartStatus
);
//fuck 不可以循环引用
this
.
bubbling
(
'fuck'
,
'play'
);
}
onGotError_getNgameStartStatus
()
{
console
.
log
(
this
.
getNgameStartStatus
)
console
.
log
(
'onGotError_getNgameStartStatus'
);
}
onClick_rulebtn
()
{
console
.
log
(
'onClick_rulebtn'
);
this
.
bubbling
(
'showDialog'
,
'Rule'
);
}
onClick_recordbtn
()
{
console
.
log
(
'onClick_rulebtn'
);
//this.bubbling('showDialog', 'Rule');
}
onClick_rankbtn
()
{
alert
(
'onClick_rankbtn'
)
// globalEvent.emit('alert', {title: 'Success', content: 'You complete this puzzle', button: 'Next level'}, this.onAlertClose);
}
onDidEnter
(
last
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
):
void
{
this
.
entity
.
enabled
=
true
;
}
onDidLeave
(
next
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
):
void
{
this
.
entity
.
enabled
=
false
;
}
async
onWillEnter
(
last
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
)
{
}
async
onWillLeave
(
next
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
)
{
}
onWillMount
(
last
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
):
Promise
<
any
>
{
return
undefined
;
}
onWillUnMount
(
next
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
):
Promise
<
any
>
{
return
undefined
;
}
}
.history/assets/scripts/scenes/SceneStart_20190620165757.ts
0 → 100644
View file @
9d5f3970
/**
* Created by rockyl on 2019-04-09.
*/
import
ScillaComponent
from
"scilla-components/src/base/ScillaComponent"
;
import
{
dynamic
,
Entity
,
Tween
}
from
"scilla/src"
;
import
{
setText
}
from
"../entityUtils"
;
import
{
alien
}
from
"../navigator/StackNavigator"
;
import
Wave
from
'components/animation/Wave'
import
{
INavigatorViewBase
}
from
"../navigator/VirtualNavigator"
;
import
{
Transform
}
from
'scilla-components/src'
;
import
{
createTween
,
ease
}
from
"scilla"
;
export
default
class
SceneStart
extends
ScillaComponent
implements
INavigatorViewBase
{
ajaxElement
:
dynamic
;
doJoin
:
dynamic
;
getNgameStartStatus
:
dynamic
;
countTxt
:
Entity
;
startbtn
:
Entity
;
recordbtn
:
Entity
;
pingziFront
:
Entity
;
pingziBack
:
Entity
;
rankbtn
:
Entity
;
rulebtn
:
Entity
;
gouzi
:
Entity
;
pingzi_1
:
Entity
;
pingzi_2
:
Entity
;
gouzi_pingzi
:
Entity
;
private
startBtnAnimation
;
pingziFrontTransform
:
Transform
;
pingziBackTransform
:
Transform
;
gouziTransform
:
Transform
;
pingzi_1Transform
:
Transform
;
pingzi_2Transform
:
Transform
;
gouzi_pingziTransform
:
Transform
;
onAwake
()
{
super
.
onAwake
();
this
.
setCountText
(
''
);
this
.
startBtnAnimation
=
this
.
startbtn
.
getComponent
(
Transform
);
this
.
pingziFrontTransform
=
this
.
pingziFront
.
getComponent
(
Transform
);
this
.
pingziBackTransform
=
this
.
pingziBack
.
getComponent
(
Transform
);
this
.
gouziTransform
=
this
.
gouzi
.
getComponent
(
Transform
);
this
.
pingzi_1Transform
=
this
.
pingzi_1
.
getComponent
(
Transform
);
this
.
pingzi_2Transform
=
this
.
pingzi_2
.
getComponent
(
Transform
);
this
.
gouzi_pingziTransform
=
this
.
gouzi_pingzi
.
getComponent
(
Transform
);
this
.
grabState
=
false
;
this
.
hasPrize
=
false
;
//Tween.
//egret.Tween.get(this.startBtn, {loop:true}).to({scaleX:0.9, scaleY:0.9}, 300).wait(1000).to({scaleX:1, scaleY:1}, 300);
// SingleSceneNavigator
console
.
log
(
"sd"
)
/* var sd=createTween(this.startBtnAnimation, this.startBtnAnimation)
.to({scaleX:1.2,scaleY:1.2}, 1200) */
/* createTween(this, this.startBtnAnimation)
.set({scale: {x: 0, y: 0}, alpha: 1})
.wait(100)
.to({scale: {x: 0.8, y: 0.8}}, 800)
.to({scale: {x: 1.1, y: 1.1}, alpha: 0}, 1200); */
this
.
gouzi_pingziTransform
.
alpha
=
0
createTween
(
this
,
this
.
startBtnAnimation
,
true
,{
loop
:
-
1
})
.
set
({
scale
:
{
x
:
1
,
y
:
1
}})
.
to
({
scale
:
{
x
:
.
9
,
y
:
.
9
}},
300
)
.
wait
(
1000
)
.
to
({
scale
:
{
x
:
1
,
y
:
1
}},
300
)
createTween
(
this
,
this
.
pingziBackTransform
,
true
,{
loop
:
-
1
})
.
set
({
position
:
{
x
:
47.5
}})
.
to
({
position
:
{
x
:
-
152.5
}},
1000
)
createTween
(
this
,
this
.
pingziFrontTransform
,
true
,{
loop
:
-
1
})
.
set
({
position
:
{
x
:
-
110
}})
.
to
({
position
:
{
x
:
110
}},
1000
)
.
call
(()
=>
{
//console.log(`2`)
if
(
this
.
grabState
){
this
.
grabState
=
false
;
var
time
=
1000
;
if
(
this
.
hasPrize
){
time
=
1000
;
}
else
{
time
=
500
;
}
createTween
(
this
,
this
.
gouziTransform
,
true
,{
loop
:
0
})
.
set
({
position
:
{
y
:
132.5
}})
.
to
({
position
:
{
y
:
335
}},
time
)
.
call
(()
=>
{
if
(
this
.
hasPrize
){
this
.
hasPrize
=
false
;
this
.
pingzi_2Transform
.
alpha
=
0
this
.
gouzi_pingziTransform
.
alpha
=
1
setTimeout
(()
=>
{
this
.
pingzi_2Transform
.
alpha
=
1
},
1000
)
}
})
.
to
({
position
:
{
y
:
132.5
}},
1000
)
.
call
(()
=>
{
this
.
pingzi_2Transform
.
alpha
=
1
this
.
gouzi_pingziTransform
.
alpha
=
0
})
}
})
//console.log(sd)
//.call(resolve);
}
private
setCountText
(
text
:
string
)
{
setText
(
this
.
countTxt
,
text
);
}
initGameStage
()
{
this
.
updateCountText
();
}
updateCountText
()
{
const
{
element
}
=
this
.
ajaxElement
;
let
text
=
''
if
(
element
.
freeLimit
>
0
)
{
text
=
`今日剩余免费次数:
${
element
.
freeLimit
}
次`
;
}
else
{
text
=
`
${
element
.
needCredits
}${
window
[
'CFG'
].
unitName
}
/次`
}
this
.
setCountText
(
text
);
}
grabState
=
false
;
hasPrize
=
false
;
onClick_startbtn
()
{
this
.
grabState
=
true
;
this
.
hasPrize
=
true
;
/* if (window['getDuibaToken']) {
window['getDuibaToken']((tokenObj: any) => {
this.broadcast('callApi', 1, 'doJoin', {
token:tokenObj.token,
activityId: window['CFG'].actId,
activityType: 'hdtool',
consumerId: window['CFG'].consumerId
});
}, (key: string, messageObj: any) => {
this.onGotDojoinError();
});
} else {
this.broadcast('callApi', 1, 'doJoin', {
activityId: window['CFG'].actId,
activityType: 'hdtool',
consumerId: window['CFG'].consumerId
});
} */
}
onGotDojoin
()
{
console
.
log
(
'onGotDojoin'
,
this
.
doJoin
);
this
.
broadcast
(
'callApi'
,
1
,
'getNgameStartStatus'
,
{
orderId
:
this
.
doJoin
});
}
onGotDojoinError
(
data
?)
{
console
.
log
(
'onGotDojoinError'
)
console
.
log
(
this
.
doJoin
)
console
.
log
(
data
)
}
onGot_getNgameStartStatus
()
{
console
.
log
(
'onGot_getNgameStartStatus'
,
this
.
getNgameStartStatus
);
//fuck 不可以循环引用
this
.
bubbling
(
'fuck'
,
'play'
);
}
onGotError_getNgameStartStatus
()
{
console
.
log
(
this
.
getNgameStartStatus
)
console
.
log
(
'onGotError_getNgameStartStatus'
);
}
onClick_rulebtn
()
{
console
.
log
(
'onClick_rulebtn'
);
this
.
bubbling
(
'showDialog'
,
'Rule'
);
}
onClick_recordbtn
()
{
console
.
log
(
'onClick_rulebtn'
);
//this.bubbling('showDialog', 'Rule');
}
onClick_rankbtn
()
{
alert
(
'onClick_rankbtn'
)
// globalEvent.emit('alert', {title: 'Success', content: 'You complete this puzzle', button: 'Next level'}, this.onAlertClose);
}
onDidEnter
(
last
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
):
void
{
this
.
entity
.
enabled
=
true
;
}
onDidLeave
(
next
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
):
void
{
this
.
entity
.
enabled
=
false
;
}
async
onWillEnter
(
last
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
)
{
}
async
onWillLeave
(
next
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
)
{
}
onWillMount
(
last
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
):
Promise
<
any
>
{
return
undefined
;
}
onWillUnMount
(
next
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
):
Promise
<
any
>
{
return
undefined
;
}
}
.history/assets/scripts/scenes/SceneStart_20190620165908.ts
0 → 100644
View file @
9d5f3970
/**
* Created by rockyl on 2019-04-09.
*/
import
ScillaComponent
from
"scilla-components/src/base/ScillaComponent"
;
import
{
dynamic
,
Entity
,
Tween
}
from
"scilla/src"
;
import
{
setText
}
from
"../entityUtils"
;
import
{
alien
}
from
"../navigator/StackNavigator"
;
import
Wave
from
'components/animation/Wave'
import
{
INavigatorViewBase
}
from
"../navigator/VirtualNavigator"
;
import
{
Transform
}
from
'scilla-components/src'
;
import
{
createTween
,
ease
}
from
"scilla"
;
export
default
class
SceneStart
extends
ScillaComponent
implements
INavigatorViewBase
{
ajaxElement
:
dynamic
;
doJoin
:
dynamic
;
getNgameStartStatus
:
dynamic
;
countTxt
:
Entity
;
startbtn
:
Entity
;
recordbtn
:
Entity
;
pingziFront
:
Entity
;
pingziBack
:
Entity
;
rankbtn
:
Entity
;
rulebtn
:
Entity
;
gouzi
:
Entity
;
pingzi_1
:
Entity
;
pingzi_2
:
Entity
;
gouzi_pingzi
:
Entity
;
private
startBtnAnimation
;
pingziFrontTransform
:
Transform
;
pingziBackTransform
:
Transform
;
gouziTransform
:
Transform
;
pingzi_1Transform
:
Transform
;
pingzi_2Transform
:
Transform
;
gouzi_pingziTransform
:
Transform
;
onAwake
()
{
super
.
onAwake
();
this
.
setCountText
(
''
);
this
.
startBtnAnimation
=
this
.
startbtn
.
getComponent
(
Transform
);
this
.
pingziFrontTransform
=
this
.
pingziFront
.
getComponent
(
Transform
);
this
.
pingziBackTransform
=
this
.
pingziBack
.
getComponent
(
Transform
);
this
.
gouziTransform
=
this
.
gouzi
.
getComponent
(
Transform
);
this
.
pingzi_1Transform
=
this
.
pingzi_1
.
getComponent
(
Transform
);
this
.
pingzi_2Transform
=
this
.
pingzi_2
.
getComponent
(
Transform
);
this
.
gouzi_pingziTransform
=
this
.
gouzi_pingzi
.
getComponent
(
Transform
);
this
.
grabState
=
false
;
this
.
hasPrize
=
false
;
//Tween.
//egret.Tween.get(this.startBtn, {loop:true}).to({scaleX:0.9, scaleY:0.9}, 300).wait(1000).to({scaleX:1, scaleY:1}, 300);
// SingleSceneNavigator
console
.
log
(
"sd"
)
/* var sd=createTween(this.startBtnAnimation, this.startBtnAnimation)
.to({scaleX:1.2,scaleY:1.2}, 1200) */
/* createTween(this, this.startBtnAnimation)
.set({scale: {x: 0, y: 0}, alpha: 1})
.wait(100)
.to({scale: {x: 0.8, y: 0.8}}, 800)
.to({scale: {x: 1.1, y: 1.1}, alpha: 0}, 1200); */
this
.
gouzi_pingziTransform
.
alpha
=
0
this
.
pingzi_2Transform
.
alpha
=
1
createTween
(
this
,
this
.
startBtnAnimation
,
true
,{
loop
:
-
1
})
.
set
({
scale
:
{
x
:
1
,
y
:
1
}})
.
to
({
scale
:
{
x
:
.
9
,
y
:
.
9
}},
300
)
.
wait
(
1000
)
.
to
({
scale
:
{
x
:
1
,
y
:
1
}},
300
)
createTween
(
this
,
this
.
pingziBackTransform
,
true
,{
loop
:
-
1
})
.
set
({
position
:
{
x
:
47.5
}})
.
to
({
position
:
{
x
:
-
152.5
}},
1000
)
createTween
(
this
,
this
.
pingziFrontTransform
,
true
,{
loop
:
-
1
})
.
set
({
position
:
{
x
:
-
110
}})
.
to
({
position
:
{
x
:
110
}},
1000
)
.
call
(()
=>
{
//console.log(`2`)
if
(
this
.
grabState
){
this
.
grabState
=
false
;
var
time
=
1000
;
if
(
this
.
hasPrize
){
time
=
1000
;
}
else
{
time
=
500
;
}
createTween
(
this
,
this
.
gouziTransform
,
true
,{
loop
:
0
})
.
set
({
position
:
{
y
:
132.5
}})
.
to
({
position
:
{
y
:
335
}},
time
)
.
call
(()
=>
{
if
(
this
.
hasPrize
){
this
.
hasPrize
=
false
;
this
.
pingzi_2Transform
.
alpha
=
0
this
.
gouzi_pingziTransform
.
alpha
=
1
setTimeout
(()
=>
{
this
.
pingzi_2Transform
.
alpha
=
1
},
1000
)
}
})
.
to
({
position
:
{
y
:
132.5
}},
1000
)
.
call
(()
=>
{
this
.
pingzi_2Transform
.
alpha
=
1
this
.
gouzi_pingziTransform
.
alpha
=
0
})
}
})
//console.log(sd)
//.call(resolve);
}
private
setCountText
(
text
:
string
)
{
setText
(
this
.
countTxt
,
text
);
}
initGameStage
()
{
this
.
updateCountText
();
}
updateCountText
()
{
const
{
element
}
=
this
.
ajaxElement
;
let
text
=
''
if
(
element
.
freeLimit
>
0
)
{
text
=
`今日剩余免费次数:
${
element
.
freeLimit
}
次`
;
}
else
{
text
=
`
${
element
.
needCredits
}${
window
[
'CFG'
].
unitName
}
/次`
}
this
.
setCountText
(
text
);
}
grabState
=
false
;
hasPrize
=
false
;
onClick_startbtn
()
{
this
.
grabState
=
true
;
this
.
hasPrize
=
true
;
/* if (window['getDuibaToken']) {
window['getDuibaToken']((tokenObj: any) => {
this.broadcast('callApi', 1, 'doJoin', {
token:tokenObj.token,
activityId: window['CFG'].actId,
activityType: 'hdtool',
consumerId: window['CFG'].consumerId
});
}, (key: string, messageObj: any) => {
this.onGotDojoinError();
});
} else {
this.broadcast('callApi', 1, 'doJoin', {
activityId: window['CFG'].actId,
activityType: 'hdtool',
consumerId: window['CFG'].consumerId
});
} */
}
onGotDojoin
()
{
console
.
log
(
'onGotDojoin'
,
this
.
doJoin
);
this
.
broadcast
(
'callApi'
,
1
,
'getNgameStartStatus'
,
{
orderId
:
this
.
doJoin
});
}
onGotDojoinError
(
data
?)
{
console
.
log
(
'onGotDojoinError'
)
console
.
log
(
this
.
doJoin
)
console
.
log
(
data
)
}
onGot_getNgameStartStatus
()
{
console
.
log
(
'onGot_getNgameStartStatus'
,
this
.
getNgameStartStatus
);
//fuck 不可以循环引用
this
.
bubbling
(
'fuck'
,
'play'
);
}
onGotError_getNgameStartStatus
()
{
console
.
log
(
this
.
getNgameStartStatus
)
console
.
log
(
'onGotError_getNgameStartStatus'
);
}
onClick_rulebtn
()
{
console
.
log
(
'onClick_rulebtn'
);
this
.
bubbling
(
'showDialog'
,
'Rule'
);
}
onClick_recordbtn
()
{
console
.
log
(
'onClick_rulebtn'
);
//this.bubbling('showDialog', 'Rule');
}
onClick_rankbtn
()
{
alert
(
'onClick_rankbtn'
)
// globalEvent.emit('alert', {title: 'Success', content: 'You complete this puzzle', button: 'Next level'}, this.onAlertClose);
}
onDidEnter
(
last
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
):
void
{
this
.
entity
.
enabled
=
true
;
}
onDidLeave
(
next
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
):
void
{
this
.
entity
.
enabled
=
false
;
}
async
onWillEnter
(
last
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
)
{
}
async
onWillLeave
(
next
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
)
{
}
onWillMount
(
last
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
):
Promise
<
any
>
{
return
undefined
;
}
onWillUnMount
(
next
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
):
Promise
<
any
>
{
return
undefined
;
}
}
.history/assets/scripts/scenes/SceneStart_20190620165931.ts
0 → 100644
View file @
9d5f3970
/**
* Created by rockyl on 2019-04-09.
*/
import
ScillaComponent
from
"scilla-components/src/base/ScillaComponent"
;
import
{
dynamic
,
Entity
,
Tween
}
from
"scilla/src"
;
import
{
setText
}
from
"../entityUtils"
;
import
{
alien
}
from
"../navigator/StackNavigator"
;
import
Wave
from
'components/animation/Wave'
import
{
INavigatorViewBase
}
from
"../navigator/VirtualNavigator"
;
import
{
Transform
}
from
'scilla-components/src'
;
import
{
createTween
,
ease
}
from
"scilla"
;
export
default
class
SceneStart
extends
ScillaComponent
implements
INavigatorViewBase
{
ajaxElement
:
dynamic
;
doJoin
:
dynamic
;
getNgameStartStatus
:
dynamic
;
countTxt
:
Entity
;
startbtn
:
Entity
;
recordbtn
:
Entity
;
pingziFront
:
Entity
;
pingziBack
:
Entity
;
rankbtn
:
Entity
;
rulebtn
:
Entity
;
gouzi
:
Entity
;
pingzi_1
:
Entity
;
pingzi_2
:
Entity
;
gouzi_pingzi
:
Entity
;
private
startBtnAnimation
;
pingziFrontTransform
:
Transform
;
pingziBackTransform
:
Transform
;
gouziTransform
:
Transform
;
pingzi_1Transform
:
Transform
;
pingzi_2Transform
:
Transform
;
gouzi_pingziTransform
:
Transform
;
onAwake
()
{
super
.
onAwake
();
this
.
setCountText
(
''
);
this
.
startBtnAnimation
=
this
.
startbtn
.
getComponent
(
Transform
);
this
.
pingziFrontTransform
=
this
.
pingziFront
.
getComponent
(
Transform
);
this
.
pingziBackTransform
=
this
.
pingziBack
.
getComponent
(
Transform
);
this
.
gouziTransform
=
this
.
gouzi
.
getComponent
(
Transform
);
this
.
pingzi_1Transform
=
this
.
pingzi_1
.
getComponent
(
Transform
);
this
.
pingzi_2Transform
=
this
.
pingzi_2
.
getComponent
(
Transform
);
this
.
gouzi_pingziTransform
=
this
.
gouzi_pingzi
.
getComponent
(
Transform
);
this
.
grabState
=
false
;
this
.
hasPrize
=
false
;
//Tween.
//egret.Tween.get(this.startBtn, {loop:true}).to({scaleX:0.9, scaleY:0.9}, 300).wait(1000).to({scaleX:1, scaleY:1}, 300);
// SingleSceneNavigator
console
.
log
(
"sd"
)
/* var sd=createTween(this.startBtnAnimation, this.startBtnAnimation)
.to({scaleX:1.2,scaleY:1.2}, 1200) */
/* createTween(this, this.startBtnAnimation)
.set({scale: {x: 0, y: 0}, alpha: 1})
.wait(100)
.to({scale: {x: 0.8, y: 0.8}}, 800)
.to({scale: {x: 1.1, y: 1.1}, alpha: 0}, 1200); */
this
.
gouzi_pingziTransform
.
alpha
=
0
this
.
pingzi_2Transform
.
alpha
=
1
createTween
(
this
,
this
.
startBtnAnimation
,
true
,{
loop
:
-
1
})
.
set
({
scale
:
{
x
:
1
,
y
:
1
}})
.
to
({
scale
:
{
x
:
.
9
,
y
:
.
9
}},
300
)
.
wait
(
1000
)
.
to
({
scale
:
{
x
:
1
,
y
:
1
}},
300
)
createTween
(
this
,
this
.
pingziBackTransform
,
true
,{
loop
:
-
1
})
.
set
({
position
:
{
x
:
47.5
}})
.
to
({
position
:
{
x
:
-
152.5
}},
1000
)
createTween
(
this
,
this
.
pingziFrontTransform
,
true
,{
loop
:
-
1
})
.
set
({
position
:
{
x
:
-
110
}})
.
to
({
position
:
{
x
:
110
}},
1000
)
.
call
(()
=>
{
//console.log(`2`)
if
(
this
.
grabState
){
this
.
grabState
=
false
;
var
time
=
1000
;
if
(
this
.
hasPrize
){
time
=
1000
;
}
else
{
time
=
500
;
}
createTween
(
this
,
this
.
gouziTransform
,
true
,{
loop
:
0
})
.
set
({
position
:
{
y
:
132.5
}})
.
to
({
position
:
{
y
:
335
}},
time
)
.
call
(()
=>
{
if
(
this
.
hasPrize
){
this
.
hasPrize
=
false
;
this
.
pingzi_2Transform
.
alpha
=
0
this
.
gouzi_pingziTransform
.
alpha
=
1
setTimeout
(()
=>
{
this
.
pingzi_2Transform
.
alpha
=
1
},
1000
)
}
})
.
to
({
position
:
{
y
:
132.5
}},
1000
)
.
call
(()
=>
{
this
.
pingzi_2Transform
.
alpha
=
1
//this.gouzi_pingziTransform.alpha=0
})
}
})
//console.log(sd)
//.call(resolve);
}
private
setCountText
(
text
:
string
)
{
setText
(
this
.
countTxt
,
text
);
}
initGameStage
()
{
this
.
updateCountText
();
}
updateCountText
()
{
const
{
element
}
=
this
.
ajaxElement
;
let
text
=
''
if
(
element
.
freeLimit
>
0
)
{
text
=
`今日剩余免费次数:
${
element
.
freeLimit
}
次`
;
}
else
{
text
=
`
${
element
.
needCredits
}${
window
[
'CFG'
].
unitName
}
/次`
}
this
.
setCountText
(
text
);
}
grabState
=
false
;
hasPrize
=
false
;
onClick_startbtn
()
{
this
.
grabState
=
true
;
this
.
hasPrize
=
true
;
/* if (window['getDuibaToken']) {
window['getDuibaToken']((tokenObj: any) => {
this.broadcast('callApi', 1, 'doJoin', {
token:tokenObj.token,
activityId: window['CFG'].actId,
activityType: 'hdtool',
consumerId: window['CFG'].consumerId
});
}, (key: string, messageObj: any) => {
this.onGotDojoinError();
});
} else {
this.broadcast('callApi', 1, 'doJoin', {
activityId: window['CFG'].actId,
activityType: 'hdtool',
consumerId: window['CFG'].consumerId
});
} */
}
onGotDojoin
()
{
console
.
log
(
'onGotDojoin'
,
this
.
doJoin
);
this
.
broadcast
(
'callApi'
,
1
,
'getNgameStartStatus'
,
{
orderId
:
this
.
doJoin
});
}
onGotDojoinError
(
data
?)
{
console
.
log
(
'onGotDojoinError'
)
console
.
log
(
this
.
doJoin
)
console
.
log
(
data
)
}
onGot_getNgameStartStatus
()
{
console
.
log
(
'onGot_getNgameStartStatus'
,
this
.
getNgameStartStatus
);
//fuck 不可以循环引用
this
.
bubbling
(
'fuck'
,
'play'
);
}
onGotError_getNgameStartStatus
()
{
console
.
log
(
this
.
getNgameStartStatus
)
console
.
log
(
'onGotError_getNgameStartStatus'
);
}
onClick_rulebtn
()
{
console
.
log
(
'onClick_rulebtn'
);
this
.
bubbling
(
'showDialog'
,
'Rule'
);
}
onClick_recordbtn
()
{
console
.
log
(
'onClick_rulebtn'
);
//this.bubbling('showDialog', 'Rule');
}
onClick_rankbtn
()
{
alert
(
'onClick_rankbtn'
)
// globalEvent.emit('alert', {title: 'Success', content: 'You complete this puzzle', button: 'Next level'}, this.onAlertClose);
}
onDidEnter
(
last
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
):
void
{
this
.
entity
.
enabled
=
true
;
}
onDidLeave
(
next
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
):
void
{
this
.
entity
.
enabled
=
false
;
}
async
onWillEnter
(
last
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
)
{
}
async
onWillLeave
(
next
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
)
{
}
onWillMount
(
last
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
):
Promise
<
any
>
{
return
undefined
;
}
onWillUnMount
(
next
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
):
Promise
<
any
>
{
return
undefined
;
}
}
assets/scenes/main.scene
View file @
9d5f3970
...
...
@@ -112,7 +112,11 @@
"sceneContainer": "entity|74d86361-3aa2-4ce6-ba1f-796598147075",
"rulebtn": "entity|4cf8cf2d-6adf-4f87-843b-617a35e35477",
"pingziFront": "entity|fd47c4af-8351-4cdc-9b88-f38127dc5e1a",
"pingziBack": "entity|c2faeb70-16a5-41bd-944c-399aa7e23847"
"pingziBack": "entity|c2faeb70-16a5-41bd-944c-399aa7e23847",
"gouzi": "entity|14e15843-7bff-474b-857f-c23cf3dae20a",
"pingzi_1": "entity|f8175d37-59a4-46bf-b281-6b9d8c7e8019",
"pingzi_2": "entity|e285b74a-1412-4cd6-a305-16378a030922",
"gouzi_pingzi": "entity|baba7316-9d74-44c1-b2a8-1852e716e67d"
}
}
],
...
...
@@ -188,99 +192,82 @@
"uuid": "82c56a04-230c-4f9c-9873-6958e20b3aa7"
},
{
"name": "
Logo
",
"name": "
Pingzi
",
"components": [
{
"script": "components/base/Transform",
"properties": {
"pivot": {
"x": 0,
"y": 0,
"_type_": "scilla/support/Vector2D"
},
"position": {
"x":
37
5,
"y":
186
,
"x":
47.
5,
"y":
605
,
"_type_": "scilla/support/Vector2D"
}
}
},
{
"script": "components/renderer/
Texture
Renderer",
"script": "components/renderer/
Rect
Renderer",
"properties": {
"texture": "res|98ca4b08-205d-471c-b891-de484ba0c0ec"
"anchor": {
"x": 0,
"y": 0,
"_type_": "scilla/support/Vector2D"
},
"width": 654,
"height": 270,
"isMask": true
}
}
],
"uuid": "
7cea08fc-530d-45d3-9ea0-2b2b36590d56"
},
"uuid": "
02b69dcd-88e2-4c1b-988c-cf3e3a3fac56",
"children": [
{
"name": "PeopleIco
",
"name": "Pingzi_back
",
"components": [
{
"script": "components/base/Transform",
"properties": {
"pivot": {
"x": 0,
"y": 0,
"_type_": "scilla/support/Vector2D"
},
"position": {
"_hashCode": 37451
,
"_x": 376
,
"_y": 592
,
"x": 378
,
"y": 1056
"_hashCode": 175816
,
"_x": -10
,
"_y": 157.5
,
"x": 47.5
,
"y": 32.5
}
}
},
{
"script": "components/renderer/TextureRenderer",
"properties": {
"texture": "res|3fd2a613-5b9b-4337-8d66-b20bc5894d29"
}
}
],
"uuid": "8fcd7042-1220-4fce-963e-0ab04ddc7bd9"
},
"uuid": "c2faeb70-16a5-41bd-944c-399aa7e23847",
"children": [
{
"name": "Tips
",
"name": "Image
",
"components": [
{
"script": "components/base/Transform",
"properties": {
"pivot": {
"x": 0,
"y": 0,
"_type_": "scilla/support/Vector2D"
},
"position": {
"x": 375,
"y": 1144,
"_type_": "scilla/support/Vector2D"
"x": 0,
"y": 47.5
}
}
},
{
"script": "components/renderer/TextureRenderer",
"properties": {
"texture": "res|8067678e-d15f-4f0d-9084-60a2e51d29bd
"
"texture": "res|a9d0833b-476a-4a6d-ab87-34cdec41f756
"
}
}
],
"uuid": "387e680f-e296-4f58-a4e8-2517f9619f4d"
}
]
"uuid": "b7a9d401-d72f-4488-98b0-e5271f610784"
},
{
"name": "RuleButton
",
"name": "Image
",
"components": [
{
"script": "components/base/Transform",
"properties": {
"position": {
"x": 72
,
"y": 32
,
"x": 200
,
"y": 47.5
,
"_type_": "scilla/support/Vector2D"
}
}
...
...
@@ -288,61 +275,65 @@
{
"script": "components/renderer/TextureRenderer",
"properties": {
"texture": "res|9139f20b-e70f-4d3f-afac-4b6abaaa5d1a"
"texture": "res|a9d0833b-476a-4a6d-ab87-34cdec41f756"
}
}
],
"uuid": "d2b5c867-142e-4b6b-bcd9-f96133b86712"
},
{
"script": "components/animation/TouchZoom",
"name": "Image",
"components": [
{
"script": "components/base/Transform",
"properties": {
"easeName": "backOut"
"position": {
"x": 400,
"y": 47.5,
"_type_": "scilla/support/Vector2D"
}
}
},
{
"script": "components/ui/Button
",
"script": "components/renderer/TextureRenderer
",
"properties": {
"upRes": "res|9139f20b-e70f-4d3f-afac-4b6abaaa5d1a",
"downRes": "res|9139f20b-e70f-4d3f-afac-4b6abaaa5d1a",
"disabledRes": "res|9139f20b-e70f-4d3f-afac-4b6abaaa5d1a",
"onClick": [
{
"entity": "entity|887e3162-ef6e-4f1e-95ba-2c94c4cbff25",
"component": 1,
"method": "onClick_rulebtn"
}
]
"texture": "res|a9d0833b-476a-4a6d-ab87-34cdec41f756"
}
}
],
"children": [
"uuid": "98c29dc2-ec4c-4a41-a242-f36f400d7bd5"
},
{
"name": "label
",
"name": "Image
",
"components": [
{
"script": "components/base/Transform",
"properties": {}
"properties": {
"position": {
"x": 600,
"y": 47.5,
"_type_": "scilla/support/Vector2D"
}
}
},
{
"script": "components/renderer/Text
Renderer",
"script": "components/renderer/Texture
Renderer",
"properties": {
"text": "",
"fillColor": "rgba(255, 255, 255, 1)"
"texture": "res|a9d0833b-476a-4a6d-ab87-34cdec41f756"
}
}
],
"uuid": "33ea9d48-899e-4e37-bc93-38b998b4036b"
}
],
"uuid": "4cf8cf2d-6adf-4f87-843b-617a35e35477"
"uuid": "4d6f8680-5eb8-4fa9-bd13-6c5c05a1420a"
},
{
"name": "StartButton
",
"name": "Image
",
"components": [
{
"script": "components/base/Transform",
"properties": {
"position": {
"x": 375
,
"y": 958
,
"x": 800
,
"y": 47.5
,
"_type_": "scilla/support/Vector2D"
}
}
...
...
@@ -350,61 +341,57 @@
{
"script": "components/renderer/TextureRenderer",
"properties": {
"texture": "res|41fdb6b7-506a-41ee-86fb-475d934a0553
"
"texture": "res|a9d0833b-476a-4a6d-ab87-34cdec41f756
"
}
},
{
"script": "components/animation/TouchZoom",
"properties": {
"easeName": "backOut"
}
],
"uuid": "f52bac1b-2550-47b1-a987-f283a3e5f61a"
}
]
},
{
"script": "components/ui/Button",
"properties": {
"upRes": "res|41fdb6b7-506a-41ee-86fb-475d934a0553",
"downRes": "res|41fdb6b7-506a-41ee-86fb-475d934a0553",
"disabledRes": "res|f497c44d-3b57-499d-a5b1-497846fcb265",
"onClick": [
"name": "Pingzi_front",
"components": [
{
"entity": "entity|887e3162-ef6e-4f1e-95ba-2c94c4cbff25",
"component": 1,
"method": "onClick_startbtn"
"script": "components/base/Transform",
"properties": {
"position": {
"_hashCode": 175816,
"_x": -10,
"_y": 157.5,
"x": 110,
"y": 157.5
}
]
}
}
],
"uuid": "fd47c4af-8351-4cdc-9b88-f38127dc5e1a",
"children": [
{
"name": "label
",
"name": "Image
",
"components": [
{
"script": "components/base/Transform",
"properties": {}
},
{
"script": "components/renderer/Text
Renderer",
"script": "components/renderer/Texture
Renderer",
"properties": {
"text": "",
"fillColor": "rgba(255, 255, 255, 1)"
"texture": "res|fd91d5ed-d6d3-4da6-9f0f-fc5206b12207"
}
}
],
"uuid": "8346d762-aa18-4d92-ae48-fb5b61f5aecb"
}
],
"uuid": "2a5fede0-40da-408d-83ad-22b985b633b2"
"uuid": "6067e37c-ca85-4b3c-b793-be5d584ec739"
},
{
"name": "RecordButton
",
"name": "Pingzi_1
",
"components": [
{
"script": "components/base/Transform",
"properties": {
"position": {
"x": 687.6428571428571
,
"y": 69.42857142857143
,
"x": 220
,
"y": 0
,
"_type_": "scilla/support/Vector2D"
}
}
...
...
@@ -412,155 +399,151 @@
{
"script": "components/renderer/TextureRenderer",
"properties": {
"texture": "res|07b29226-9a48-4944-93d9-605e899a9e8f"
}
},
{
"script": "components/animation/TouchZoom",
"properties": {
"easeName": "backOut"
}
},
{
"script": "components/ui/Button",
"properties": {
"upRes": "res|07b29226-9a48-4944-93d9-605e899a9e8f",
"downRes": "res|07b29226-9a48-4944-93d9-605e899a9e8f",
"disabledRes": "res|07b29226-9a48-4944-93d9-605e899a9e8f",
"onClick": [
{
"entity": "entity|887e3162-ef6e-4f1e-95ba-2c94c4cbff25",
"component": 1,
"method": "onClick_recordbtn"
}
]
"texture": "res|fd91d5ed-d6d3-4da6-9f0f-fc5206b12207"
}
}
],
"children": [
"uuid": "f8175d37-59a4-46bf-b281-6b9d8c7e8019"
},
{
"name": "label
",
"name": "Pingzi_2
",
"components": [
{
"script": "components/base/Transform",
"properties": {}
"properties": {
"position": {
"x": 440,
"y": 0,
"_type_": "scilla/support/Vector2D"
}
}
},
{
"script": "components/renderer/Text
Renderer",
"script": "components/renderer/Texture
Renderer",
"properties": {
"text": "",
"fillColor": "rgba(255, 255, 255, 1)"
}
"texture": "res|fd91d5ed-d6d3-4da6-9f0f-fc5206b12207"
}
],
"uuid": "792e6694-fd2a-433f-b702-f01d90cd8d90"
}
],
"uuid": "5c6e9811-b5e2-4c88-a029-502e84333261
"
"uuid": "e285b74a-1412-4cd6-a305-16378a030922
"
},
{
"name": "Label
",
"name": "Image
",
"components": [
{
"script": "components/base/Transform",
"properties": {
"position": {
"x": 375,
"y": 1072.5,
"_type_": "scilla/support/Vector2D"
"_hashCode": 172002,
"_x": 0,
"_y": 0,
"x": 660,
"y": 0
}
}
},
{
"script": "components/renderer/Text
Renderer",
"script": "components/renderer/Texture
Renderer",
"properties": {
"text": "剩余次数:3次",
"fillColor": "rgba(255, 255, 255, 1)",
"textStyle": {
"fontSize": 26
}
"texture": "res|fd91d5ed-d6d3-4da6-9f0f-fc5206b12207"
}
}
],
"uuid": "42cd135d-b264-40af-9b62-5b0a2a935f3b
"
"uuid": "5036633c-7f33-45b8-bfd6-b713d846f555
"
},
{
"name": "Pingzi
",
"name": "Image
",
"components": [
{
"script": "components/base/Transform",
"properties": {
"position": {
"x": 47.5
,
"y": 605
,
"x": 880
,
"y": 0
,
"_type_": "scilla/support/Vector2D"
}
}
},
{
"script": "components/renderer/Rect
Renderer",
"script": "components/renderer/Texture
Renderer",
"properties": {
"anchor": {
"x": 0,
"y": 0,
"_type_": "scilla/support/Vector2D"
},
"width": 654,
"height": 270,
"isMask": true
"texture": "res|fd91d5ed-d6d3-4da6-9f0f-fc5206b12207"
}
}
],
"uuid": "02b69dcd-88e2-4c1b-988c-cf3e3a3fac56",
"children": [
"uuid": "dfc118d9-dd26-45f5-94f4-bc9b42374ff5"
}
]
}
]
},
{
"name": "
Pingzi_back
",
"name": "
Gouzi
",
"components": [
{
"script": "components/base/Transform",
"properties": {
"position": {
"_hashCode": 175816,
"_x": -10,
"_y": 157.5,
"x": 47.5,
"y": 32.5
"x": 375,
"y": 335,
"_type_": "scilla/support/Vector2D"
},
"pivot": {
"y": 0,
"_type_": "scilla/support/Vector2D"
}
}
},
{
"script": "components/renderer/TextureRenderer",
"properties": {
"texture": "res|c8e3cc03-e940-414c-92c2-b89737527877",
"anchor": {
"y": 0,
"_type_": "scilla/support/Vector2D"
}
}
}
],
"uuid": "
c2faeb70-16a5-41bd-944c-399aa7e23847
",
"uuid": "
14e15843-7bff-474b-857f-c23cf3dae20a
",
"children": [
{
"name": "
Image
",
"name": "
GouziPingzi
",
"components": [
{
"script": "components/base/Transform",
"properties": {
"position": {
"x":
0
,
"y": 47.5
"x":
2.5
,
"y": 4
2
7.5
}
}
},
{
"script": "components/renderer/TextureRenderer",
"properties": {
"texture": "res|
a9d0833b-476a-4a6d-ab87-34cdec41f756
"
"texture": "res|
fd91d5ed-d6d3-4da6-9f0f-fc5206b12207
"
}
}
],
"uuid": "b7a9d401-d72f-4488-98b0-e5271f610784"
"uuid": "baba7316-9d74-44c1-b2a8-1852e716e67d"
}
]
},
{
"name": "Image
",
"name": "Logo
",
"components": [
{
"script": "components/base/Transform",
"properties": {
"pivot": {
"x": 0,
"y": 0,
"_type_": "scilla/support/Vector2D"
},
"position": {
"x": 200
,
"y": 47.5
,
"x": 375
,
"y": 186
,
"_type_": "scilla/support/Vector2D"
}
}
...
...
@@ -568,43 +551,55 @@
{
"script": "components/renderer/TextureRenderer",
"properties": {
"texture": "res|a9d0833b-476a-4a6d-ab87-34cdec41f756
"
"texture": "res|98ca4b08-205d-471c-b891-de484ba0c0ec
"
}
}
],
"uuid": "d2b5c867-142e-4b6b-bcd9-f96133b86712
"
"uuid": "7cea08fc-530d-45d3-9ea0-2b2b36590d56
"
},
{
"name": "Image
",
"name": "PeopleIco
",
"components": [
{
"script": "components/base/Transform",
"properties": {
"position
": {
"x": 40
0,
"y": 47.5
,
"pivot
": {
"x":
0,
"y": 0
,
"_type_": "scilla/support/Vector2D"
},
"position": {
"_hashCode": 37451,
"_x": 376,
"_y": 592,
"x": 378,
"y": 1056
}
}
},
{
"script": "components/renderer/TextureRenderer",
"properties": {
"texture": "res|a9d0833b-476a-4a6d-ab87-34cdec41f756
"
"texture": "res|3fd2a613-5b9b-4337-8d66-b20bc5894d29
"
}
}
],
"uuid": "98c29dc2-ec4c-4a41-a242-f36f400d7bd5
"
"uuid": "8fcd7042-1220-4fce-963e-0ab04ddc7bd9
"
},
{
"name": "Image
",
"name": "Tips
",
"components": [
{
"script": "components/base/Transform",
"properties": {
"pivot": {
"x": 0,
"y": 0,
"_type_": "scilla/support/Vector2D"
},
"position": {
"x": 600
,
"y": 47.5
,
"x": 375
,
"y": 1144
,
"_type_": "scilla/support/Vector2D"
}
}
...
...
@@ -612,21 +607,23 @@
{
"script": "components/renderer/TextureRenderer",
"properties": {
"texture": "res|a9d0833b-476a-4a6d-ab87-34cdec41f756
"
"texture": "res|8067678e-d15f-4f0d-9084-60a2e51d29bd
"
}
}
],
"uuid": "4d6f8680-5eb8-4fa9-bd13-6c5c05a1420a"
"uuid": "387e680f-e296-4f58-a4e8-2517f9619f4d"
}
]
},
{
"name": "Image
",
"name": "RuleButton
",
"components": [
{
"script": "components/base/Transform",
"properties": {
"position": {
"x": 800
,
"y": 47.5
,
"x": 72
,
"y": 32
,
"_type_": "scilla/support/Vector2D"
}
}
...
...
@@ -634,57 +631,61 @@
{
"script": "components/renderer/TextureRenderer",
"properties": {
"texture": "res|a9d0833b-476a-4a6d-ab87-34cdec41f756"
}
}
],
"uuid": "f52bac1b-2550-47b1-a987-f283a3e5f61a"
"texture": "res|9139f20b-e70f-4d3f-afac-4b6abaaa5d1a"
}
]
},
{
"name": "Pingzi_front",
"components": [
"script": "components/animation/TouchZoom",
"properties": {
"easeName": "backOut"
}
},
{
"script": "components/base/Transform
",
"script": "components/ui/Button
",
"properties": {
"position": {
"_hashCode": 175816,
"_x": -10,
"_y": 157.5,
"x": 110,
"y": 157.5
"upRes": "res|9139f20b-e70f-4d3f-afac-4b6abaaa5d1a",
"downRes": "res|9139f20b-e70f-4d3f-afac-4b6abaaa5d1a",
"disabledRes": "res|9139f20b-e70f-4d3f-afac-4b6abaaa5d1a",
"onClick": [
{
"entity": "entity|887e3162-ef6e-4f1e-95ba-2c94c4cbff25",
"component": 1,
"method": "onClick_rulebtn"
}
]
}
}
],
"uuid": "fd47c4af-8351-4cdc-9b88-f38127dc5e1a",
"children": [
{
"name": "Image
",
"name": "label
",
"components": [
{
"script": "components/base/Transform",
"properties": {}
},
{
"script": "components/renderer/Texture
Renderer",
"script": "components/renderer/Text
Renderer",
"properties": {
"texture": "res|fd91d5ed-d6d3-4da6-9f0f-fc5206b12207"
"text": "",
"fillColor": "rgba(255, 255, 255, 1)"
}
}
],
"uuid": "6067e37c-ca85-4b3c-b793-be5d584ec739"
"uuid": "33ea9d48-899e-4e37-bc93-38b998b4036b"
}
],
"uuid": "4cf8cf2d-6adf-4f87-843b-617a35e35477"
},
{
"name": "Image
",
"name": "StartButton
",
"components": [
{
"script": "components/base/Transform",
"properties": {
"position": {
"x": 220
,
"y": 0
,
"x": 375
,
"y": 958
,
"_type_": "scilla/support/Vector2D"
}
}
...
...
@@ -692,21 +693,61 @@
{
"script": "components/renderer/TextureRenderer",
"properties": {
"texture": "res|fd91d5ed-d6d3-4da6-9f0f-fc5206b12207"
"texture": "res|41fdb6b7-506a-41ee-86fb-475d934a0553"
}
},
{
"script": "components/animation/TouchZoom",
"properties": {
"easeName": "backOut"
}
},
{
"script": "components/ui/Button",
"properties": {
"upRes": "res|41fdb6b7-506a-41ee-86fb-475d934a0553",
"downRes": "res|41fdb6b7-506a-41ee-86fb-475d934a0553",
"disabledRes": "res|f497c44d-3b57-499d-a5b1-497846fcb265",
"onClick": [
{
"entity": "entity|887e3162-ef6e-4f1e-95ba-2c94c4cbff25",
"component": 1,
"method": "onClick_startbtn"
}
]
}
}
],
"uuid": "f8175d37-59a4-46bf-b281-6b9d8c7e8019"
"children": [
{
"name": "label",
"components": [
{
"script": "components/base/Transform",
"properties": {}
},
{
"name": "Image",
"script": "components/renderer/TextRenderer",
"properties": {
"text": "",
"fillColor": "rgba(255, 255, 255, 1)"
}
}
],
"uuid": "8346d762-aa18-4d92-ae48-fb5b61f5aecb"
}
],
"uuid": "2a5fede0-40da-408d-83ad-22b985b633b2"
},
{
"name": "RecordButton",
"components": [
{
"script": "components/base/Transform",
"properties": {
"position": {
"x": 440
,
"y": 0
,
"x": 687.6428571428571
,
"y": 69.42857142857143
,
"_type_": "scilla/support/Vector2D"
}
}
...
...
@@ -714,61 +755,77 @@
{
"script": "components/renderer/TextureRenderer",
"properties": {
"texture": "res|fd91d5ed-d6d3-4da6-9f0f-fc5206b12207"
}
"texture": "res|07b29226-9a48-4944-93d9-605e899a9e8f"
}
],
"uuid": "e285b74a-1412-4cd6-a305-16378a030922"
},
{
"name": "Image",
"components": [
"script": "components/animation/TouchZoom",
"properties": {
"easeName": "backOut"
}
},
{
"script": "components/base/Transform
",
"script": "components/ui/Button
",
"properties": {
"position": {
"_hashCode": 172002,
"_x": 0,
"_y": 0,
"x": 660,
"y": 0
"upRes": "res|07b29226-9a48-4944-93d9-605e899a9e8f",
"downRes": "res|07b29226-9a48-4944-93d9-605e899a9e8f",
"disabledRes": "res|07b29226-9a48-4944-93d9-605e899a9e8f",
"onClick": [
{
"entity": "entity|887e3162-ef6e-4f1e-95ba-2c94c4cbff25",
"component": 1,
"method": "onClick_recordbtn"
}
]
}
}
],
"children": [
{
"name": "label",
"components": [
{
"script": "components/base/Transform",
"properties": {}
},
{
"script": "components/renderer/Texture
Renderer",
"script": "components/renderer/Text
Renderer",
"properties": {
"texture": "res|fd91d5ed-d6d3-4da6-9f0f-fc5206b12207"
"text": "",
"fillColor": "rgba(255, 255, 255, 1)"
}
}
],
"uuid": "5036633c-7f33-45b8-bfd6-b713d846f555"
"uuid": "792e6694-fd2a-433f-b702-f01d90cd8d90"
}
],
"uuid": "5c6e9811-b5e2-4c88-a029-502e84333261"
},
{
"name": "Image
",
"name": "Label
",
"components": [
{
"script": "components/base/Transform",
"properties": {
"position": {
"x": 880
,
"y": 0
,
"x": 375
,
"y": 1072.5
,
"_type_": "scilla/support/Vector2D"
}
}
},
{
"script": "components/renderer/Texture
Renderer",
"script": "components/renderer/Text
Renderer",
"properties": {
"texture": "res|fd91d5ed-d6d3-4da6-9f0f-fc5206b12207"
}
"text": "剩余次数:3次",
"fillColor": "rgba(255, 255, 255, 1)",
"textStyle": {
"fontSize": 26
}
],
"uuid": "dfc118d9-dd26-45f5-94f4-bc9b42374ff5"
}
]
}
]
],
"uuid": "42cd135d-b264-40af-9b62-5b0a2a935f3b"
}
],
"disabled": true
...
...
@@ -2868,6 +2925,10 @@
"uuid": "d5c274a4-f083-4eb2-80a4-bf62b5039de6",
"url": "singles/rule_panel/ruleBg.png"
},
{
"uuid": "c8e3cc03-e940-414c-92c2-b89737527877",
"url": "singles/start_scene/jiazi.png"
},
{
"uuid": "a9d0833b-476a-4a6d-ab87-34cdec41f756",
"url": "singles/start_scene/jiu_bg.png"
...
...
assets/scripts/scenes/SceneStart.ts
View file @
9d5f3970
...
...
@@ -22,18 +22,33 @@ export default class SceneStart extends ScillaComponent implements INavigatorVie
pingziBack
:
Entity
;
rankbtn
:
Entity
;
rulebtn
:
Entity
;
gouzi
:
Entity
;
pingzi_1
:
Entity
;
pingzi_2
:
Entity
;
gouzi_pingzi
:
Entity
;
private
startBtnAnimation
;
pingziFrontTransform
:
Transform
;
pingziBackTransform
:
Transform
;
gouziTransform
:
Transform
;
pingzi_1Transform
:
Transform
;
pingzi_2Transform
:
Transform
;
gouzi_pingziTransform
:
Transform
;
onAwake
()
{
super
.
onAwake
();
this
.
setCountText
(
''
);
this
.
startBtnAnimation
=
this
.
startbtn
.
getComponent
(
Transform
);
this
.
pingziFrontTransform
=
this
.
pingziFront
.
getComponent
(
Transform
);
this
.
pingziBackTransform
=
this
.
pingziBack
.
getComponent
(
Transform
);
this
.
gouziTransform
=
this
.
gouzi
.
getComponent
(
Transform
);
this
.
pingzi_1Transform
=
this
.
pingzi_1
.
getComponent
(
Transform
);
this
.
pingzi_2Transform
=
this
.
pingzi_2
.
getComponent
(
Transform
);
this
.
gouzi_pingziTransform
=
this
.
gouzi_pingzi
.
getComponent
(
Transform
);
this
.
grabState
=
false
;
this
.
hasPrize
=
false
;
//Tween.
//egret.Tween.get(this.startBtn, {loop:true}).to({scaleX:0.9, scaleY:0.9}, 300).wait(1000).to({scaleX:1, scaleY:1}, 300);
...
...
@@ -50,6 +65,9 @@ export default class SceneStart extends ScillaComponent implements INavigatorVie
.to({scale: {x: 0.8, y: 0.8}}, 800)
.to({scale: {x: 1.1, y: 1.1}, alpha: 0}, 1200); */
this
.
gouzi_pingziTransform
.
alpha
=
0
this
.
pingzi_2Transform
.
alpha
=
1
createTween
(
this
,
this
.
startBtnAnimation
,
true
,{
loop
:
-
1
})
.
set
({
scale
:
{
x
:
1
,
y
:
1
}})
.
to
({
scale
:
{
x
:
.
9
,
y
:
.
9
}},
300
)
...
...
@@ -57,13 +75,48 @@ export default class SceneStart extends ScillaComponent implements INavigatorVie
.
to
({
scale
:
{
x
:
1
,
y
:
1
}},
300
)
createTween
(
this
,
this
.
pingziBackTransform
,
true
,{
loop
:
-
1
})
.
set
({
position
:
{
x
:
47.5
}})
.
to
({
position
:
{
x
:
-
152.5
}},
1000
)
createTween
(
this
,
this
.
pingziFrontTransform
,
true
,{
loop
:
-
1
})
.
set
({
position
:
{
x
:
-
110
}})
.
to
({
position
:
{
x
:
110
}},
1000
)
.
call
(()
=>
{
//console.log(`2`)
if
(
this
.
grabState
){
this
.
grabState
=
false
;
var
time
=
1000
;
if
(
this
.
hasPrize
){
time
=
1000
;
}
else
{
time
=
500
;
}
createTween
(
this
,
this
.
gouziTransform
,
true
,{
loop
:
0
})
.
set
({
position
:
{
y
:
132.5
}})
.
to
({
position
:
{
y
:
335
}},
time
)
.
call
(()
=>
{
if
(
this
.
hasPrize
){
this
.
hasPrize
=
false
;
this
.
pingzi_2Transform
.
alpha
=
0
this
.
gouzi_pingziTransform
.
alpha
=
1
setTimeout
(()
=>
{
this
.
pingzi_2Transform
.
alpha
=
1
},
1000
)
}
})
.
to
({
position
:
{
y
:
132.5
}},
1000
)
.
call
(()
=>
{
this
.
pingzi_2Transform
.
alpha
=
1
//this.gouzi_pingziTransform.alpha=0
})
}
})
createTween
(
this
,
this
.
pingziBackTransform
,
true
,{
loop
:
-
1
})
.
set
({
position
:
{
x
:
47.5
}})
.
to
({
position
:
{
x
:
-
152.5
}},
1000
)
...
...
@@ -90,14 +143,13 @@ export default class SceneStart extends ScillaComponent implements INavigatorVie
this
.
setCountText
(
text
);
}
onClick_startbtn
()
{
/* this.broadcast('callApi', 1, 'doJoin', {
activityId: window['CFG'].actId,
activityType: 'hdtool',
consumerId: window['CFG'].consumerId
}); */
grabState
=
false
;
hasPrize
=
false
;
if
(
window
[
'getDuibaToken'
])
{
onClick_startbtn
()
{
this
.
grabState
=
true
;
this
.
hasPrize
=
true
;
/* if (window['getDuibaToken']) {
window['getDuibaToken']((tokenObj: any) => {
this.broadcast('callApi', 1, 'doJoin', {
token:tokenObj.token,
...
...
@@ -114,7 +166,7 @@ export default class SceneStart extends ScillaComponent implements INavigatorVie
activityType: 'hdtool',
consumerId: window['CFG'].consumerId
});
}
}
*/
}
onGotDojoin
()
{
...
...
src/generated/MustCompile.ts
View file @
9d5f3970
...
...
@@ -14,17 +14,17 @@ registerDef('components/other/FullStageSize', component1);
import
component2
from
'components/renderer/TextureRenderer'
;
registerDef
(
'components/renderer/TextureRenderer'
,
component2
);
import
component3
from
'components/
animation/TouchZoom
'
;
registerDef
(
'components/
animation/TouchZoom
'
,
component3
);
import
component3
from
'components/
renderer/RectRenderer
'
;
registerDef
(
'components/
renderer/RectRenderer
'
,
component3
);
import
component4
from
'components/
ui/Button
'
;
registerDef
(
'components/
ui/Button
'
,
component4
);
import
component4
from
'components/
animation/TouchZoom
'
;
registerDef
(
'components/
animation/TouchZoom
'
,
component4
);
import
component5
from
'components/
renderer/TextRenderer
'
;
registerDef
(
'components/
renderer/TextRenderer
'
,
component5
);
import
component5
from
'components/
ui/Button
'
;
registerDef
(
'components/
ui/Button
'
,
component5
);
import
component6
from
'components/renderer/
Rec
tRenderer'
;
registerDef
(
'components/renderer/
Rec
tRenderer'
,
component6
);
import
component6
from
'components/renderer/
Tex
tRenderer'
;
registerDef
(
'components/renderer/
Tex
tRenderer'
,
component6
);
import
component7
from
'components/other/CameraController'
;
registerDef
(
'components/other/CameraController'
,
component7
);
...
...
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