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
302fe1fa
Commit
302fe1fa
authored
Jun 28, 2019
by
18신대성
Committed by
16이지혜
Jun 28, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
단어 인식순서 적용, 공격모드 진입점 만듬
parent
3189664a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
5 deletions
+15
-5
WordSpace.js
js/WordSpace.js
+15
-5
No files found.
js/WordSpace.js
View file @
302fe1fa
...
...
@@ -94,7 +94,8 @@ WordSpace.generateWord = function(scene)
word
.
physicsObj
.
topObj
=
word
;
scene
.
physics
.
add
.
collider
(
word
.
physicsObj
,
WordSpace
.
wordPhysicsGroup
,
function
(
object1
)
{
if
(
object1
.
topObj
.
wordSpeed
>
0.5
)
object1
.
topObj
.
wordSpeed
=
0.05
;
object1
.
topObj
.
wordSpeed
=
0.1
;
object1
.
topObj
.
attract
();
});
scene
.
physics
.
add
.
collider
(
word
.
physicsObj
,
BackGround
.
brainGroup
);
WordSpace
.
wordPhysicsGroup
.
add
(
word
.
physicsObj
);
...
...
@@ -120,13 +121,18 @@ WordSpace.setGameOverTimer = function()
WordSpace
.
findWord
=
function
(
word
)
{
var
found
=
WordSpace
.
wordGroup
.
fi
nd
(
function
(
element
)
var
found
=
WordSpace
.
wordGroup
.
fi
lter
(
function
(
element
)
{
return
Input
.
isEqual
(
word
,
element
.
wordText
);
});
if
(
found
!=
undefined
)
if
(
found
.
length
!=
0
)
{
switch
(
found
.
wordGrade
)
// 이부분 나중에 더 효율적으로 바꿀수있지 않을까
let
weightest
=
found
[
0
];
found
.
forEach
(
function
(
element
)
{
if
(
weightest
.
wordWeight
<
element
.
wordWeight
)
weightest
=
element
;
});
switch
(
weightest
.
wordGrade
)
// 이부분 나중에 더 효율적으로 바꿀수있지 않을까
{
case
0
:
WordSpace
.
attackGauge
.
add
(
2.5
);
break
;
case
1
:
WordSpace
.
attackGauge
.
add
(
1.5
);
break
;
...
...
@@ -134,6 +140,10 @@ WordSpace.findWord = function(word)
case
3
:
WordSpace
.
attackGauge
.
add
(
0.5
);
break
;
default
:
console
.
log
(
'
[ERR] wrong grade of word
'
);
break
;
}
found
.
destroy
();
weightest
.
destroy
();
}
else
if
(
word
===
'
공격
'
)
// 공격모드 진입.
{
console
.
log
(
'
attack mode
'
);
}
}
\ 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