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
f460d811
Commit
f460d811
authored
Jun 26, 2019
by
18신대성
Committed by
16이지혜
Jun 26, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
word destroy 구현, 각 wordObj마다 개별 code를 가지게됨
parent
6a317860
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
0 deletions
+20
-0
WordObject.js
js/WordObject.js
+18
-0
WordSpace.js
js/WordSpace.js
+2
-0
No files found.
js/WordObject.js
View file @
f460d811
...
...
@@ -2,6 +2,8 @@ class WordObject
{
constructor
(
text
)
{
this
.
generationCode
=
WordSpace
.
nextWordCode
++
;
this
.
wordText
=
text
;
this
.
wordTyping
=
(
function
(
_wordText
)
{
...
...
@@ -33,6 +35,17 @@ class WordObject
this
.
wordObj
=
scene
.
add
.
text
(
randomX
,
100
,
this
.
wordText
,
{
fontFamily
:
'
"궁서", 궁서체, serif
'
}).
setColor
(
'
#000000
'
);
this
.
wordObj
.
setOrigin
(
0.5
,
0.5
);
}
destroy
()
{
this
.
wordObj
.
destroy
();
const
groupIdx
=
WordSpace
.
wordGroup
.
findIndex
(
function
(
item
)
{
return
this
.
isEqualObject
(
item
.
generationCode
)},
this
);
if
(
groupIdx
>
-
1
)
WordSpace
.
wordGroup
.
splice
(
groupIdx
,
1
);
const
forceIdx
=
WordSpace
.
wordForcedGroup
.
findIndex
(
function
(
item
)
{
return
this
.
isEqualObject
(
item
.
generationCode
)},
this
);
if
(
forceIdx
>
-
1
)
WordSpace
.
wordForcedGroup
.
splice
(
forceIdx
,
1
);
WordSpace
.
wordPhysicsGroup
.
remove
(
this
.
physicsObj
,
true
,
true
);
}
attract
(
wordSpeed
)
{
...
...
@@ -47,6 +60,11 @@ class WordObject
return
this
.
wordWeight
;
}
isEqualObject
(
_generationCode
)
{
return
_generationCode
===
this
.
_generationCode
;
}
//***********ToDo*************
isEqual
(
inputWord
)
{
...
...
js/WordSpace.js
View file @
f460d811
...
...
@@ -2,6 +2,8 @@ var WordSpace = WordSpace || {};
WordSpace
.
isImageLoaded
=
false
;
WordSpace
.
nextWordCode
=
0
;
WordSpace
.
wordGroup
=
[];
WordSpace
.
wordForcedGroup
=
[];
WordSpace
.
wordPhysicsGroup
=
null
;
...
...
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