diff options
author | Marcin Zelent <zelent.marcin@gmail.com> | 2019-04-27 15:23:36 +0200 |
---|---|---|
committer | Marcin Zelent <zelent.marcin@gmail.com> | 2019-04-27 15:23:36 +0200 |
commit | 86487f113676b9cbe728902469af10a2dd42222b (patch) | |
tree | 4f6efcb3418f6b6f7b42d91715013e19bf0f898e /nGJ2019/Assets | |
parent | 7539e35ce26437c5aa0325936dea68132408c8b0 (diff) | |
parent | 262be7cfa429a30bafec50efe8fb2154d73e2eeb (diff) |
Merge branch 'master' of https://github.com/marcinzelent/ngj2019
Diffstat (limited to 'nGJ2019/Assets')
-rw-r--r-- | nGJ2019/Assets/Scripts/DragonMovement.cs | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/nGJ2019/Assets/Scripts/DragonMovement.cs b/nGJ2019/Assets/Scripts/DragonMovement.cs index 9ae8fbb..f2c1cb5 100644 --- a/nGJ2019/Assets/Scripts/DragonMovement.cs +++ b/nGJ2019/Assets/Scripts/DragonMovement.cs @@ -169,6 +169,7 @@ public class DragonMovement : MonoBehaviour void Update() { + // keyboard scheme if(Input.GetKey("w")) moveUp(); if(Input.GetKey("a")) @@ -192,6 +193,32 @@ public class DragonMovement : MonoBehaviour turnSpread(); if(Input.GetKeyUp("k")) turnAntiSpread(); + + + // xbox scheme + if(Input.GetAxis("JoystickY") > 0.5f) + moveUp(); + if(Input.GetAxis("JoystickX") < -0.5f) + moveLeft(); + if(Input.GetAxis("JoystickY") < -0.5f) + moveDown(); + if(Input.GetAxis("JoystickX") > 0.5f) + moveRight(); + + if(Input.GetButtonDown("X")) + turnSwirl(); + if(Input.GetButtonUp("X")) + turnAntiSwirl(); + + if(Input.GetButtonDown("A")) + turnSlim(); + if(Input.GetButtonUp("A")) + turnAntiSlim(); + + if(Input.GetButtonDown("Y")) + turnSpread(); + if(Input.GetButtonUp("Y")) + turnAntiSpread(); } void OnDrawGizmosSelected() @@ -205,7 +232,6 @@ public class DragonMovement : MonoBehaviour EnemyCollider enemy = other.gameObject.GetComponent<EnemyCollider>(); if(enemy != null) { - Debug.Log(enemy.type == ObstacleType.narrowPassage ? "alfa hit" : "beta hit"); healthBar.health--; } } |