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
82a56735
Commit
82a56735
authored
Jul 04, 2019
by
18손재민
Committed by
18류지석
Jul 04, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
이제 플레이어의 타수를 측정함
parent
2fab5dd6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
0 deletions
+23
-0
WordSpace.js
js/WordSpace.js
+21
-0
main.js
js/main.js
+2
-0
No files found.
js/WordSpace.js
View file @
82a56735
...
@@ -195,6 +195,7 @@ WordSpace.findWord = function(wordText)
...
@@ -195,6 +195,7 @@ WordSpace.findWord = function(wordText)
default
:
console
.
log
(
'
[ERR] wrong grade of word
'
);
break
;
default
:
console
.
log
(
'
[ERR] wrong grade of word
'
);
break
;
}
}
weightest
.
destroy
();
weightest
.
destroy
();
WordSpace
.
playerTyping
.
add
(
wordText
);
}
}
else
if
(
wordText
===
'
공격
'
&&
WordSpace
.
attackGauge
.
value
>
3
)
// 공격모드 진입.
else
if
(
wordText
===
'
공격
'
&&
WordSpace
.
attackGauge
.
value
>
3
)
// 공격모드 진입.
{
{
...
@@ -203,6 +204,7 @@ WordSpace.findWord = function(wordText)
...
@@ -203,6 +204,7 @@ WordSpace.findWord = function(wordText)
Input
.
maxInput
=
Input
.
attackOption
.
wordCount
;
Input
.
maxInput
=
Input
.
attackOption
.
wordCount
;
Input
.
attackMode
=
true
;
Input
.
attackMode
=
true
;
WordSpace
.
attackGauge
.
pauseCycle
(
true
);
WordSpace
.
attackGauge
.
pauseCycle
(
true
);
WordSpace
.
playerTyping
.
add
(
wordText
);
}
}
else
else
{
{
...
@@ -210,6 +212,24 @@ WordSpace.findWord = function(wordText)
...
@@ -210,6 +212,24 @@ WordSpace.findWord = function(wordText)
}
}
}
}
WordSpace
.
playerTyping
=
{
totalTyping
:
0
,
playerTyping
:
0
,
add
:
function
(
wordText
)
{
this
.
totalTyping
+=
wordText
!=
null
?
WordReader
.
getWordTyping
(
wordText
)
:
0
;
this
.
playerTyping
=
this
.
totalTyping
/
this
.
gameTimer
.
now
*
1000
;
this
.
text
.
setText
(
'
현재 타수 :
'
+
this
.
playerTyping
.
toFixed
(
1
));
},
initiate
:
function
(
scene
)
{
this
.
gameTimer
=
new
Phaser
.
Time
.
Clock
(
scene
);
this
.
gameTimer
.
start
();
this
.
text
=
scene
.
add
.
text
(
100
,
200
,
'
현재 타수 :
'
+
this
.
playerTyping
.
toFixed
(
1
)).
setDepth
(
10
).
setColor
(
'
#000000
'
);
}
}
WordSpace
.
attack
=
function
(
wordText
,
grade
)
WordSpace
.
attack
=
function
(
wordText
,
grade
)
{
{
wordText
=
Input
.
removeConVow
(
wordText
);
wordText
=
Input
.
removeConVow
(
wordText
);
...
@@ -220,6 +240,7 @@ WordSpace.attack = function(wordText, grade)
...
@@ -220,6 +240,7 @@ WordSpace.attack = function(wordText, grade)
// 이부분에서 게이지에 따라 급수 결정
// 이부분에서 게이지에 따라 급수 결정
// 이부분은 서버 잘써야함
// 이부분은 서버 잘써야함
WordSpace
.
attackGauge
.
resetValue
();
WordSpace
.
attackGauge
.
resetValue
();
WordSpace
.
playerTyping
.
add
(
wordText
);
}
}
else
else
{
{
...
...
js/main.js
View file @
82a56735
...
@@ -34,6 +34,7 @@ function create()
...
@@ -34,6 +34,7 @@ function create()
WordSpace
.
wordPhysicsGroup
=
this
.
physics
.
add
.
group
();
WordSpace
.
wordPhysicsGroup
=
this
.
physics
.
add
.
group
();
WordSpace
.
wordCycle
.
resetCycle
(
this
,
3000
);
WordSpace
.
wordCycle
.
resetCycle
(
this
,
3000
);
WordSpace
.
attackGauge
.
resetCycle
(
this
);
WordSpace
.
attackGauge
.
resetCycle
(
this
);
WordSpace
.
playerTyping
.
initiate
(
this
);
CSVParsing
.
CSVParse
(
this
);
CSVParsing
.
CSVParse
(
this
);
}
}
...
@@ -43,6 +44,7 @@ function update()
...
@@ -43,6 +44,7 @@ function update()
{
{
element
.
attract
();
element
.
attract
();
});
});
WordSpace
.
playerTyping
.
add
(
''
);
}
}
var
socket
=
io
.
connect
();
var
socket
=
io
.
connect
();
...
...
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