Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
E
East_L226
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_L226
Commits
d8d2dc15
Commit
d8d2dc15
authored
Jul 13, 2020
by
李维
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dev commit
parent
3b8ffabe
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
58 additions
and
40 deletions
+58
-40
form.component.html
src/app/form/form.component.html
+1
-1
form.component.ts
src/app/form/form.component.ts
+1
-0
play.component.ts
src/app/play/play.component.ts
+56
-39
No files found.
src/app/form/form.component.html
View file @
d8d2dc15
...
...
@@ -4,7 +4,7 @@
<div
class=
"card-item-content border"
>
<div
class=
"card-item-content"
>
<div
class=
"title"
>
糖果
-
<strong>
{{ i + 1 }}
</strong>
-
卡片
-
<strong>
{{ i + 1 }}
</strong>
-
</div>
<div
class=
"section"
>
<div
class=
"section-content"
>
...
...
src/app/form/form.component.ts
View file @
d8d2dc15
...
...
@@ -46,6 +46,7 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
}
this
.
init
();
this
.
refresh
();
this
.
save
()
},
this
.
KEY
);
}
ngOnChanges
()
{
...
...
src/app/play/play.component.ts
View file @
d8d2dc15
...
...
@@ -131,7 +131,8 @@ export class PlayComponent implements OnInit, OnDestroy {
// ------------ 游戏逻辑数据 ------------
m_startGame
=
false
;
m_allDrums
=
[];
m_dataArrayNew
=
[]
m_dataArrayNew
=
[];
m_restartGameFlag
:
boolean
=
false
;
// ------------------------------------
...
...
@@ -181,7 +182,7 @@ export class PlayComponent implements OnInit, OnDestroy {
let
array
=
[]
this
.
g_formData
.
dataArray
.
forEach
(
element
=>
{
if
(
element
.
image
_url
){
if
(
element
.
audio
_url
){
array
.
push
(
element
.
audio_url
)
}
});
...
...
@@ -226,7 +227,7 @@ export class PlayComponent implements OnInit, OnDestroy {
}
endGame
(){
this
.
showEndPatal
()
this
.
showEndPatal
(
3000
)
this
.
g_enableMapDown
=
false
;
this
.
g_cartoon
.
getCartoonElement
(
"
restart-button
"
).
in
()
}
...
...
@@ -506,9 +507,9 @@ export class PlayComponent implements OnInit, OnDestroy {
}
element
.
backToReady
=
()
=>
{
element
.
ref
.
x
=
standPos
[
this
.
g_formData
.
dataArray
.
length
][
0
].
x
element
.
currentPosition
=
0
;
element
.
updateHandPos
();
//
element.ref.x = standPos[this.g_formData.dataArray.length][0].x
//
element.currentPosition = 0;
//
element.updateHandPos();
}
element
.
beatReset
=
(
callback
)
=>
{
...
...
@@ -542,10 +543,10 @@ export class PlayComponent implements OnInit, OnDestroy {
y
:
this
.
g_canvasHeight
/
2
}
})
A
.
open
=
()
=>
{
A
.
open
=
(
time
=
7
)
=>
{
this
.
m_setTimeoutIDs
.
push
(
setTimeout
(()
=>
{
tweenChange
(
A
.
ref
,
{
x
:
(
-
357
/
2
+
100
)
*
this
.
g_mapScale
},
3
)
},
30
00
))
tweenChange
(
A
.
ref
,
{
x
:
(
-
357
/
2
+
100
)
*
this
.
g_mapScale
},
time
/
2
)
},
time
*
5
00
))
}
A
.
close
=
()
=>
{
...
...
@@ -565,10 +566,10 @@ export class PlayComponent implements OnInit, OnDestroy {
y
:
this
.
g_canvasHeight
/
2
}
})
B
.
open
=
()
=>
{
B
.
open
=
(
time
=
7
)
=>
{
this
.
m_setTimeoutIDs
.
push
(
setTimeout
(()
=>
{
tweenChange
(
B
.
ref
,
{
x
:
this
.
g_canvasWidth
+
(
357
/
2
-
100
)
*
this
.
g_mapScale
},
3
)
},
30
00
))
tweenChange
(
B
.
ref
,
{
x
:
this
.
g_canvasWidth
+
(
357
/
2
-
100
)
*
this
.
g_mapScale
},
time
/
2
)
},
time
*
5
00
))
}
B
.
close
=
()
=>
{
this
.
m_setTimeoutIDs
.
push
(
setTimeout
(()
=>
{
...
...
@@ -587,11 +588,11 @@ export class PlayComponent implements OnInit, OnDestroy {
y
:
this
.
g_canvasHeight
/
2
}
})
C
.
open
=
()
=>
{
tweenChange
(
C
.
ref
,
{
x
:
-
this
.
g_canvasWidth
/
4
},
7
)
C
.
open
=
(
time
=
7
)
=>
{
tweenChange
(
C
.
ref
,
{
x
:
-
this
.
g_canvasWidth
/
4
},
time
)
}
C
.
close
=
()
=>
{
tweenChange
(
C
.
ref
,
{
x
:
C
.
initX
},
4
)
C
.
close
=
(
time
=
4
)
=>
{
tweenChange
(
C
.
ref
,
{
x
:
C
.
initX
},
time
)
}
let
D
=
this
.
g_cartoon
.
createCartoonElementImageFunc
(
"
Curtain-D
"
,
"
lianzi3
"
,
(
w
,
h
)
=>
{
...
...
@@ -605,11 +606,11 @@ export class PlayComponent implements OnInit, OnDestroy {
y
:
this
.
g_canvasHeight
/
2
}
})
D
.
open
=
()
=>
{
tweenChange
(
D
.
ref
,
{
x
:
this
.
g_canvasWidth
+
this
.
g_canvasWidth
/
4
},
7
)
D
.
open
=
(
time
=
7
)
=>
{
tweenChange
(
D
.
ref
,
{
x
:
this
.
g_canvasWidth
+
this
.
g_canvasWidth
/
4
},
time
)
}
D
.
close
=
()
=>
{
tweenChange
(
D
.
ref
,
{
x
:
D
.
initX
},
4
)
D
.
close
=
(
time
=
4
)
=>
{
tweenChange
(
D
.
ref
,
{
x
:
D
.
initX
},
time
)
}
let
E
=
this
.
g_cartoon
.
createCartoonElementImageFunc
(
"
Curtain-E
"
,
"
lianzi0
"
,
(
w
,
h
)
=>
{
...
...
@@ -639,17 +640,18 @@ export class PlayComponent implements OnInit, OnDestroy {
this
.
g_cartoon
.
playAudio
(
"
gusheng_kaitou
"
)
},
2000
))
if
(
status
){
let
openTime
=
this
.
m_restartGameFlag
?
3
:
7
all
.
forEach
(
item
=>
{
_this
.
g_cartoon
.
getCartoonElement
(
item
).
open
()
_this
.
g_cartoon
.
getCartoonElement
(
item
).
open
(
openTime
)
})
this
.
m_setTimeoutIDs
.
push
(
setTimeout
(()
=>
{
this
.
m_allDrums
.
forEach
(
function
(
item
,
index
){
_this
.
g_cartoon
.
getCartoonElement
(
item
).
show
(
index
)
})
},
40
00
))
},
openTime
*
5
00
))
this
.
m_setTimeoutIDs
.
push
(
setTimeout
(()
=>
{
callback
&&
callback
()
},
7
000
))
},
openTime
*
1
000
))
}
else
{
all
.
forEach
(
item
=>
{
_this
.
g_cartoon
.
getCartoonElement
(
item
).
close
()
...
...
@@ -723,6 +725,7 @@ export class PlayComponent implements OnInit, OnDestroy {
this
.
m_setTimeoutIDs
.
push
(
setTimeout
(()
=>
{
this
.
g_cartoon
.
playAudio
(
"
guzhang
"
)
},
1000
))
this
.
m_restartGameFlag
=
true
;
this
.
curtainContral
(
false
,
()
=>
{
this
.
g_cartoon
.
getCartoonElement
(
"
boy
"
).
reset
()
this
.
g_cartoon
.
getCartoonElement
(
"
boy
"
).
startReadyAni
()
...
...
@@ -816,8 +819,8 @@ export class PlayComponent implements OnInit, OnDestroy {
element
.
content
=
element
.
imageContainer
element
.
image
=
this
.
g_cartoon
.
createImage
(
contentData
.
image_url
,
(
w
,
h
)
=>
{
let
sx
=
261
/
w
let
sy
=
178
/
w
let
sx
=
261
*
0.85
/
w
let
sy
=
178
*
0.85
/
h
let
s
=
Math
.
min
(
sx
,
sy
)
return
{
sx
:
s
,
...
...
@@ -871,26 +874,37 @@ export class PlayComponent implements OnInit, OnDestroy {
this
.
g_cartoon
.
getCartoonElement
(
"
boy
"
).
backToReady
()
this
.
g_enableMapDown
=
true
;
})
},
20
00
))
},
5
00
))
}
element
.
isOpen
=
false
;
this
.
subscribeMapDownEvent
(
element
.
id
,
()
=>
{
if
(
!
this
.
m_startGame
||
element
.
isOpen
){
if
(
element
.
isOpen
){
if
(
data
.
audio_url
){
this
.
g_cartoon
.
playAudio
(
data
.
audio_url
)
}
this
.
g_cartoon
.
stopAllAudio
();
this
.
g_cartoon
.
playAudio
(
`gusheng_
${
index
+
1
}
`
,
false
,
()
=>
{
if
(
data
.
audio_url
){
this
.
g_cartoon
.
playAudio
(
data
.
audio_url
)
}
})
this
.
g_cartoon
.
getCartoonElement
(
"
boy
"
).
beat
(
index
,
()
=>
{
this
.
g_cartoon
.
getCartoonElement
(
"
boy
"
).
beatReset
()
this
.
g_enableMapDown
=
true
;
})
}
else
{
this
.
g_enableMapDown
=
true
;
}
this
.
g_enableMapDown
=
true
;
return
}
this
.
g_cartoon
.
playAudio
(
`gusheng_
${
index
+
1
}
`
)
this
.
setRenderZIndex
(
element
.
ref
,
zIndexMap
.
drum
+
1
)
tweenChange
(
element
.
ref
,
{
scaleX
:
element
.
initScaleX
*
1.1
,
scaleY
:
element
.
initScaleY
*
1.1
},
0.2
,
()
=>
{
this
.
g_cartoon
.
stopAllAudio
();
this
.
g_cartoon
.
playAudio
(
`gusheng_
${
index
+
1
}
`
,
false
,
()
=>
{
if
(
data
.
audio_url
){
this
.
g_cartoon
.
playAudio
(
data
.
audio_url
)
}
})
this
.
setRenderZIndex
(
element
.
ref
,
zIndexMap
.
drum
+
1
)
tweenChange
(
element
.
ref
,
{
scaleX
:
element
.
initScaleX
*
1.1
,
scaleY
:
element
.
initScaleY
*
1.1
},
0.2
,
()
=>
{
if
(
element
.
content
){
element
.
content
.
visible
=
true
;
tweenChange
(
element
.
content
,
{
scaleX
:
element
.
content
.
initScaleX
,
scaleY
:
element
.
content
.
initScaleY
},
0.2
)
...
...
@@ -1895,10 +1909,10 @@ export class PlayComponent implements OnInit, OnDestroy {
// 结束动画花瓣飘落
showEndPatal
()
{
showEndPatal
(
totalTimes
?
)
{
this
.
m_endPageArr
=
[];
this
.
m_showPetalFlag
=
true
;
this
.
addPetal
();
this
.
addPetal
(
totalTimes
);
}
stopEndPatal
()
{
...
...
@@ -1906,7 +1920,7 @@ export class PlayComponent implements OnInit, OnDestroy {
this
.
m_showPetalFlag
=
false
;
}
addPetal
()
{
addPetal
(
totalTimes
?
)
{
if
(
!
this
.
m_showPetalFlag
)
{
return
;
}
...
...
@@ -1922,9 +1936,12 @@ export class PlayComponent implements OnInit, OnDestroy {
}
);
rotateItem
(
petal
,
petal
[
"
tr
"
],
petal
[
"
time
"
]);
setTimeout
(()
=>
{
this
.
addPetal
();
},
100
);
totalTimes
-=
100
if
(
totalTimes
>=
0
){
setTimeout
(()
=>
{
this
.
addPetal
(
totalTimes
);
},
100
);
}
}
getPetal
()
{
...
...
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