diff options
author | Mikkel Bybjerg <mikkel.bybjerg@hotmail.com> | 2019-04-27 14:41:12 +0200 |
---|---|---|
committer | Mikkel Bybjerg <mikkel.bybjerg@hotmail.com> | 2019-04-27 14:41:12 +0200 |
commit | 9222754ebc29c533d70c283896895dfb852c3cdc (patch) | |
tree | e5aa97af26662734815b7ac8820f536dbbaccdb5 /nGJ2019 | |
parent | 157b333e762ab61b6aa9eea1f10469081c143c03 (diff) |
merge
Diffstat (limited to 'nGJ2019')
-rw-r--r-- | nGJ2019/Assets/Scripts/DragonMovement.cs | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/nGJ2019/Assets/Scripts/DragonMovement.cs b/nGJ2019/Assets/Scripts/DragonMovement.cs index 4ba179d..24b6666 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,7 @@ public class DragonMovement : MonoBehaviour EnemyCollider enemy = other.gameObject.GetComponent<EnemyCollider>(); if(enemy != null) { - Debug.Log(enemy.type == ObstacleType.alfa ? "alfa hit" : "beta hit"); + //Debug.Log(enemy.type == ObstacleType.alfa ? "alfa hit" : "beta hit"); healthBar.health--; } } |