From 7082931f3af843eab47ddca054683b49abedc6ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-S=C3=A9bastien=20Gervais?= Date: Fri, 8 Apr 2016 19:17:22 -0400 Subject: [PATCH] =?UTF-8?q?d=C3=A9asctiv=C3=A9=20R=20pour=20le=20dash,=20s?= =?UTF-8?q?e=20fait=20maintenant=20par=20un=20double=20jump.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/Scripts/Astronaut.cs | 16 ++++++++++++++-- Assets/Scripts/AstronautController.cs | 17 ++++++++++------- 2 files changed, 24 insertions(+), 9 deletions(-) diff --git a/Assets/Scripts/Astronaut.cs b/Assets/Scripts/Astronaut.cs index 943fcf7..7bae079 100644 --- a/Assets/Scripts/Astronaut.cs +++ b/Assets/Scripts/Astronaut.cs @@ -197,13 +197,25 @@ public class Astronaut : MonoBehaviour { theta = newTheta; } + if (State == AstronautState.Dashing && grounded) + { + //TODO arreter mouvelement lateral + State=AstronautState.Idle; + } } public void Jump() { - if (State >= AstronautState.Ejecting || State == AstronautState.Jumping) + if (State >= AstronautState.Ejecting) return; - if (!grounded) return; + if (State == AstronautState.Jumping) + { + Dash(); + State=AstronautState.Dashing; //TODO relacher l'état Dashing + return; + + } + if (!grounded) return; vSpeed = JumpSpeed; grounded = false; State = AstronautState.Jumping; diff --git a/Assets/Scripts/AstronautController.cs b/Assets/Scripts/AstronautController.cs index c830cde..3ff2ed7 100644 --- a/Assets/Scripts/AstronautController.cs +++ b/Assets/Scripts/AstronautController.cs @@ -49,14 +49,17 @@ public class AstronautController : MonoBehaviour { _astronaut.Move(xValue, yValue); - if (input.Ranges.ContainsKey("Dash")) - { - if (input.Ranges["Dash"] > 0.8f) - { - _astronaut.Dash(); - } + + // le dash se fait par double jump avec un state change. + + //if (input.Ranges.ContainsKey("Dash")) + //{ + // if (input.Ranges["Dash"] > 0.8f) + // { + // _astronaut.Dash(); + // } - } + //} } private void HandlePlayerButtons(MappedInput input)