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
d28c495c
Commit
d28c495c
authored
Jun 26, 2019
by
18신대성
Committed by
16이지혜
Jun 26, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
단어가 주기적으로 생성되게 함.
WordSpace.resetCycle로 주기 변경 가능
parent
347e52db
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
45 additions
and
18 deletions
+45
-18
WordObject.js
js/WordObject.js
+2
-2
WordSpace.js
js/WordSpace.js
+42
-0
main.js
js/main.js
+1
-16
No files found.
js/WordObject.js
View file @
d28c495c
...
...
@@ -28,8 +28,8 @@ class WordObject
generate
(
scene
)
{
var
randomX
=
Phaser
.
Math
.
Between
(
100
,
5
00
);
this
.
physicsObj
=
scene
.
physics
.
add
.
sprite
(
randomX
,
100
,
'
wordBackground
'
).
setScale
(
0.
5
);
var
randomX
=
Phaser
.
Math
.
Between
(
100
,
7
00
);
this
.
physicsObj
=
scene
.
physics
.
add
.
sprite
(
randomX
,
100
,
'
wordBackground
'
).
setScale
(
0.
3
);
this
.
wordObj
=
scene
.
add
.
text
(
randomX
,
100
,
this
.
wordText
,
{
fontFamily
:
'
"궁서", 궁서체, serif
'
}).
setColor
(
'
#000000
'
);
this
.
wordObj
.
setOrigin
(
0.5
,
0.5
);
}
...
...
js/WordSpace.js
View file @
d28c495c
...
...
@@ -7,6 +7,48 @@ WordSpace.wordPhysicsGroup = null;
WordSpace
.
gravityPoint
=
{
x
:
400
,
y
:
300
};
WordSpace
.
wordCycle
=
null
;
WordSpace
.
resetCycle
=
function
(
scene
,
_delay
)
{
if
(
this
.
wordCycle
!=
null
)
{
this
.
wordCycle
=
this
.
wordCycle
.
reset
(
{
delay
:
_delay
,
callback
:
function
()
{
word
=
new
WordObject
(
"
솽젠커
"
);
word
.
generate
(
this
);
WordSpace
.
wordGroup
.
push
(
word
);
this
.
physics
.
add
.
collider
(
word
.
physicsObj
,
WordSpace
.
wordPhysicsGroup
);
WordSpace
.
wordPhysicsGroup
.
add
(
word
.
physicsObj
);
},
callbackScope
:
scene
,
loop
:
true
}
);
}
else
{
this
.
wordCycle
=
scene
.
time
.
addEvent
(
{
delay
:
_delay
,
callback
:
function
()
{
word
=
new
WordObject
(
"
솽젠커
"
);
word
.
generate
(
this
);
WordSpace
.
wordGroup
.
push
(
word
);
this
.
physics
.
add
.
collider
(
word
.
physicsObj
,
WordSpace
.
wordPhysicsGroup
);
this
.
physics
.
add
.
collider
(
word
.
physicsObj
,
BackGround
.
brainGroup
);
WordSpace
.
wordPhysicsGroup
.
add
(
word
.
physicsObj
);
},
callbackScope
:
scene
,
loop
:
true
}
);
}
}
WordSpace
.
loadImage
=
function
(
scene
)
{
if
(
!
this
.
isImageLoaded
)
...
...
js/main.js
View file @
d28c495c
...
...
@@ -32,22 +32,7 @@ function create()
BackGround
.
drawBrain
(
this
);
WordSpace
.
wordGroup
=
[];
WordSpace
.
wordPhysicsGroup
=
this
.
physics
.
add
.
group
();
this
.
time
.
addEvent
(
{
delay
:
2000
,
callback
:
function
()
{
word
=
new
WordObject
(
"
솽젠커
"
);
word
.
generate
(
this
);
WordSpace
.
wordGroup
.
push
(
word
);
this
.
physics
.
add
.
collider
(
word
.
physicsObj
,
WordSpace
.
wordPhysicsGroup
);
WordSpace
.
wordPhysicsGroup
.
add
(
word
.
physicsObj
);
},
callbackScope
:
this
,
repeat
:
10
}
);
WordSpace
.
resetCycle
(
this
,
2000
);
}
function
update
()
...
...
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