Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
sejong25
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Tear of Sejong
sejong25
Commits
2efabbbe
Commit
2efabbbe
authored
Jun 29, 2019
by
16이지혜
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'word' of
https://git.kucatdog.net/tear-of-sejong/sejong25
into word
parents
bb65863c
81c6b389
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
13 deletions
+15
-13
WordObject.js
js/WordObject.js
+8
-13
WordReader.js
js/WordReader.js
+7
-0
No files found.
js/WordObject.js
View file @
2efabbbe
...
...
@@ -7,14 +7,7 @@ class WordObject
//this.wordText = Input.removeConVow(text);
this
.
wordTyping
=
WordReader
.
getWordTyping
(
this
.
wordText
);
this
.
wordGrade
=
WordReader
.
getWordGrade
(
this
.
wordTyping
);
this
.
wordWeight
=
(
function
(
_wordGrade
)
{
var
temp
=
0
;
temp
=
_wordGrade
==
3
?
3
:
_wordGrade
==
2
?
5
:
_wordGrade
==
1
?
7
:
10
;
return
temp
;
})(
this
.
wordGrade
);
this
.
wordWeight
=
WordReader
.
getWordWeight
(
this
.
wordGrade
);
//console.log("wordTyping : " + this.wordTyping + '\n' + "wordGrade : " + this.wordGrade + '\n' + "wordWeight : " + this.wordWeight + '\n');
this
.
wordSpeed
=
1
;
}
...
...
@@ -22,9 +15,13 @@ class WordObject
instantiate
(
scene
)
{
var
random
=
WordSpace
.
getSpawnPoint
();
this
.
physicsObj
=
scene
.
physics
.
add
.
sprite
(
random
.
x
,
random
.
y
,
'
wordBgr
'
+
this
.
wordGrade
+
'
_
'
+
Math
.
min
(
Math
.
max
(
2
,
this
.
wordText
.
length
),
6
));
this
.
physicsObj
.
body
.
bounce
.
set
(
0.5
);
this
.
wordObj
=
scene
.
add
.
text
(
random
.
x
,
random
.
y
,
this
.
wordText
,
{
fontSize
:
'
18pt
'
,
fontFamily
:
'
"궁서", 궁서체, serif
'
}).
setColor
(
'
#000000
'
).
setOrigin
(
0.5
,
0.5
);
this
.
physicsObj
=
scene
.
physics
.
add
.
sprite
(
random
.
x
,
random
.
y
,
'
wordBgr
'
+
this
.
wordGrade
+
'
_
'
+
Math
.
min
(
Math
.
max
(
2
,
this
.
wordText
.
length
),
6
)).
setMass
(
this
.
wordWeight
);
this
.
wordObj
=
scene
.
add
.
text
(
random
.
x
,
random
.
y
,
this
.
wordText
,
{
fontSize
:
(
this
.
wordWeight
+
10
)
+
'
pt
'
,
fontFamily
:
'
"궁서", 궁서체, serif
'
,
fontStyle
:
(
this
.
wordWeight
>
5
?
'
bold
'
:
''
)
}).
setColor
(
'
#000000
'
).
setOrigin
(
0.5
,
0.5
);
WordSpace
.
totalWeight
+=
this
.
wordWeight
;
WordSpace
.
setGameOverTimer
();
console
.
log
(
"
Total weight :
"
+
WordSpace
.
totalWeight
);
...
...
@@ -50,7 +47,5 @@ class WordObject
this
.
wordObj
.
setPosition
(
this
.
physicsObj
.
x
,
this
.
physicsObj
.
y
);
}
getWordWeight
()
{
return
this
.
wordWeight
;
}
isEqualObject
(
_generationCode
)
{
return
_generationCode
===
this
.
generationCode
;
}
}
\ No newline at end of file
js/WordReader.js
View file @
2efabbbe
...
...
@@ -51,3 +51,10 @@ WordReader.getWordGrade = function(_wordTyping)
7
<=
_wordTyping
&&
_wordTyping
<
12
?
2
:
12
<=
_wordTyping
&&
_wordTyping
<
17
?
1
:
0
;
}
WordReader
.
getWordWeight
=
function
(
_wordGrade
)
{
return
_wordGrade
==
3
?
3
:
_wordGrade
==
2
?
5
:
_wordGrade
==
1
?
7
:
10
;
}
\ No newline at end of file
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