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
a8f476a1
Commit
a8f476a1
authored
Jun 29, 2019
by
18신대성
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'wordspace'
# Conflicts: # js/WordObject.js
parents
2efabbbe
0acaaf7f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
11 deletions
+33
-11
Input.js
js/Input.js
+13
-6
WordSpace.js
js/WordSpace.js
+20
-5
No files found.
js/Input.js
View file @
a8f476a1
...
...
@@ -6,8 +6,10 @@ Input.convInput = ''; // converted input
Input
.
isShifted
=
false
;
Input
.
pressCount
=
0
;
Input
.
justPressed
=
''
;
Input
.
maxInput
=
5
;
Input
.
attackMode
=
false
;
Input
.
attackOption
=
null
;
Input
.
reset
=
function
()
{
...
...
@@ -62,6 +64,7 @@ Input.convert = function()
if
(
this
.
input
[
i
]
>=
'
ㅏ
'
.
charCodeAt
(
0
))
vowels
.
push
(
krInput
.
length
-
1
);
// 모음일 경우
}
}
if
(
vowels
.
length
>
5
)
return
false
;
//console.log(vowels);
//console.log(krInput);
...
...
@@ -163,7 +166,8 @@ Input.convert = function()
}
}
}
//console.log('_____end_convert_____');
return
true
;
//console.log('_____end_convert_____');
}
Input
.
convertToLast
=
function
(
word
)
...
...
@@ -291,7 +295,7 @@ Input.inputField =
});
scene
.
input
.
keyboard
.
on
(
'
keydown-ENTER
'
,
function
()
{
if
(
Input
.
attackMode
)
WordSpace
.
attack
(
Input
.
convInput
);
if
(
Input
.
attackMode
)
WordSpace
.
attack
(
Input
.
convInput
,
Input
.
attackOption
.
wordGrade
);
else
WordSpace
.
findWord
(
Input
.
convInput
);
WordSpace
.
resetGameOverTimer
();
Input
.
reset
();
...
...
@@ -353,10 +357,13 @@ Input.pushInput = function(inputKey)
}
}
else
output
=
inputKey
.
charCodeAt
(
0
);
Input
.
input
.
push
(
output
);
this
.
input
.
push
(
output
);
//console.log(Input.input);
Input
.
convert
();
Input
.
inputField
.
text
.
setText
(
Input
.
convInput
);
this
.
pressCount
++
;
if
(
!
this
.
convert
()
||
this
.
convInput
.
length
>
this
.
maxInput
)
{
this
.
input
.
pop
();
this
.
convert
();
}
this
.
inputField
.
text
.
setText
(
Input
.
convInput
);
}
}
\ No newline at end of file
js/WordSpace.js
View file @
a8f476a1
...
...
@@ -60,6 +60,14 @@ WordSpace.attackGauge =
},
pauseCycle
:
function
(
bool
)
{
this
.
currentCycle
.
paused
=
bool
;},
// showValue: 아래쪽에 바의 길이로 게이지 표시, 색으로 게이지의 강도 표현
getAttackOption
:
function
()
{
if
(
this
.
value
<
3
)
return
{
wordCount
:
0
,
wordGrade
:
-
1
};
else
if
(
this
.
value
<
5
)
return
{
wordCount
:
2
,
wordGrade
:
3
};
else
if
(
this
.
value
<
7
)
return
{
wordCount
:
3
,
wordGrade
:
2
};
else
if
(
this
.
value
<
10
)
return
{
wordCount
:
4
,
wordGrade
:
1
};
else
return
{
wordCount
:
5
,
wordGrade
:
0
};
}
}
WordSpace
.
wordCycle
=
...
...
@@ -108,9 +116,14 @@ WordSpace.loadImage = function(scene)
WordSpace
.
gameSceneForTest
=
scene
;
// for test
}
WordSpace
.
generateWord
=
function
(
scene
,
wordText
)
WordSpace
.
generateWord
=
function
(
scene
,
wordText
,
grade
)
{
word
=
new
WordObject
(
wordText
);
if
(
typeof
grade
!=
'
undefined
'
)
{
word
.
wordGrade
=
grade
;
word
.
wordWeight
=
WordReader
.
getWordWeight
(
grade
);
}
word
.
instantiate
(
scene
);
WordSpace
.
wordGroup
.
push
(
word
);
WordSpace
.
wordForcedGroup
.
push
(
word
);
...
...
@@ -183,7 +196,8 @@ WordSpace.findWord = function(wordText)
else
if
(
wordText
===
'
공격
'
&&
WordSpace
.
attackGauge
.
value
>
3
)
// 공격모드 진입.
{
console
.
log
(
'
attack mode
'
);
// 이부분에서 최대 단어수 결정
Input
.
attackOption
=
this
.
attackGauge
.
getAttackOption
();
Input
.
maxInput
=
Input
.
attackOption
.
wordCount
;
Input
.
attackMode
=
true
;
WordSpace
.
attackGauge
.
pauseCycle
(
true
);
}
...
...
@@ -193,12 +207,12 @@ WordSpace.findWord = function(wordText)
}
}
WordSpace
.
attack
=
function
(
wordText
)
WordSpace
.
attack
=
function
(
wordText
,
grade
)
{
if
(
wordText
!=
''
)
{
console
.
log
(
'
attack
'
+
wordText
);
WordSpace
.
generateWord
(
WordSpace
.
gameSceneForTest
,
wordText
);
// for test
console
.
log
(
'
attack
'
+
wordText
+
'
, grade:
'
+
grade
);
WordSpace
.
generateWord
(
WordSpace
.
gameSceneForTest
,
wordText
,
grade
);
// for test
// 이부분에서 게이지에 따라 급수 결정
// 이부분은 서버 잘써야함
WordSpace
.
attackGauge
.
resetValue
();
...
...
@@ -207,6 +221,7 @@ WordSpace.attack = function(wordText)
{
WordSpace
.
attackGauge
.
cutValue
(
0.3
);
}
Input
.
maxInput
=
5
;
Input
.
attackMode
=
false
;
WordSpace
.
attackGauge
.
pauseCycle
(
false
);
}
\ 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