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
0688c38f
Commit
0688c38f
authored
Jan 10, 2019
by
abpo11
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
플레이어 점프 및 이동속도가 U단위로 재설정됨. 로프를 탈 때 좌우 방향키를 누르면 로프 점프를 무시함. 기타 버그수정
parent
78d115be
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
29 deletions
+32
-29
PlayScene.unity
Assets/Scenes/PlayScene.unity
+9
-10
PlayerController.cs
Assets/Scripts/Characters/PlayerController.cs
+23
-19
No files found.
Assets/Scenes/PlayScene.unity
View file @
0688c38f
...
...
@@ -253,14 +253,13 @@ MonoBehaviour:
m_Script
:
{
fileID
:
11500000
,
guid
:
f289cad4933d4bf42ae5c82c57bd88e4
,
type
:
3
}
m_Name
:
m_EditorClassIdentifier
:
maxSpeed
:
300
speed
:
600
speedAir
:
5
jumpSpeed
:
400
ropeSpeed
:
200
doubleJumpSpeed
:
400
dashSpeed
:
1000
dashDelay
:
0
maxSpeed
:
5
maxDashSpeed
:
10
accerlation
:
600
jumpSpeed
:
10
ropeSpeed
:
3
doubleJumpSpeed
:
10
dashAccerlation
:
1000
isDashing
:
0
platformArray
:
[]
horizontal
:
0
...
...
@@ -280,8 +279,8 @@ MonoBehaviour:
m_Bits
:
4096
ropeDistance
:
0.3
rayDistance
:
1
ropeUp
:
0.
5
ropeDown
:
0.
5
ropeUp
:
0.
6
ropeDown
:
0.
7
---
!u!212
&489222436
SpriteRenderer
:
m_ObjectHideFlags
:
0
...
...
Assets/Scripts/Characters/PlayerController.cs
View file @
0688c38f
...
...
@@ -11,9 +11,9 @@ public class PlayerController : MonoBehaviour
[
SerializeField
]
private
float
maxSpeed
;
[
SerializeField
]
private
float
s
peed
;
private
float
maxDashS
peed
;
[
SerializeField
]
private
float
speedAir
;
private
float
accerlation
;
[
SerializeField
]
private
float
jumpSpeed
;
[
SerializeField
]
...
...
@@ -21,9 +21,7 @@ public class PlayerController : MonoBehaviour
[
SerializeField
]
private
float
doubleJumpSpeed
;
[
SerializeField
]
private
float
dashSpeed
;
[
SerializeField
]
private
float
dashDelay
;
private
float
dashAccerlation
;
[
SerializeField
]
private
bool
isDashing
=
false
;
public
TilemapCollider2D
[]
platformArray
;
...
...
@@ -100,10 +98,10 @@ public class PlayerController : MonoBehaviour
StartCoroutine
(
RopeDelay
());
}
rb
.
velocity
=
new
Vector2
(
0f
,
verticalRaw
*
Time
.
smoothDeltaTime
*
ropeSpeed
);
rb
.
velocity
=
new
Vector2
(
0f
,
verticalRaw
*
ropeSpeed
);
}
else
if
(
verticalRaw
!=
0
&&
ropeEnabled
)
else
if
(
verticalRaw
!=
0
&&
ropeEnabled
&&
horizontalRaw
==
0
)
{
isInRope
=
true
;
rb
.
gravityScale
=
0f
;
...
...
@@ -123,11 +121,11 @@ public class PlayerController : MonoBehaviour
{
if
(
isGrounded
)
{
vertical
=
jumpSpeed
*
Time
.
smoothDeltaTime
;
vertical
=
jumpSpeed
;
}
else
if
(
isJumpable
)
{
vertical
=
doubleJumpSpeed
*
Time
.
smoothDeltaTime
;
vertical
=
doubleJumpSpeed
;
isJumpable
=
false
;
}
}
...
...
@@ -172,18 +170,18 @@ public class PlayerController : MonoBehaviour
if
(
isDashing
)
rb
.
AddForce
(
horizontalRaw
*
dash
Speed
*
Time
.
smoothDeltaTime
*
Vector2
.
right
);
rb
.
AddForce
(
horizontalRaw
*
dash
Accerlation
*
Time
.
smoothDeltaTime
*
Vector2
.
right
);
else
rb
.
AddForce
(
horizontalRaw
*
speed
*
Time
.
smoothDeltaTime
*
Vector2
.
right
);
rb
.
AddForce
(
horizontalRaw
*
accerlation
*
Time
.
smoothDeltaTime
*
Vector2
.
right
);
if
(((
horizontalRaw
==
0
)
||
(
rb
.
velocity
.
x
>
0
&&
horizontalRaw
<
0
)
||
(
rb
.
velocity
.
x
<
0
&&
horizontalRaw
>
0
))
&&
(
isGrounded
))
{
rb
.
AddForce
(
rb
.
velocity
.
x
*
(-
10f
)
*
Vector2
.
right
);
rb
.
AddForce
(
rb
.
velocity
.
x
*
(-
10f
)
*
Vector2
.
right
*
Time
.
smoothDeltaTime
);
}
rb
.
velocity
=
new
Vector2
(
Mathf
.
Clamp
(
rb
.
velocity
.
x
,
-
maxSpeed
*
(
isDashing
?
1.5f
:
1f
)
*
Time
.
smoothDeltaTime
,
maxSpeed
*(
isDashing
?
1.5f
:
1f
)
*
Time
.
smoothDeltaTime
),
vertical
);
if
(
isDashing
)
rb
.
velocity
=
new
Vector2
(
Mathf
.
Clamp
(
rb
.
velocity
.
x
,
-
maxDashSpeed
,
maxDashSpeed
),
vertical
);
else
rb
.
velocity
=
new
Vector2
(
Mathf
.
Clamp
(
rb
.
velocity
.
x
,
-
maxSpeed
,
maxSpeed
),
vertical
);
}
jump
=
false
;
}
...
...
@@ -209,10 +207,16 @@ public class PlayerController : MonoBehaviour
}
public
IEnumerator
DownPlatform
()
{
platformArray
[
2
].
enabled
=
false
;
yield
return
new
WaitForSeconds
(
0.3f
);
platformArray
[
2
].
enabled
=
true
;
isDownPlatform
=
false
;
foreach
(
TilemapCollider2D
element
in
platformArray
)
{
if
(
element
.
name
==
"platform"
)
{
element
.
enabled
=
false
;
yield
return
new
WaitForSeconds
(
0.3f
);
element
.
enabled
=
true
;
isDownPlatform
=
false
;
}
}
}
public
IEnumerator
RopeDelay
()
{
...
...
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