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
6d3b8c47
Commit
6d3b8c47
authored
Jun 27, 2019
by
18신대성
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
중력을 없애는 대신 wordSpeed를 바꿈
parent
30b700e5
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
10 deletions
+7
-10
WordObject.js
js/WordObject.js
+5
-8
WordSpace.js
js/WordSpace.js
+1
-1
main.js
js/main.js
+1
-1
No files found.
js/WordObject.js
View file @
6d3b8c47
...
@@ -25,7 +25,7 @@ class WordObject
...
@@ -25,7 +25,7 @@ class WordObject
_wordGrade
==
1
?
7
:
10
;
_wordGrade
==
1
?
7
:
10
;
return
temp
;
return
temp
;
})(
this
.
wordGrade
);
})(
this
.
wordGrade
);
this
.
isForced
=
true
;
this
.
wordSpeed
=
1
;
//alert("wordTyping : " + this.wordTyping + '\n' + "wordGrade : " + this.wordGrade + '\n' + "wordWeight : " + this.wordWeight + '\n');
//alert("wordTyping : " + this.wordTyping + '\n' + "wordGrade : " + this.wordGrade + '\n' + "wordWeight : " + this.wordWeight + '\n');
}
}
...
@@ -49,14 +49,11 @@ class WordObject
...
@@ -49,14 +49,11 @@ class WordObject
WordSpace
.
wordPhysicsGroup
.
remove
(
this
.
physicsObj
,
true
,
true
);
WordSpace
.
wordPhysicsGroup
.
remove
(
this
.
physicsObj
,
true
,
true
);
}
}
attract
(
wordSpeed
)
attract
()
{
if
(
this
.
isForced
)
{
{
var
dist
=
Phaser
.
Math
.
Distance
.
Between
(
this
.
physicsObj
.
x
,
this
.
physicsObj
.
y
,
WordSpace
.
gravityPoint
.
x
,
WordSpace
.
gravityPoint
.
y
);
var
dist
=
Phaser
.
Math
.
Distance
.
Between
(
this
.
physicsObj
.
x
,
this
.
physicsObj
.
y
,
WordSpace
.
gravityPoint
.
x
,
WordSpace
.
gravityPoint
.
y
);
var
angle
=
Phaser
.
Math
.
Angle
.
Between
(
this
.
physicsObj
.
x
,
this
.
physicsObj
.
y
,
WordSpace
.
gravityPoint
.
x
,
WordSpace
.
gravityPoint
.
y
);
var
angle
=
Phaser
.
Math
.
Angle
.
Between
(
this
.
physicsObj
.
x
,
this
.
physicsObj
.
y
,
WordSpace
.
gravityPoint
.
x
,
WordSpace
.
gravityPoint
.
y
);
this
.
physicsObj
.
setVelocity
(
dist
*
Math
.
cos
(
angle
)
*
wordSpeed
,
dist
*
Math
.
sin
(
angle
)
*
wordSpeed
);
this
.
physicsObj
.
setVelocity
(
dist
*
Math
.
cos
(
angle
)
*
this
.
wordSpeed
,
dist
*
Math
.
sin
(
angle
)
*
this
.
wordSpeed
);
}
this
.
wordObj
.
setPosition
(
this
.
physicsObj
.
x
,
this
.
physicsObj
.
y
);
this
.
wordObj
.
setPosition
(
this
.
physicsObj
.
x
,
this
.
physicsObj
.
y
);
}
}
...
...
js/WordSpace.js
View file @
6d3b8c47
...
@@ -89,7 +89,7 @@ WordSpace.generateWord = function(scene)
...
@@ -89,7 +89,7 @@ WordSpace.generateWord = function(scene)
word
.
physicsObj
.
topObj
=
word
;
word
.
physicsObj
.
topObj
=
word
;
scene
.
physics
.
add
.
collider
(
word
.
physicsObj
,
WordSpace
.
wordPhysicsGroup
,
function
(
object1
)
scene
.
physics
.
add
.
collider
(
word
.
physicsObj
,
WordSpace
.
wordPhysicsGroup
,
function
(
object1
)
{
{
if
(
object1
.
topObj
.
isForced
)
object1
.
topObj
.
isForced
=
false
;
if
(
object1
.
topObj
.
wordSpeed
>
0.5
)
object1
.
topObj
.
wordSpeed
=
0.05
;
});
});
scene
.
physics
.
add
.
collider
(
word
.
physicsObj
,
BackGround
.
brainGroup
);
scene
.
physics
.
add
.
collider
(
word
.
physicsObj
,
BackGround
.
brainGroup
);
WordSpace
.
wordPhysicsGroup
.
add
(
word
.
physicsObj
);
WordSpace
.
wordPhysicsGroup
.
add
(
word
.
physicsObj
);
...
...
js/main.js
View file @
6d3b8c47
...
@@ -39,7 +39,7 @@ function update()
...
@@ -39,7 +39,7 @@ function update()
{
{
WordSpace
.
wordForcedGroup
.
forEach
(
function
(
element
)
WordSpace
.
wordForcedGroup
.
forEach
(
function
(
element
)
{
{
element
.
attract
(
0.3
);
element
.
attract
();
});
});
}
}
...
...
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