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
bcb7f66f
Commit
bcb7f66f
authored
Jun 29, 2019
by
18김상언
Committed by
16이지혜
Jun 29, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
파싱됨. 단어 DB 다시 찾아야 함
parent
36074e79
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
38 additions
and
10 deletions
+38
-10
KKUTU_word.txt
assets/KKUTU_word.txt
+0
-0
index.html
index.html
+2
-0
CSVParsing.js
js/CSVParsing.js
+16
-8
SelectWord.js
js/SelectWord.js
+16
-0
WordSpace.js
js/WordSpace.js
+2
-2
main.js
js/main.js
+2
-0
No files found.
assets/KKUTU_word.txt
0 → 100644
View file @
bcb7f66f
B
가
B
가
index.html
View file @
bcb7f66f
...
@@ -9,6 +9,8 @@
...
@@ -9,6 +9,8 @@
<script
src=
"js/WordSpace.js"
></script>
<script
src=
"js/WordSpace.js"
></script>
<script
src=
"js/WordObject.js"
></script>
<script
src=
"js/WordObject.js"
></script>
<script
src=
"js/WordReader.js"
></script>
<script
src=
"js/WordReader.js"
></script>
<script
src=
"js/CSVParsing.js"
></script>
<script
src=
"js/SelectWord.js"
></script>
</head>
</head>
<body>
<body>
<script
src=
"js/Main.js"
></script>
<script
src=
"js/Main.js"
></script>
...
...
js/CSVParsing.js
View file @
bcb7f66f
var
gradeArray
=
{
var
CSVParsing
=
CSVParsing
||
{};
CSVParsing
.
gradeArray
=
{
grade3
:
[],
//3급
grade3
:
[],
//3급
grade2
:
[],
//2급
grade2
:
[],
//2급
grade1
:
[],
//1급
grade1
:
[],
//1급
grade0
:
[]
//특급
grade0
:
[]
//특급
}
}
function
CSVParse
(
$data
)
{
CSVParsing
.
loadText
=
function
(
scene
)
{
var
allRows
=
$data
.
split
(
'
\n
'
)
scene
.
load
.
text
(
'
parseword
'
,
'
assets/KKUTU_word.txt
'
);
}
CSVParsing
.
CSVParse
=
function
(
scene
)
{
var
data
=
scene
.
cache
.
text
.
get
(
'
parseword
'
);
console
.
log
(
'
xx
'
+
data
);
var
allRows
=
data
.
split
(
'
\n
'
)
for
(
var
singleRow
=
0
;
singleRow
<
allRows
.
length
;
singleRow
++
)
for
(
var
singleRow
=
0
;
singleRow
<
allRows
.
length
;
singleRow
++
)
{
{
var
typing
;
var
typing
;
var
grade
;
var
grade
;
typing
=
WordReader
.
getWordTyping
(
allRows
[
singleRow
]);
typing
=
WordReader
.
getWordTyping
(
allRows
[
singleRow
]
.
trim
()
);
grade
=
WordReader
.
getWordGrade
(
typing
);
grade
=
WordReader
.
getWordGrade
(
typing
);
if
(
grade
==
3
)
{
if
(
grade
==
3
)
{
gradeArray
.
grade3
.
push
(
allRows
[
singleRow
]
);
CSVParsing
.
gradeArray
.
grade3
.
push
(
allRows
[
singleRow
].
trim
()
);
}
else
if
(
grade
==
2
)
{
}
else
if
(
grade
==
2
)
{
gradeArray
.
grade2
.
push
(
allRows
[
singleRow
]
);
CSVParsing
.
gradeArray
.
grade2
.
push
(
allRows
[
singleRow
].
trim
()
);
}
else
if
(
grade
==
1
)
{
}
else
if
(
grade
==
1
)
{
gradeArray
.
grade1
.
push
(
allRows
[
singleRow
]
);
CSVParsing
.
gradeArray
.
grade1
.
push
(
allRows
[
singleRow
].
trim
()
);
}
else
{
}
else
{
gradeArray
.
grade0
.
push
(
allRows
[
singleRow
]
);
CSVParsing
.
gradeArray
.
grade0
.
push
(
allRows
[
singleRow
].
trim
()
);
}
}
}
}
}
}
\ No newline at end of file
js/
select
.js
→
js/
SelectWord
.js
View file @
bcb7f66f
var
Select
=
Select
||
[];
var
Select
Word
=
SelectWord
||
[];
Select
.
startWordList
=
[];
Select
Word
.
startWordList
=
[];
Select
.
selectstartWord
=
function
()
{
SelectWord
.
selectWord
=
function
(
grade
)
{
var
i
;
for
(
i
=
0
;
i
<
5
;
i
++
)
{
Select
.
startWordList
.
push
(
Phaser
.
Utils
.
Array
.
GetRandom
(
CSVParsing
.
gradeArray
.
grade3
));
}
for
(
i
=
0
;
i
<
4
;
i
++
)
{
Select
.
startWordList
.
push
(
Phaser
.
Utils
.
Array
.
GetRandom
(
CSVParsing
.
gradeArray
.
grade2
));
}
Select
.
startWordList
.
push
(
Phaser
.
Utils
.
Array
.
GetRandom
(
CSVParsing
.
gradeArray
.
grade1
));
}
Select
.
selectWord
=
function
(
grade
)
{
var
selection
=
""
;
var
selection
=
""
;
switch
(
grade
)
switch
(
grade
)
{
{
...
...
js/WordSpace.js
View file @
bcb7f66f
...
@@ -72,8 +72,8 @@ WordSpace.wordCycle =
...
@@ -72,8 +72,8 @@ WordSpace.wordCycle =
delay
:
_delay
,
delay
:
_delay
,
callback
:
function
()
callback
:
function
()
{
{
let
wordIdx
=
Math
.
floor
(
Math
.
random
()
*
WordSpace
.
wordCycle
.
wordList
.
length
);
let
wordIdx
=
Math
.
floor
(
Math
.
random
()
*
4
);
WordSpace
.
generateWord
(
this
,
WordSpace
.
wordCycle
.
wordList
[
wordIdx
]
);
WordSpace
.
generateWord
(
this
,
SelectWord
.
selectWord
(
wordIdx
)
);
},
},
callbackScope
:
scene
,
callbackScope
:
scene
,
loop
:
true
loop
:
true
...
...
js/main.js
View file @
bcb7f66f
...
@@ -24,6 +24,7 @@ function preload()
...
@@ -24,6 +24,7 @@ function preload()
BackGround
.
loadImage
(
this
);
BackGround
.
loadImage
(
this
);
WordSpace
.
loadImage
(
this
);
WordSpace
.
loadImage
(
this
);
Input
.
inputField
.
loadImage
(
this
);
Input
.
inputField
.
loadImage
(
this
);
CSVParsing
.
loadText
(
this
);
}
}
function
create
()
function
create
()
...
@@ -33,6 +34,7 @@ function create()
...
@@ -33,6 +34,7 @@ function create()
WordSpace
.
wordPhysicsGroup
=
this
.
physics
.
add
.
group
();
WordSpace
.
wordPhysicsGroup
=
this
.
physics
.
add
.
group
();
WordSpace
.
wordCycle
.
resetCycle
(
this
,
2000
);
WordSpace
.
wordCycle
.
resetCycle
(
this
,
2000
);
WordSpace
.
attackGauge
.
resetCycle
(
this
);
WordSpace
.
attackGauge
.
resetCycle
(
this
);
CSVParsing
.
CSVParse
(
this
);
}
}
function
update
()
function
update
()
...
...
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