Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
JM04-3
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
JM04-3
Commits
53952614
Commit
53952614
authored
Jul 27, 2021
by
李维
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dev commit
parent
ec9f638f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
28 deletions
+30
-28
play.component.ts
src/app/play/play.component.ts
+30
-28
bg_check_middle.png
src/assets/play/bg_check_middle.png
+0
-0
No files found.
src/app/play/play.component.ts
View file @
53952614
...
...
@@ -548,7 +548,6 @@ export class PlayComponent implements OnInit, OnDestroy {
}
})
let
bgInit
=
this
.
g_cartoon
.
createCartoonElementImageFunc
(
`block_
${
questionIndex
}
_
${
li
}
_container_init`
,
"
bg_block_init
"
,
(
w
,
h
)
=>
{
return
{
sx
:
80
/
w
,
...
...
@@ -631,7 +630,6 @@ export class PlayComponent implements OnInit, OnDestroy {
bgFocus
.
ref
.
alpha
=
0
;
bgWrong
.
ref
.
alpha
=
0
;
text
.
ref
.
fontColor
=
"
#b17d5a
"
;
// container.modified = false;
break
;
case
"
disable
"
:
bgInit
.
ref
.
alpha
=
0
;
...
...
@@ -640,7 +638,6 @@ export class PlayComponent implements OnInit, OnDestroy {
bgFocus
.
ref
.
alpha
=
0
;
bgWrong
.
ref
.
alpha
=
0
;
text
.
ref
.
fontColor
=
"
#b17d5a
"
;
container
.
modified
=
false
;
break
;
case
"
right
"
:
bgInit
.
ref
.
alpha
=
0
;
...
...
@@ -657,7 +654,6 @@ export class PlayComponent implements OnInit, OnDestroy {
bgFocus
.
ref
.
alpha
=
1
;
bgWrong
.
ref
.
alpha
=
0
;
text
.
ref
.
fontColor
=
"
#ffffff
"
;
container
.
modified
=
false
;
break
;
case
"
wrong
"
:
bgInit
.
ref
.
alpha
=
0
;
...
...
@@ -666,7 +662,6 @@ export class PlayComponent implements OnInit, OnDestroy {
bgFocus
.
ref
.
alpha
=
0
;
bgWrong
.
ref
.
alpha
=
1
;
text
.
ref
.
fontColor
=
"
#ffffff
"
;
container
.
modified
=
false
;
break
;
}
}
...
...
@@ -735,7 +730,7 @@ export class PlayComponent implements OnInit, OnDestroy {
container
.
checkWhenSwitchQuestion
=
(
withRed
,
fromIndex
,
groupIndex
,
contentSaved
?)
=>
{
// container.active(false);
if
(
groupIndex
!=
this
.
m_currentQuestionIndex
)
{
if
(
groupIndex
!=
this
.
m_currentQuestionIndex
)
{
if
(
container
.
getContentText
()
==
""
)
{
// container.switchStatus("init")
}
else
{
...
...
@@ -757,7 +752,7 @@ export class PlayComponent implements OnInit, OnDestroy {
container
.
active
(
true
)
}
}
else
{
if
(
container
.
isCorrect
)
{
if
(
container
.
isCorrect
||
container
.
modified
)
{
container
.
switchStatus
(
"
right
"
)
}
else
{
container
.
switchStatus
(
"
wrong
"
)
...
...
@@ -777,15 +772,16 @@ export class PlayComponent implements OnInit, OnDestroy {
return
}
if
(
this
.
m_currentQuestionIndex
!=
questionIndex
)
{
this
.
switchQuestion
(
this
.
m_currentQuestionIndex
,
questionIndex
)
}
if
(
container
.
canSetActive
())
{
if
(
this
.
m_currentInput
)
{
let
currentAcitveNode
=
this
.
g_cartoon
.
getCartoonElement
(
this
.
m_currentInput
)
currentAcitveNode
.
active
(
false
)
this
.
m_currentInputIndex
=
li
// this.switchQuestion(this.m_currentQuestionIndex, questionIndex)
}
else
{
if
(
container
.
canSetActive
())
{
if
(
this
.
m_currentInput
)
{
let
currentAcitveNode
=
this
.
g_cartoon
.
getCartoonElement
(
this
.
m_currentInput
)
currentAcitveNode
.
active
(
false
)
this
.
m_currentInputIndex
=
li
}
container
.
active
(
true
);
}
container
.
active
(
true
);
}
this
.
g_enableMapDown
=
true
;
})
...
...
@@ -853,12 +849,12 @@ export class PlayComponent implements OnInit, OnDestroy {
// }
// })
let
element
=
this
.
g_cartoon
.
createCartoonElementShapeRect
(
"
checkpannel_container
"
,
this
.
g_canvasWidth
/
2
,
this
.
g_canvasHeight
,
"
#FFF
"
)
element
.
ref
.
x
=
this
.
g_canvasWidth
+
1000
;
element
.
ref
.
y
=
0
;
element
.
ref
.
x
=
this
.
g_canvasWidth
/
2
;
element
.
ref
.
y
=
this
.
g_canvasHeight
+
100
0
;
element
.
ref
.
alpha
=
0
;
element
.
in
=
(
callback
)
=>
{
return
tweenChange
(
element
.
ref
,
{
x
:
this
.
g_canvasWidth
/
2
},
1
,
()
=>
{
return
tweenChange
(
element
.
ref
,
{
y
:
0
},
1
,
()
=>
{
callback
&&
callback
()
})
}
...
...
@@ -866,7 +862,7 @@ export class PlayComponent implements OnInit, OnDestroy {
// 背景 上:canvas高-中 中:985 下:canvas高-中-上
let
bgMiddle
=
this
.
g_cartoon
.
createCartoonElementImageFunc
(
`checkpannel_bg_middle`
,
"
bg_check_middle
"
,
(
w
,
h
)
=>
{
return
{
sx
:
this
.
g_canvasWidth
/
2
/
w
,
sx
:
1194
*
this
.
g_mapScale
/
w
,
sy
:
985
*
this
.
g_mapScale
/
h
,
}
},
(
w
,
h
)
=>
{
...
...
@@ -879,7 +875,7 @@ export class PlayComponent implements OnInit, OnDestroy {
let
bgTop
=
this
.
g_cartoon
.
createCartoonElementImageFunc
(
`checkpannel_bg_top`
,
"
bg_check_top
"
,
(
w
,
h
)
=>
{
return
{
sx
:
this
.
g_canvasWidth
/
2
/
w
,
sx
:
1194
*
this
.
g_mapScale
/
w
,
sy
:
(
this
.
g_canvasHeight
-
985
*
this
.
g_mapScale
)
/
2
/
h
,
}
},
(
w
,
h
)
=>
{
...
...
@@ -892,7 +888,7 @@ export class PlayComponent implements OnInit, OnDestroy {
let
bBottom
=
this
.
g_cartoon
.
createCartoonElementImageFunc
(
`checkpannel_bg_bottom`
,
"
bg_check_bottom
"
,
(
w
,
h
)
=>
{
return
{
sx
:
this
.
g_canvasWidth
/
2
/
w
,
sx
:
1194
*
this
.
g_mapScale
/
w
,
sy
:
(
this
.
g_canvasHeight
-
985
*
this
.
g_mapScale
)
/
2
/
h
,
}
},
(
w
,
h
)
=>
{
...
...
@@ -905,7 +901,7 @@ export class PlayComponent implements OnInit, OnDestroy {
let
bgMiddleMask
=
this
.
g_cartoon
.
createCartoonElementImageFunc
(
`checkpannel_bg_middle_mask`
,
"
bg_check_middle_mask
"
,
(
w
,
h
)
=>
{
return
{
sx
:
this
.
g_canvasWidth
/
2
/
w
,
sx
:
1194
*
this
.
g_mapScale
/
w
,
sy
:
985
*
this
.
g_mapScale
/
h
,
}
},
(
w
,
h
)
=>
{
...
...
@@ -966,7 +962,7 @@ export class PlayComponent implements OnInit, OnDestroy {
},
(
w
,
h
)
=>
{
return
{
x
:
0
,
y
:
20
0
y
:
18
0
}
})
...
...
@@ -986,7 +982,7 @@ export class PlayComponent implements OnInit, OnDestroy {
},
(
w
,
h
)
=>
{
return
{
x
:
0
,
y
:
250
+
8
0
y
:
180
+
5
0
}
})
...
...
@@ -1338,12 +1334,12 @@ export class PlayComponent implements OnInit, OnDestroy {
totalHeight
=
creatItem
(
totalHeight
,
!
(
index
==
(
totalNum
-
1
)),
element
)
});
this
.
m_totalScrollHeight
=
totalHeight
+
2
0
;
this
.
m_totalScrollHeight
=
totalHeight
+
10
0
;
sliderBG
.
initSlider
(
scrollContent
.
windowHeight
,
this
.
m_totalScrollHeight
,
0
)
let
scroll
=
this
.
g_cartoon
.
getCartoonElement
(
"
check_scroll_pannel
"
)
scroll
.
ref
.
setSize
(
880
,
this
.
m_totalScrollHeight
)
let
checkPannel
=
this
.
g_cartoon
.
getCartoonElement
(
"
checkpannel_container
"
);
checkPannel
.
in
()
return
checkPannel
.
in
()
}
initSubmit
()
{
...
...
@@ -1410,7 +1406,7 @@ export class PlayComponent implements OnInit, OnDestroy {
submit
.
out
=
(
callback
)
=>
{
btnSubmitShadow
.
ref
.
visible
=
false
;
return
tweenChange
(
submit
.
ref
,
{
y
:
this
.
g_canvasHeight
+
2
00
},
0.3
,
()
=>
{
return
tweenChange
(
submit
.
ref
,
{
x
:
this
.
g_canvasWidth
+
10
00
},
0.3
,
()
=>
{
callback
&&
callback
()
})
}
...
...
@@ -1446,6 +1442,12 @@ export class PlayComponent implements OnInit, OnDestroy {
console
.
log
(
"
全部正确
"
)
}
this
.
m_blockGroup
.
forEach
(
group
=>
{
group
.
forEach
(
block
=>
{
block
.
modified
=
false
;
});
});
if
(
this
.
m_submitedTimes
>=
2
||
(
this
.
m_submitedTimes
<
2
&&
!
hasIncorrect
))
{
let
qp
=
this
.
g_cartoon
.
getCartoonElement
(
"
question_container
"
)
let
keyboard
=
this
.
g_cartoon
.
getCartoonElement
(
"
keyboard_container
"
)
...
...
@@ -1454,7 +1456,7 @@ export class PlayComponent implements OnInit, OnDestroy {
await
keyboard
.
out
()
await
submitButton
.
out
()
await
this
.
showCheckPannel
(
result
)
this
.
g_cartoon
.
getCartoonElement
(
"
background_mask
"
).
ref
.
alpha
=
0
//
this.g_cartoon.getCartoonElement("background_mask").ref.alpha = 0
this
.
g_enableMapDown
=
true
;
this
.
endGame
();
}
...
...
src/assets/play/bg_check_middle.png
View replaced file @
ec9f638f
View file @
53952614
331 KB
|
W:
|
H:
8.53 KB
|
W:
|
H:
2-up
Swipe
Onion skin
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