Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
JM_4-1
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
JM_4-1
Commits
ef65364d
Commit
ef65364d
authored
Aug 03, 2021
by
limingzhe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 修复走查bug
parent
de1fdac1
Changes
10
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
58 additions
and
29 deletions
+58
-29
Unit.ts
src/app/play/Unit.ts
+3
-6
Util.js
src/app/play/Util.js
+1
-3
play.component.css
src/app/play/play.component.css
+5
-0
play.component.html
src/app/play/play.component.html
+1
-0
play.component.ts
src/app/play/play.component.ts
+45
-19
resources.js
src/app/play/resources.js
+3
-1
click.mp3
src/assets/play/music/click.mp3
+0
-0
more.mp3
src/assets/play/music/more.mp3
+0
-0
open.mp3
src/assets/play/music/open.mp3
+0
-0
submit.mp3
src/assets/play/music/submit.mp3
+0
-0
No files found.
src/app/play/Unit.ts
View file @
ef65364d
...
@@ -1857,12 +1857,9 @@ export function showShapeParticle(shapeType, shapeW, shapeH, pos, parent, num =
...
@@ -1857,12 +1857,9 @@ export function showShapeParticle(shapeType, shapeW, shapeH, pos, parent, num =
const
randomColorArr
=
[
const
randomColorArr
=
[
'
#ff0000
'
,
'
#6996af
'
,
'
#00ff00
'
,
'
#4da940
'
,
'
#0000ff
'
,
'
#911b40
'
,
'
#00ffff
'
,
'
#ff00ff
'
,
'
#ffff00
'
,
]
]
for
(
let
i
=
0
;
i
<
num
;
i
++
)
{
for
(
let
i
=
0
;
i
<
num
;
i
++
)
{
...
...
src/app/play/Util.js
View file @
ef65364d
...
@@ -14,7 +14,7 @@ export async function loadFonts (fontName, fontFile) {
...
@@ -14,7 +14,7 @@ export async function loadFonts (fontName, fontFile) {
console
.
log
(
location
.
href
.
split
(
"
#
"
)[
0
]
+
"
assets/play/font/
"
+
fontFile
);
console
.
log
(
location
.
href
.
split
(
"
#
"
)[
0
]
+
"
assets/play/font/
"
+
fontFile
);
const
font
=
new
FontFace
(
const
font
=
new
FontFace
(
fontName
,
fontName
,
"
url(
"
+
location
.
href
.
split
(
"
#
"
)[
0
]
+
"
assets/play/font/
"
+
fontFile
+
"
)
"
"
url(
"
+
location
.
href
.
split
(
"
#
"
)[
0
]
+
"
../../
assets/play/font/
"
+
fontFile
+
"
)
"
);
);
console
.
log
(
'
start:
'
,
new
Date
().
getTime
())
console
.
log
(
'
start:
'
,
new
Date
().
getTime
())
...
@@ -23,8 +23,6 @@ export async function loadFonts (fontName, fontFile) {
...
@@ -23,8 +23,6 @@ export async function loadFonts (fontName, fontFile) {
document
.
fonts
.
add
(
font
);
document
.
fonts
.
add
(
font
);
document
.
body
.
classList
.
add
(
"
fonts-loaded
"
);
document
.
body
.
classList
.
add
(
"
fonts-loaded
"
);
}
catch
(
error
)
{
}
catch
(
error
)
{
console
.
log
(
error
);
console
.
log
(
error
);
}
}
...
...
src/app/play/play.component.css
View file @
ef65364d
...
@@ -23,6 +23,11 @@
...
@@ -23,6 +23,11 @@
src
:
url("../../assets/play/font/Aileron-Black.ttf")
src
:
url("../../assets/play/font/Aileron-Black.ttf")
}
}
@font-face
{
font-family
:
'Aileron-Bold'
;
src
:
url("../../assets/play/font/Aileron-Bold.ttf")
}
...
...
src/app/play/play.component.html
View file @
ef65364d
<span
style=
"font-family:'DroidSansFallback'"
></span>
<span
style=
"font-family:'DroidSansFallback'"
></span>
<span
style=
"font-family:'Aileron-Black'"
></span>
<span
style=
"font-family:'Aileron-Black'"
></span>
<span
style=
"font-family:'Aileron-Bold'"
></span>
<div
class=
"game-container"
#
wrap
>
<div
class=
"game-container"
#
wrap
>
<canvas
id=
"canvas"
style=
"width: 100%; height: 100%;"
#
canvas
></canvas>
<canvas
id=
"canvas"
style=
"width: 100%; height: 100%;"
#
canvas
></canvas>
...
...
src/app/play/play.component.ts
View file @
ef65364d
...
@@ -372,7 +372,9 @@ export class PlayComponent implements OnInit, OnDestroy {
...
@@ -372,7 +372,9 @@ export class PlayComponent implements OnInit, OnDestroy {
};
};
addOneAudio
(
'
open
'
,
this
.
rawAudios
.
get
(
'
open
'
),
0.5
);
addOneAudio
(
'
click
'
,
this
.
rawAudios
.
get
(
'
click
'
),
0.8
);
addOneAudio
(
'
more
'
,
this
.
rawAudios
.
get
(
'
more
'
),
0.8
);
addOneAudio
(
'
submit
'
,
this
.
rawAudios
.
get
(
'
submit
'
),
0.8
);
// addOneAudio('cow_start', this.rawAudios.get('cow_start'), 1);
// addOneAudio('cow_start', this.rawAudios.get('cow_start'), 1);
// addOneAudio('eat', this.rawAudios.get('eat'), 1);
// addOneAudio('eat', this.rawAudios.get('eat'), 1);
...
@@ -446,10 +448,10 @@ export class PlayComponent implements OnInit, OnDestroy {
...
@@ -446,10 +448,10 @@ export class PlayComponent implements OnInit, OnDestroy {
console
.
log
(
'
aaaaaa
'
);
console
.
log
(
'
aaaaaa
'
);
loadFonts
(
'
DroidSansFallback
'
,
'
DroidSansFallback.ttf
'
).
then
(()
=>
{
loadFonts
(
'
DroidSansFallback
'
,
'
DroidSansFallback.ttf
'
).
then
(
()
=>
{
console
.
log
(
'
bbbbb
'
);
console
.
log
(
'
bbbbb
'
);
loadFonts
(
'
Aileron-Black
'
,
'
Aileron-Black.ttf
'
).
then
(
()
=>
{
loadFonts
(
'
Aileron-Black
'
,
'
Aileron-Black.ttf
'
).
then
(
()
=>
{
console
.
log
(
'
cccc
'
);
console
.
log
(
'
cccc
'
);
this
.
addServerListener
();
this
.
addServerListener
();
window
[
'
air
'
].
hideAirClassLoading
(
this
.
KEY
,
this
.
data
);
window
[
'
air
'
].
hideAirClassLoading
(
this
.
KEY
,
this
.
data
);
...
@@ -1008,6 +1010,17 @@ export class PlayComponent implements OnInit, OnDestroy {
...
@@ -1008,6 +1010,17 @@ export class PlayComponent implements OnInit, OnDestroy {
}
}
getFillLabel
()
{
const
label
=
new
Label
();
label
.
fontSize
=
56
;
label
.
fontColor
=
'
#000000
'
label
.
fontName
=
'
Aileron-Bold
'
;
label
.
setScaleXY
(
this
.
mapScale
);
return
label
;
}
getSentenceLabel
()
{
getSentenceLabel
()
{
const
richText
=
new
RichText
();
const
richText
=
new
RichText
();
...
@@ -1240,7 +1253,7 @@ export class PlayComponent implements OnInit, OnDestroy {
...
@@ -1240,7 +1253,7 @@ export class PlayComponent implements OnInit, OnDestroy {
const
title
=
new
Label
();
const
title
=
new
Label
();
title
.
fontSize
=
72
;
title
.
fontSize
=
72
;
title
.
fontName
=
'
Aileron-B
lack
'
;
title
.
fontName
=
'
Aileron-B
old
'
;
title
.
textAlign
=
'
center
'
;
title
.
textAlign
=
'
center
'
;
// title.setMaxSize(this.canvasWidth * 0.9);
// title.setMaxSize(this.canvasWidth * 0.9);
// title.x = this.canvasWidth / 2;
// title.x = this.canvasWidth / 2;
...
@@ -1278,6 +1291,8 @@ export class PlayComponent implements OnInit, OnDestroy {
...
@@ -1278,6 +1291,8 @@ export class PlayComponent implements OnInit, OnDestroy {
if
(
this
.
checkClickTarget
(
this
.
sentBtn
))
{
if
(
this
.
checkClickTarget
(
this
.
sentBtn
))
{
this
.
sendServerEvent
(
'
game_start
'
,
{});
this
.
sendServerEvent
(
'
game_start
'
,
{});
this
.
setPageData
(
'
progress
'
,
'
1
'
);
this
.
setPageData
(
'
progress
'
,
'
1
'
);
this
.
playAudio
(
'
submit
'
,
true
);
}
}
}
}
...
@@ -1287,6 +1302,8 @@ export class PlayComponent implements OnInit, OnDestroy {
...
@@ -1287,6 +1302,8 @@ export class PlayComponent implements OnInit, OnDestroy {
if
(
this
.
moreBtn
)
{
if
(
this
.
moreBtn
)
{
if
(
this
.
checkClickTarget
(
this
.
moreBtn
))
{
if
(
this
.
checkClickTarget
(
this
.
moreBtn
))
{
this
.
moreBtnClick
();
this
.
moreBtnClick
();
this
.
playAudio
(
'
more
'
,
true
);
return
;
return
;
}
}
}
}
...
@@ -1297,6 +1314,7 @@ export class PlayComponent implements OnInit, OnDestroy {
...
@@ -1297,6 +1314,7 @@ export class PlayComponent implements OnInit, OnDestroy {
if
(
this
.
btnArr
[
i
].
visible
&&
this
.
checkClickTarget
(
this
.
btnArr
[
i
]))
{
if
(
this
.
btnArr
[
i
].
visible
&&
this
.
checkClickTarget
(
this
.
btnArr
[
i
]))
{
if
(
!
this
.
btnArr
[
i
].
isOff
)
{
if
(
!
this
.
btnArr
[
i
].
isOff
)
{
this
.
btnDown
(
this
.
btnArr
[
i
]);
this
.
btnDown
(
this
.
btnArr
[
i
]);
}
}
return
;
return
;
}
}
...
@@ -1306,6 +1324,7 @@ export class PlayComponent implements OnInit, OnDestroy {
...
@@ -1306,6 +1324,7 @@ export class PlayComponent implements OnInit, OnDestroy {
if
(
this
.
checkClickTarget
(
this
.
sentenceEmptyArr
[
i
]))
{
if
(
this
.
checkClickTarget
(
this
.
sentenceEmptyArr
[
i
]))
{
if
(
!
this
.
sentenceEmptyArr
[
i
].
isRight
)
{
if
(
!
this
.
sentenceEmptyArr
[
i
].
isRight
)
{
this
.
emptyRectDown
(
this
.
sentenceEmptyArr
[
i
]);
this
.
emptyRectDown
(
this
.
sentenceEmptyArr
[
i
]);
}
}
console
.
log
(
'
empty clicked!!
'
);
console
.
log
(
'
empty clicked!!
'
);
return
;
return
;
...
@@ -1315,6 +1334,8 @@ export class PlayComponent implements OnInit, OnDestroy {
...
@@ -1315,6 +1334,8 @@ export class PlayComponent implements OnInit, OnDestroy {
if
(
this
.
checkClickTarget
(
this
.
submitBtn
))
{
if
(
this
.
checkClickTarget
(
this
.
submitBtn
))
{
if
(
this
.
submitBtn
.
visible
)
{
if
(
this
.
submitBtn
.
visible
)
{
this
.
submitBtnClick
();
this
.
submitBtnClick
();
this
.
playAudio
(
'
submit
'
,
true
);
}
}
return
;
return
;
}
}
...
@@ -1492,7 +1513,7 @@ export class PlayComponent implements OnInit, OnDestroy {
...
@@ -1492,7 +1513,7 @@ export class PlayComponent implements OnInit, OnDestroy {
showRightParticle
(
emptyRect
,
point
)
{
showRightParticle
(
emptyRect
,
point
)
{
const
shapeW
=
25
// * this.mapScale;
const
shapeW
=
25
// * this.mapScale;
const
shapeH
=
25
// * this.mapScale;
const
shapeH
=
25
// * this.mapScale;
showShapeParticle
(
'
rect
'
,
shapeW
,
shapeH
,
point
,
emptyRect
,
3
0
,
50
,
180
,
0.4
);
showShapeParticle
(
'
rect
'
,
shapeW
,
shapeH
,
point
,
emptyRect
,
2
0
,
50
,
180
,
0.4
);
}
}
...
@@ -1512,6 +1533,8 @@ export class PlayComponent implements OnInit, OnDestroy {
...
@@ -1512,6 +1533,8 @@ export class PlayComponent implements OnInit, OnDestroy {
for
(
let
i
=
0
;
i
<
this
.
sentenceEmptyArr
.
length
;
i
++
)
{
for
(
let
i
=
0
;
i
<
this
.
sentenceEmptyArr
.
length
;
i
++
)
{
if
(
this
.
checkClickTarget
(
this
.
sentenceEmptyArr
[
i
]))
{
if
(
this
.
checkClickTarget
(
this
.
sentenceEmptyArr
[
i
]))
{
this
.
playAudio
(
'
click
'
,
true
);
if
(
this
.
sentenceEmptyArr
[
i
].
isRight
)
{
if
(
this
.
sentenceEmptyArr
[
i
].
isRight
)
{
this
.
moveItemBack
();
this
.
moveItemBack
();
return
;
return
;
...
@@ -1560,23 +1583,26 @@ export class PlayComponent implements OnInit, OnDestroy {
...
@@ -1560,23 +1583,26 @@ export class PlayComponent implements OnInit, OnDestroy {
const
data
=
emptyRect
.
parent
.
data
;
const
data
=
emptyRect
.
parent
.
data
;
if
(
!
emptyRect
.
label
)
{
if
(
!
emptyRect
.
label
)
{
emptyRect
.
label
=
this
.
get
Sentence
Label
();
emptyRect
.
label
=
this
.
get
Fill
Label
();
this
.
renderArr
.
push
(
emptyRect
.
label
);
this
.
renderArr
.
push
(
emptyRect
.
label
);
}
}
const
label
=
emptyRect
.
label
const
label
=
emptyRect
.
label
label
.
text
=
text
;
label
.
text
=
text
;
label
.
width
=
emptyRect
.
width
;
// label.width = emptyRect.width / this.mapScale
;
// label.setScaleXY(1);
// label.setScaleXY(1);
label
.
refreshSize
();
label
.
refreshSize
();
const
h
=
label
.
getAreaHeight
()
;
label
.
anchorY
=
0.5
;
label
.
y
=
emptyRect
.
parent
.
y
-
label
.
height
*
label
.
scaleY
;
label
.
y
=
emptyRect
.
parent
.
y
//
- label.height * label.scaleY ;
label
.
x
=
emptyRect
.
parent
.
x
+
(
emptyRect
.
x
+
emptyRect
.
width
/
2
-
label
.
width
/
2
)
*
emptyRect
.
parent
.
scaleX
;
label
.
x
=
emptyRect
.
parent
.
x
+
(
emptyRect
.
x
+
emptyRect
.
width
/
2
-
label
.
width
/
2
)
*
this
.
mapScale
// const w1 = emptyRect.width / this.mapScale;
// const w2 = label.width;
// label.width = w1// w2 < w1 ? w1: w2;
label
[
'
moveOffX
'
]
=
-
label
.
width
/
2
*
label
.
scaleX
;
label
[
'
moveOffX
'
]
=
-
label
.
width
/
2
*
label
.
scaleX
;
label
[
'
moveOffY
'
]
=
-
label
.
height
/
1
*
label
.
scaleY
;
label
[
'
moveOffY
'
]
=
0
// -label.height / 2
* label.scaleY;
label
[
'
baseX
'
]
=
label
.
x
;
label
[
'
baseX
'
]
=
label
.
x
;
label
[
'
baseY
'
]
=
label
.
y
;
label
[
'
baseY
'
]
=
label
.
y
;
emptyRect
.
label
=
label
;
emptyRect
.
label
=
label
;
...
...
src/app/play/resources.js
View file @
ef65364d
...
@@ -27,7 +27,9 @@ const res = [
...
@@ -27,7 +27,9 @@ const res = [
const
resAudio
=
[
const
resAudio
=
[
[
'
open
'
,
"
assets/play/music/open.mp3
"
],
[
'
click
'
,
"
assets/play/music/click.mp3
"
],
[
'
submit
'
,
"
assets/play/music/submit.mp3
"
],
[
'
more
'
,
"
assets/play/music/more.mp3
"
],
];
];
...
...
src/assets/play/music/click.mp3
0 → 100644
View file @
ef65364d
File added
src/assets/play/music/more.mp3
0 → 100644
View file @
ef65364d
File added
src/assets/play/music/open.mp3
deleted
100644 → 0
View file @
de1fdac1
File deleted
src/assets/play/music/submit.mp3
0 → 100644
View file @
ef65364d
File added
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