Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
tetra-tower
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Oenos
tetra-tower
Commits
76f84d6b
Commit
76f84d6b
authored
Sep 30, 2018
by
16도재형
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Little changes
parent
48177f4b
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
5 deletions
+5
-5
PlayScene.unity
Assets/Scenes/PlayScene.unity
+2
-2
PlayerController.cs
Assets/Scripts/Characters/PlayerController.cs
+3
-3
No files found.
Assets/Scenes/PlayScene.unity
View file @
76f84d6b
...
@@ -339,8 +339,8 @@ MonoBehaviour:
...
@@ -339,8 +339,8 @@ MonoBehaviour:
m_Name
:
m_Name
:
m_EditorClassIdentifier
:
m_EditorClassIdentifier
:
speed
:
300
speed
:
300
jumpSpeed
:
1
0
jumpSpeed
:
40
0
doubleJumpSpeed
:
1
0
doubleJumpSpeed
:
40
0
groundLayer
:
groundLayer
:
serializedVersion
:
2
serializedVersion
:
2
m_Bits
:
256
m_Bits
:
256
...
...
Assets/Scripts/Characters/PlayerController.cs
View file @
76f84d6b
...
@@ -52,11 +52,11 @@ public class PlayerController : MonoBehaviour {
...
@@ -52,11 +52,11 @@ public class PlayerController : MonoBehaviour {
{
{
if
(
isGrounded
)
if
(
isGrounded
)
{
{
vertical
=
jumpSpeed
;
vertical
=
jumpSpeed
*
Time
.
fixedDeltaTime
;
}
}
else
if
(
isJumpable
)
else
if
(
isJumpable
)
{
{
vertical
=
doubleJumpSpeed
;
vertical
=
doubleJumpSpeed
*
Time
.
fixedDeltaTime
;
isJumpable
=
false
;
isJumpable
=
false
;
}
}
}
}
...
@@ -67,7 +67,7 @@ public class PlayerController : MonoBehaviour {
...
@@ -67,7 +67,7 @@ public class PlayerController : MonoBehaviour {
bool
IsGrounded
()
// Is player grounded?
bool
IsGrounded
()
// Is player grounded?
{
{
RaycastHit2D
hit
=
Physics2D
.
Raycast
(
transform
.
position
,
Vector2
.
down
,
rayDistance
,
groundLayer
);
RaycastHit2D
hit
=
Physics2D
.
Raycast
(
transform
.
position
,
Vector2
.
down
,
rayDistance
,
groundLayer
);
Debug
.
DrawRay
(
transform
.
position
,
rayDistance
*
Vector2
.
down
,
Color
.
white
);
Debug
.
DrawRay
(
transform
.
position
,
rayDistance
*
Vector2
.
down
,
Color
.
white
);
return
hit
.
collider
!=
null
;
return
hit
.
collider
!=
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