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
de3f433d
Commit
de3f433d
authored
Jun 28, 2019
by
18신대성
Committed by
16이지혜
Jun 28, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
단어 생성위치를 8군데로 정해서 나오게 함
parent
302fe1fa
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
5 deletions
+16
-5
WordObject.js
js/WordObject.js
+4
-4
WordSpace.js
js/WordSpace.js
+12
-1
No files found.
js/WordObject.js
View file @
de3f433d
...
@@ -25,16 +25,16 @@ class WordObject
...
@@ -25,16 +25,16 @@ class WordObject
instantiate
(
scene
)
instantiate
(
scene
)
{
{
var
random
X
=
Phaser
.
Math
.
Between
(
100
,
700
)
;
var
random
=
WordSpace
.
spawnPoint
[
Math
.
floor
(
Math
.
random
()
*
(
WordSpace
.
spawnPoint
.
length
))]
;
this
.
physicsObj
=
scene
.
physics
.
add
.
sprite
(
random
X
,
100
,
'
wordBackground
'
).
setScale
(
0.3
);
this
.
physicsObj
=
scene
.
physics
.
add
.
sprite
(
random
.
x
,
random
.
y
,
'
wordBackground
'
).
setScale
(
0.3
);
this
.
physicsObj
.
body
.
bounce
.
set
(
0.5
);
this
.
physicsObj
.
body
.
bounce
.
set
(
0.5
);
this
.
wordObj
=
scene
.
add
.
text
(
randomX
,
100
,
this
.
wordText
,
{
fontFamily
:
'
"궁서", 궁서체, serif
'
}).
setColor
(
'
#000000
'
);
this
.
wordObj
=
scene
.
add
.
text
(
random
.
x
,
random
.
y
,
this
.
wordText
,
{
fontFamily
:
'
"궁서", 궁서체, serif
'
}).
setColor
(
'
#000000
'
).
setOrigin
(
0.5
,
0.5
);
this
.
wordObj
.
setOrigin
(
0.5
,
0.5
);
}
}
destroy
()
destroy
()
{
{
console
.
log
(
this
.
generationCode
+
'
:
'
+
this
.
wordText
+
'
destroyed
'
);
console
.
log
(
this
.
generationCode
+
'
:
'
+
this
.
wordText
+
'
destroyed
'
);
WordSpace
.
totalWeight
-=
this
.
wordWeight
;
this
.
wordObj
.
destroy
();
this
.
wordObj
.
destroy
();
const
groupIdx
=
WordSpace
.
wordGroup
.
findIndex
(
function
(
item
)
{
return
this
.
isEqualObject
(
item
.
generationCode
)},
this
);
const
groupIdx
=
WordSpace
.
wordGroup
.
findIndex
(
function
(
item
)
{
return
this
.
isEqualObject
(
item
.
generationCode
)},
this
);
if
(
groupIdx
>
-
1
)
WordSpace
.
wordGroup
.
splice
(
groupIdx
,
1
);
if
(
groupIdx
>
-
1
)
WordSpace
.
wordGroup
.
splice
(
groupIdx
,
1
);
...
...
js/WordSpace.js
View file @
de3f433d
...
@@ -4,7 +4,7 @@ WordSpace.isImageLoaded = false;
...
@@ -4,7 +4,7 @@ WordSpace.isImageLoaded = false;
WordSpace
.
nextWordCode
=
0
;
WordSpace
.
nextWordCode
=
0
;
WordSpace
.
totalWeight
=
0
;
//현재 단어 무게 총합
WordSpace
.
totalWeight
=
0
;
//현재 단어 무게 총합
WordSpace
.
brainCapacity
=
20
;
//수용 가능한 단어 무게 최대치
WordSpace
.
brainCapacity
=
20
0
;
//수용 가능한 단어 무게 최대치
WordSpace
.
defeatTime
=
3000
;
WordSpace
.
defeatTime
=
3000
;
WordSpace
.
gameOverTimer
=
null
;
//게임 오버 판정 타이머
WordSpace
.
gameOverTimer
=
null
;
//게임 오버 판정 타이머
WordSpace
.
isTimerOn
=
false
;
WordSpace
.
isTimerOn
=
false
;
...
@@ -14,6 +14,17 @@ WordSpace.wordForcedGroup = [];
...
@@ -14,6 +14,17 @@ WordSpace.wordForcedGroup = [];
WordSpace
.
wordPhysicsGroup
=
null
;
WordSpace
.
wordPhysicsGroup
=
null
;
WordSpace
.
gravityPoint
=
{
x
:
400
,
y
:
300
};
WordSpace
.
gravityPoint
=
{
x
:
400
,
y
:
300
};
WordSpace
.
spawnPoint
=
[
{
x
:
100
,
y
:
100
},
{
x
:
100
,
y
:
300
},
{
x
:
100
,
y
:
500
},
{
x
:
400
,
y
:
100
},
{
x
:
400
,
y
:
500
},
{
x
:
700
,
y
:
100
},
{
x
:
700
,
y
:
300
},
{
x
:
700
,
y
:
500
},
]
WordSpace
.
attackGauge
=
WordSpace
.
attackGauge
=
{
{
...
...
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