Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
LST08
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
LST08
Commits
db5b9dd7
Commit
db5b9dd7
authored
Nov 18, 2020
by
李维
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug fix
parent
1d40b197
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
39 additions
and
16 deletions
+39
-16
form.component.html
src/app/form/form.component.html
+1
-1
play.component.ts
src/app/play/play.component.ts
+38
-15
No files found.
src/app/form/form.component.html
View file @
db5b9dd7
...
...
@@ -133,7 +133,7 @@
<div
class=
"section-title"
>
错误选项
<div
style=
"text-align: center; float: right;"
>
<button
nz-button
nzType=
"primary"
(
click
)="
addChoice
(
item
.
incorrect
)"
>
<button
nz-button
nzType=
"primary"
(
click
)="
addChoice
(
item
.
incorrect
)"
[
disabled
]="
item
.
correct
.
length
>
=4"
>
<i
nz-icon
nzType=
"plus-circle"
nzTheme=
"outline"
></i>
添加
</button>
...
...
src/app/play/play.component.ts
View file @
db5b9dd7
...
...
@@ -526,7 +526,7 @@ export class PlayComponent implements OnInit, OnDestroy {
if
(
index
==
1
){
newId
=
"
score-ball-right-
"
}
for
(
let
i
=
0
;
i
<
6
;
i
++
){
for
(
let
i
=
0
;
i
<
this
.
g_formData
.
dataArray
.
length
;
i
++
){
let
scoreBall
=
this
.
g_cartoon
.
createCartoonElementImageFunc
(
newId
+
i
,
"
bg_star
"
,
(
w
,
h
)
=>
{
return
{
sx
:
68
/
w
,
...
...
@@ -649,11 +649,11 @@ export class PlayComponent implements OnInit, OnDestroy {
let
x
=
0
if
(
side
==
"
right
"
){
do
{
x
=
this
.
g_canvasWidth
/
2
+
(
Math
.
ceil
(
Math
.
random
()
*
400
)
+
8
0
)
*
this
.
g_mapScale
x
=
this
.
g_canvasWidth
/
2
+
(
Math
.
ceil
(
Math
.
random
()
*
400
)
+
15
0
)
*
this
.
g_mapScale
}
while
(
this
.
m_lastBubbleX
[
side
]
!=
-
1
&&
x
<=
(
this
.
m_lastBubbleX
[
side
]
+
width
)
&&
x
>=
(
this
.
m_lastBubbleX
[
side
]
-
width
))
}
else
{
do
{
x
=
150
*
this
.
g_mapScale
+
Math
.
ceil
(
Math
.
random
()
*
40
0
)
*
this
.
g_mapScale
x
=
150
*
this
.
g_mapScale
+
Math
.
ceil
(
Math
.
random
()
*
35
0
)
*
this
.
g_mapScale
}
while
(
this
.
m_lastBubbleX
[
side
]
!=
-
1
&&
x
<=
(
this
.
m_lastBubbleX
[
side
]
+
width
)
&&
x
>=
(
this
.
m_lastBubbleX
[
side
]
-
width
))
}
this
.
m_lastBubbleX
[
side
]
=
x
...
...
@@ -679,9 +679,10 @@ export class PlayComponent implements OnInit, OnDestroy {
this
.
m_allAnswerBubble
[
side
].
push
(
container
.
id
)
if
(
data
.
type
==
"
Image
"
){
container
.
isImage
=
true
;
let
image
=
this
.
g_cartoon
.
createImage
(
data
.
image_url
,
(
w
,
h
)
=>
{
let
sx
=
1
38
*
0.7
/
w
let
sy
=
1
38
*
0.7
/
h
let
sx
=
1
20
/
w
let
sy
=
1
20
/
h
let
s
=
Math
.
min
(
sx
,
sy
)
return
{
sx
:
s
,
...
...
@@ -694,23 +695,40 @@ export class PlayComponent implements OnInit, OnDestroy {
}
})
container
.
ref
.
addChild
(
image
)
container
.
content
=
image
}
else
{
let
text
=
this
.
g_cartoon
.
createLabel
(
data
.
text
,
"
BerlinSansFBDemi-Bold
"
,
"
#FFFFFF
"
,
24
);
container
.
isImage
=
false
;
let
text
=
this
.
g_cartoon
.
createLabel
(
data
.
text
,
"
MMTextBook-Bold
"
,
"
#00528c
"
,
40
);
container
.
ref
.
addChild
(
text
)
container
.
content
=
text
}
container
.
ball_highlight
=
this
.
g_cartoon
.
createImage
(
"
ball_highlight
"
,
(
w
,
h
)
=>
{
return
{
sx
:
164
*
1.1
/
w
,
sy
:
152
*
1.1
/
h
sx
:
164
/
w
,
sy
:
152
/
h
}
},
(
w
,
h
)
=>
{
return
{
x
:
-
2
,
x
:
-
5
,
y
:
-
5
}
})
container
.
ref
.
addChild
(
container
.
ball_highlight
)
let
redOutline
=
new
ShapeRect
();
redOutline
.
fillColor
=
"
#ff5252
"
redOutline
.
setSize
(
container
.
content
.
width
*
container
.
content
.
scaleX
+
10
,
container
.
content
.
height
*
container
.
content
.
scaleY
+
10
);
redOutline
.
x
=
-
container
.
content
.
width
*
container
.
content
.
scaleX
/
2
redOutline
.
y
=
-
container
.
content
.
height
*
container
.
content
.
scaleY
/
2
if
(
container
.
isImage
)
{
redOutline
.
alpha
=
1
;
}
else
{
redOutline
.
alpha
=
0
;
}
container
.
ball_highlight
.
addChild
(
redOutline
)
container
.
ball_highlight
.
alpha
=
0
container
.
ref
.
addChild
(
container
.
ball_highlight
,
-
1
)
container
.
ball_highlight
.
visible
=
false
;
container
.
ballYeah
=
this
.
g_cartoon
.
createImage
(
"
bg_graet
"
,
(
w
,
h
)
=>
{
...
...
@@ -777,7 +795,10 @@ export class PlayComponent implements OnInit, OnDestroy {
this
.
g_cartoon
.
playAudio
(
"
cuowu
"
)
container
.
ball_highlight
.
visible
=
true
;
this
.
showShakeAnimation
(
container
.
id
,
()
=>
{
container
.
ball_highlight
.
visible
=
false
;
if
(
!
container
.
isImage
)
{
container
.
content
.
fontColor
=
"
#ff5252
"
}
// container.ball_highlight.visible = false;
callback
&&
callback
()
})
}
...
...
@@ -793,12 +814,12 @@ export class PlayComponent implements OnInit, OnDestroy {
if
(
side
==
"
right
"
){
let
time
=
0
;
do
{
x
=
this
.
g_canvasWidth
/
2
+
(
Math
.
ceil
(
Math
.
random
()
*
400
)
+
8
0
)
*
this
.
g_mapScale
x
=
this
.
g_canvasWidth
/
2
+
(
Math
.
ceil
(
Math
.
random
()
*
400
)
+
15
0
)
*
this
.
g_mapScale
}
while
(
x
<=
(
this
.
m_lastBubbleX
[
side
]
+
width
)
&&
x
>=
(
this
.
m_lastBubbleX
[
side
]
-
width
))
}
else
{
let
time
=
0
;
do
{
x
=
150
*
this
.
g_mapScale
+
Math
.
ceil
(
Math
.
random
()
*
40
0
)
*
this
.
g_mapScale
x
=
150
*
this
.
g_mapScale
+
Math
.
ceil
(
Math
.
random
()
*
35
0
)
*
this
.
g_mapScale
}
while
(
x
<=
(
this
.
m_lastBubbleX
[
side
]
+
width
)
&&
x
>=
(
this
.
m_lastBubbleX
[
side
]
-
width
))
}
this
.
m_lastBubbleX
[
side
]
=
x
...
...
@@ -825,8 +846,9 @@ export class PlayComponent implements OnInit, OnDestroy {
this
.
g_enableMapDown
=
true
;
return
}
container
.
tween
.
stop
()
if
(
container
.
index
==
this
.
m_currentQuestionIndex
){
container
.
tween
.
stop
()
this
.
m_scoreLine
[
side
]
--
if
(
this
.
m_scoreLine
[
side
]
==
0
){
this
.
m_score
[
side
]
++
...
...
@@ -847,9 +869,10 @@ export class PlayComponent implements OnInit, OnDestroy {
})
}
}
else
{
container
.
tween
.
pause
()
container
.
inCorrect
(()
=>
{
this
.
g_enableMapDown
=
true
;
container
.
tween
.
start
()
container
.
tween
.
resume
()
})
}
return
true
;
...
...
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