Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
E
East_L228
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
template admin
East_L228
Commits
2c339eb6
Commit
2c339eb6
authored
May 14, 2020
by
李维
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dev done
parent
b3a0e8a9
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
65 additions
and
8 deletions
+65
-8
play.component.ts
src/app/play/play.component.ts
+59
-6
resources.js
src/app/play/resources.js
+6
-2
sm-click-start.mp3
src/assets/audio/sm-click-start.mp3
+0
-0
bg_1280_720.png
src/assets/default/images/bg_1280_720.png
+0
-0
button_start.png
src/assets/play/button_start.png
+0
-0
camera_highlight.png
src/assets/play/camera_highlight.png
+0
-0
No files found.
src/app/play/play.component.ts
View file @
2c339eb6
...
@@ -148,7 +148,7 @@ export class PlayComponent implements OnInit, OnDestroy {
...
@@ -148,7 +148,7 @@ export class PlayComponent implements OnInit, OnDestroy {
m_enableRunway
=
false
;
m_enableRunway
=
false
;
m_currentFocusCard
=
0
;
m_currentFocusCard
=
0
;
m_autoFocusID
=
null
;
m_autoFocusID
=
null
;
m_enableCamera
=
tru
e
;
m_enableCamera
=
fals
e
;
m_nextCardLock
=
false
;
m_nextCardLock
=
false
;
// ------------------------------------
// ------------------------------------
...
@@ -224,10 +224,7 @@ export class PlayComponent implements OnInit, OnDestroy {
...
@@ -224,10 +224,7 @@ export class PlayComponent implements OnInit, OnDestroy {
this
.
initCamera
();
this
.
initCamera
();
this
.
initCards
();
this
.
initCards
();
this
.
initShowCard
();
this
.
initShowCard
();
this
.
g_cartoon
.
playAudio
(
"
sm-run
"
,
false
,
null
,
true
,
(
audio
)
=>
{
this
.
initStartButton
()
audio
.
volume
=
0.3
})
this
.
autoRollRun
()
}
}
cleanGameVar
(){
cleanGameVar
(){
...
@@ -243,7 +240,8 @@ export class PlayComponent implements OnInit, OnDestroy {
...
@@ -243,7 +240,8 @@ export class PlayComponent implements OnInit, OnDestroy {
this
.
m_requestID
=
null
;
this
.
m_requestID
=
null
;
this
.
m_enableRunway
=
false
;
this
.
m_enableRunway
=
false
;
this
.
m_currentFocusCard
=
0
;
this
.
m_currentFocusCard
=
0
;
this
.
m_autoFocusID
=
null
this
.
m_autoFocusID
=
null
;
this
.
m_enableCamera
=
false
;
this
.
m_nextCardLock
=
false
;
this
.
m_nextCardLock
=
false
;
}
}
...
@@ -251,11 +249,48 @@ export class PlayComponent implements OnInit, OnDestroy {
...
@@ -251,11 +249,48 @@ export class PlayComponent implements OnInit, OnDestroy {
}
}
startGame
(){
this
.
m_enableCamera
=
true
;
this
.
autoRollRun
();
this
.
g_cartoon
.
playAudio
(
"
sm-run
"
,
false
,
null
,
true
,
(
audio
)
=>
{
audio
.
volume
=
0.3
})
}
initBackground
(){
initBackground
(){
let
element
=
this
.
g_cartoon
.
createCartoonElementImage
(
"
background-main
"
,
"
main-bg
"
,
this
.
g_canvasWidth
,
this
.
g_canvasHeight
,
this
.
g_canvasWidth
/
2
,
this
.
g_canvasHeight
/
2
);
let
element
=
this
.
g_cartoon
.
createCartoonElementImage
(
"
background-main
"
,
"
main-bg
"
,
this
.
g_canvasWidth
,
this
.
g_canvasHeight
,
this
.
g_canvasWidth
/
2
,
this
.
g_canvasHeight
/
2
);
this
.
render
(
element
.
ref
)
this
.
render
(
element
.
ref
)
}
}
initStartButton
(){
let
element
=
this
.
g_cartoon
.
createCartoonElementImage
(
"
start-button
"
,
"
button_start
"
,
434
,
92
,
this
.
g_canvasWidth
/
2
,
this
.
g_canvasHeight
/
2
,
true
);
let
element_black
=
this
.
g_cartoon
.
createCartoonElementImage
(
"
background-black-main
"
,
"
_bg_1280_720
"
,
this
.
g_canvasWidth
,
this
.
g_canvasHeight
,
this
.
g_canvasWidth
/
2
,
this
.
g_canvasHeight
/
2
);
element
.
out
=
(
callback
?)
=>
{
tweenChange
(
element
.
ref
,
{
x
:
this
.
g_canvasWidth
+
500
*
this
.
g_mapScale
},
0.3
,
()
=>
{
tweenChange
(
element_black
.
ref
,
{
alpha
:
0
},
0.1
,
()
=>
{
element
.
ref
.
visible
=
false
;
element_black
.
ref
.
visible
=
false
;
element_black
.
ref
.
x
=
this
.
g_canvasWidth
+
500
*
this
.
g_mapScale
callback
&&
callback
()
})
element
.
ref
.
visible
=
false
;
callback
&&
callback
()
})
}
this
.
subscribeMapDownEvent
(
element
.
id
,
()
=>
{
this
.
g_cartoon
.
playAudio
(
"
sm-click-start
"
)
element
.
out
(()
=>
{
this
.
startGame
();
this
.
g_enableMapDown
=
true
;
})
})
this
.
render
(
element
.
ref
,
999
)
this
.
render
(
element_black
.
ref
,
998
)
}
initRoll
(){
initRoll
(){
let
element
=
this
.
g_cartoon
.
createCartoonElementImageFunc
(
"
Camera-Roll
"
,
"
Image-02
"
,
(
w
,
h
)
=>
{
let
element
=
this
.
g_cartoon
.
createCartoonElementImageFunc
(
"
Camera-Roll
"
,
"
Image-02
"
,
(
w
,
h
)
=>
{
return
{
return
{
...
@@ -299,8 +334,25 @@ export class PlayComponent implements OnInit, OnDestroy {
...
@@ -299,8 +334,25 @@ export class PlayComponent implements OnInit, OnDestroy {
}
}
});
});
let
element_highlight
=
this
.
g_cartoon
.
createCartoonElementImage
(
"
Camera-highlight
"
,
"
camera_highlight
"
,
150
,
148
,
0
,
0
);
element_highlight
.
ref
.
alpha
=
0
;
element
.
hightlight
=
(
status
,
callback
?)
=>
{
if
(
status
){
tweenChange
(
element_highlight
.
ref
,
{
alpha
:
1
},
0.1
,
()
=>
{
callback
&&
callback
()
})
}
else
{
tweenChange
(
element_highlight
.
ref
,
{
alpha
:
0
},
0.1
,
()
=>
{
callback
&&
callback
()
})
}
}
element
.
ref
.
addChild
(
element_highlight
.
ref
)
this
.
subscribeMapDownEvent
(
element
.
id
,
()
=>
{
this
.
subscribeMapDownEvent
(
element
.
id
,
()
=>
{
if
(
this
.
m_enableCamera
){
if
(
this
.
m_enableCamera
){
element
.
hightlight
(
true
)
this
.
m_enableCamera
=
false
;
this
.
m_enableCamera
=
false
;
this
.
m_enableRunway
=
false
;
this
.
m_enableRunway
=
false
;
this
.
g_cartoon
.
stopAudio
(
"
sm-run
"
)
this
.
g_cartoon
.
stopAudio
(
"
sm-run
"
)
...
@@ -646,6 +698,7 @@ export class PlayComponent implements OnInit, OnDestroy {
...
@@ -646,6 +698,7 @@ export class PlayComponent implements OnInit, OnDestroy {
this
.
g_cartoon
.
stopAudio
(
element
.
audio_url
)
this
.
g_cartoon
.
stopAudio
(
element
.
audio_url
)
this
.
m_enableCamera
=
true
;
this
.
m_enableCamera
=
true
;
element
.
hide
(()
=>
{
element
.
hide
(()
=>
{
this
.
g_cartoon
.
getCartoonElement
(
"
Camera
"
).
hightlight
(
false
)
this
.
m_enableRunway
=
true
;
this
.
m_enableRunway
=
true
;
this
.
g_enableMapDown
=
true
this
.
g_enableMapDown
=
true
})
})
...
...
src/app/play/resources.js
View file @
2c339eb6
const
localImages
=
{
const
localImages
=
{
'
_bg_1280_720_Ruler
'
:
'
assets/default/images/1280_720_Ruler.png
'
,
'
_bg_1280_720_Ruler
'
:
'
assets/default/images/1280_720_Ruler.png
'
,
'
_bg_1280_720
'
:
'
assets/default/images/bg_1280_720.png
'
,
'
_scrap-pic-1
'
:
'
assets/default/images/scrap-pic-1.png
'
,
'
_scrap-pic-1
'
:
'
assets/default/images/scrap-pic-1.png
'
,
'
_scrap-pic-2
'
:
'
assets/default/images/scrap-pic-2.png
'
,
'
_scrap-pic-2
'
:
'
assets/default/images/scrap-pic-2.png
'
,
'
_scrap-pic-3
'
:
'
assets/default/images/scrap-pic-3.png
'
,
'
_scrap-pic-3
'
:
'
assets/default/images/scrap-pic-3.png
'
,
...
@@ -20,13 +21,16 @@ const localImages = {
...
@@ -20,13 +21,16 @@ const localImages = {
'
light-off
'
:
'
assets/play/light-off.png
'
,
'
light-off
'
:
'
assets/play/light-off.png
'
,
'
light-on
'
:
'
assets/play/light-on.png
'
,
'
light-on
'
:
'
assets/play/light-on.png
'
,
'
main-bg
'
:
'
assets/play/main-bg.png
'
,
'
main-bg
'
:
'
assets/play/main-bg.png
'
,
'
default_image
'
:
'
assets/play/default_image.png
'
'
default_image
'
:
'
assets/play/default_image.png
'
,
'
camera_highlight
'
:
'
assets/play/camera_highlight.png
'
,
'
button_start
'
:
'
assets/play/button_start.png
'
};
};
const
localAudios
=
{
const
localAudios
=
{
'
sm-camera
'
:
'
assets/audio/sm-camera.mp3
'
,
'
sm-camera
'
:
'
assets/audio/sm-camera.mp3
'
,
'
sm-run
'
:
'
assets/audio/sm-run.mp3
'
'
sm-run
'
:
'
assets/audio/sm-run.mp3
'
,
'
sm-click-start
'
:
'
assets/audio/sm-click-start.mp3
'
};
};
export
{
localImages
,
localAudios
};
export
{
localImages
,
localAudios
};
src/assets/audio/sm-click-start.mp3
0 → 100644
View file @
2c339eb6
File added
src/assets/default/images/bg_1280_720.png
0 → 100644
View file @
2c339eb6
7.84 KB
src/assets/play/button_start.png
0 → 100644
View file @
2c339eb6
39.4 KB
src/assets/play/camera_highlight.png
0 → 100644
View file @
2c339eb6
14.5 KB
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