aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Assets/Scripts/Controllers/Player/PlayerController.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Assets/Scripts/Controllers/Player/PlayerController.cs')
-rw-r--r--Assets/Scripts/Controllers/Player/PlayerController.cs7
1 files changed, 6 insertions, 1 deletions
diff --git a/Assets/Scripts/Controllers/Player/PlayerController.cs b/Assets/Scripts/Controllers/Player/PlayerController.cs
index 8aa0f25..1360b6c 100644
--- a/Assets/Scripts/Controllers/Player/PlayerController.cs
+++ b/Assets/Scripts/Controllers/Player/PlayerController.cs
@@ -21,6 +21,8 @@ namespace Controllers.Player
public PlayerSegment root => segments[0];
+ private float ShootStartTime;
+
private void Awake()
{
foreach (var segment in segments) {
@@ -98,7 +100,10 @@ namespace Controllers.Player
// Try shooting the ball if pressed.
if (Input.GetKeyDown(controls.shoot))
- game.player.Shoot(segments.Last().transform);
+ ShootStartTime = Time.time;
+
+ if (Input.GetKeyUp(controls.shoot))
+ game.player.Shoot(segments.Last().transform, ShootStartTime - Time.time);
}
[Serializable]