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
8ce2c61f
Commit
8ce2c61f
authored
Jul 10, 2020
by
李维
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dev commit
parent
87225b41
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
90 additions
and
7 deletions
+90
-7
Cartoon.ts
src/app/play/Cartoon.ts
+4
-0
Unit.ts
src/app/play/Unit.ts
+4
-0
play.component.ts
src/app/play/play.component.ts
+82
-7
No files found.
src/app/play/Cartoon.ts
View file @
8ce2c61f
...
...
@@ -377,6 +377,10 @@ export class Cartoon {
element
.
scaleY
=
scale
.
sy
element
.
x
=
position
.
x
element
.
y
=
position
.
y
element
.
initScaleX
=
scale
.
sx
element
.
initScaleY
=
scale
.
sy
element
.
initX
=
position
.
x
element
.
initY
=
position
.
y
return
element
}
...
...
src/app/play/Unit.ts
View file @
8ce2c61f
...
...
@@ -46,6 +46,10 @@ export class MySprite extends Sprite {
childDepandVisible
=
true
;
childDepandAlpha
=
false
;
initScaleX
;
initScaleY
;
initX
;
initY
;
img
;
_z
=
0
;
...
...
src/app/play/play.component.ts
View file @
8ce2c61f
...
...
@@ -135,7 +135,8 @@ export class PlayComponent implements OnInit, OnDestroy {
// ------------ 游戏逻辑数据 ------------
m_startGame
=
false
;
m_allDrums
=
[]
m_allDrums
=
[];
m_dataArrayNew
=
[]
// ------------------------------------
...
...
@@ -223,8 +224,9 @@ export class PlayComponent implements OnInit, OnDestroy {
}
restartGame
(){
this
.
cleanGameVar
()
this
.
startGame
()
this
.
cleanGameVar
();
this
.
startGame
();
this
.
initDrum
();
}
endGame
(){
...
...
@@ -263,7 +265,7 @@ export class PlayComponent implements OnInit, OnDestroy {
})
this
.
render
(
bg_Desk
.
ref
,
zIndexMap
.
mainDesk
)
let
bg_Light
=
this
.
g_cartoon
.
createCartoonElementImageFunc
(
"
main-background-
desk
"
,
"
dengqiu1
"
,
(
w
,
h
)
=>
{
let
bg_Light
=
this
.
g_cartoon
.
createCartoonElementImageFunc
(
"
main-background-
light
"
,
"
dengqiu1
"
,
(
w
,
h
)
=>
{
return
{
sx
:
1032
*
this
.
g_mapScale
/
w
,
sy
:
317
*
this
.
g_mapScale
/
h
...
...
@@ -726,7 +728,8 @@ export class PlayComponent implements OnInit, OnDestroy {
this
.
g_canvasWidth
/
2
-
(
317
/
2
)
*
3
*
this
.
g_mapScale
]
this
.
g_formData
.
dataArray
.
forEach
((
item
,
index
)
=>
{
this
.
m_dataArrayNew
=
this
.
randomArray_shuffle
(
this
.
g_formData
.
dataArray
)
this
.
m_dataArrayNew
.
forEach
((
item
,
index
)
=>
{
let
element
=
this
.
createDrum
(
index
,
item
,
baseX
[
totalDrumNum
])
this
.
m_allDrums
.
push
(
element
.
id
)
this
.
render
(
element
.
ref
,
zIndexMap
.
drum
)
...
...
@@ -768,6 +771,61 @@ export class PlayComponent implements OnInit, OnDestroy {
element
.
handSide
=
"
right
"
}
element
.
content
=
null
;
if
(
data
.
type
==
"
Image
"
){
element
.
imageContainer
=
this
.
g_cartoon
.
createImage
(
"
card_bg
"
,
(
w
,
h
)
=>
{
return
{
sx
:
261
/
w
,
sy
:
178
/
h
}
},
(
w
,
h
)
=>
{
return
{
x
:
0
,
y
:
60
}
})
element
.
imageContainer
.
visible
=
false
;
element
.
imageContainer
.
setScaleXY
(
0
)
element
.
content
=
element
.
imageContainer
element
.
ref
.
addChild
(
element
.
imageContainer
)
element
.
image
=
this
.
g_cartoon
.
createImage
(
data
.
image_url
,
(
w
,
h
)
=>
{
let
sx
=
261
/
w
let
sy
=
178
/
w
let
s
=
Math
.
min
(
sx
,
sy
)
return
{
sx
:
s
,
sy
:
s
}
},
(
w
,
h
)
=>
{
return
{
x
:
0
,
y
:
0
}
})
element
.
imageContainer
.
addChild
(
element
.
image
)
}
else
{
element
.
textContainer
=
this
.
g_cartoon
.
createImage
(
"
card_bg
"
,
(
w
,
h
)
=>
{
return
{
sx
:
261
/
w
,
sy
:
178
/
h
}
},
(
w
,
h
)
=>
{
return
{
x
:
0
,
y
:
60
}
})
element
.
textContainer
.
visible
=
false
;
element
.
textContainer
.
setScaleXY
(
0
)
element
.
content
=
element
.
textContainer
element
.
ref
.
addChild
(
element
.
textContainer
)
element
.
text
=
this
.
g_cartoon
.
createLabel
(
data
.
text
,
"
GOTHICB_1
"
,
"
#FF0
"
,
32
)
element
.
textContainer
.
addChild
(
element
.
text
)
}
element
.
highlight
=
()
=>
{
this
.
m_setTimeoutIDs
.
push
(
setTimeout
(()
=>
{
this
.
g_cartoon
.
getCartoonElement
(
"
boy
"
).
beatReset
()
...
...
@@ -782,19 +840,22 @@ export class PlayComponent implements OnInit, OnDestroy {
element
.
isOpen
=
false
;
this
.
subscribeMapDownEvent
(
element
.
id
,
()
=>
{
if
(
!
this
.
m_startGame
){
if
(
!
this
.
m_startGame
||
element
.
isOpen
){
this
.
g_enableMapDown
=
true
;
return
}
this
.
setRenderZIndex
(
element
.
ref
,
zIndexMap
.
drum
+
1
)
tweenChange
(
element
.
ref
,
{
scaleX
:
element
.
initScaleX
*
1.2
,
scaleY
:
element
.
initScaleY
*
1.2
},
0.2
,
()
=>
{
if
(
element
.
content
){
element
.
content
.
visible
=
true
;
tweenChange
(
element
.
content
,
{
scaleX
:
element
.
content
.
initScaleX
,
scaleY
:
element
.
content
.
initScaleY
},
0.2
)
}
element
.
light
.
ref
.
visible
=
true
;
element
.
isOpen
=
true
;
this
.
g_cartoon
.
getCartoonElement
(
"
boy
"
).
beat
(
index
,
()
=>
{
element
.
highlight
()
})
})
})
return
element
...
...
@@ -1330,6 +1391,20 @@ export class PlayComponent implements OnInit, OnDestroy {
}
render
(
ele
,
zIndex
?:
number
){
// let exist = false;
// let index = 0
// this.m_renderObject.forEach((item, i) => {
// if(item.element.id == ele.id){
// console.warn("Exist in render array!")
// exist = true
// index = i
// }
// });
// if(exist){
// this.m_renderObject.splice(index, 1)
// }
this
.
m_renderObject
.
push
({
element
:
ele
,
zIndex
:
zIndex
?
zIndex
:
1
})
this
.
m_renderObject
.
sort
((
a
,
b
)
=>
{
return
a
.
zIndex
-
b
.
zIndex
...
...
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