Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
dyingIsMainstream
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
2
Issues
2
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gamejam-gpn15
dyingIsMainstream
Commits
ff0e9958
Commit
ff0e9958
authored
Jun 05, 2015
by
Philipp Adolf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make dash cool down longer on collision
parent
290b428f
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
2 deletions
+7
-2
PlayerControl.cs
Assets/Scripts/PlayerControl.cs
+7
-2
No files found.
Assets/Scripts/PlayerControl.cs
View file @
ff0e9958
...
...
@@ -21,6 +21,9 @@ public class PlayerControl : MonoBehaviour
public
float
dashStartSpeed
=
20.0f
;
public
float
dashEndSpeed
=
8.0f
;
public
float
dashCoolDown
=
0.5f
;
public
float
dashCollisionCoolDown
=
1.5f
;
[
HideInInspector
]
public
float
currentDashCoolDown
=
0.0f
;
// public float jumpWaitTime = 2.0;
[
HideInInspector
]
...
...
@@ -77,7 +80,8 @@ public class PlayerControl : MonoBehaviour
{
//TODO abfrage " is dashing"
body
.
AddForce
(
_controller
.
getDirectionOfMovement
()
*
pushForce
);
//TODO set is dashing to false
lastDashStart
=
Time
.
time
-
dashCompletionTime
;
currentDashCoolDown
=
dashCollisionCoolDown
;
}
}
...
...
@@ -102,6 +106,7 @@ public class PlayerControl : MonoBehaviour
{
lastDashStart
=
Time
.
time
;
currentDashDirection
=
dashDirection
;
currentDashCoolDown
=
dashCoolDown
;
}
if
(
isDashing
())
...
...
@@ -179,7 +184,7 @@ public class PlayerControl : MonoBehaviour
private
bool
canDash
()
{
return
getDashTime
()
>=
dashCompletionTime
+
d
ashCoolDown
;
return
getDashTime
()
>=
dashCompletionTime
+
currentD
ashCoolDown
;
}
/*==========Power Ups // Bullet management ===*/
...
...
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