Commit c3cb9d31 by Philipp Adolf

Add up and down keys

parent 6fcab720
...@@ -5,7 +5,7 @@ using System.Collections; ...@@ -5,7 +5,7 @@ using System.Collections;
public class PlayerControl : MonoBehaviour public class PlayerControl : MonoBehaviour
{ {
private enum Keys : int { Left = 0, Right, Jump, Dash, Shoot }; private enum Keys : int { Left = 0, Right, Up, Down, Jump, Dash, Shoot };
// movement config // movement config
public float pushForce = 20f; public float pushForce = 20f;
...@@ -52,7 +52,9 @@ public class PlayerControl : MonoBehaviour ...@@ -52,7 +52,9 @@ public class PlayerControl : MonoBehaviour
case 1: case 1:
keyCodes[(int)Keys.Right] = KeyCode.D; keyCodes[(int)Keys.Right] = KeyCode.D;
keyCodes[(int)Keys.Left] = KeyCode.A; keyCodes[(int)Keys.Left] = KeyCode.A;
keyCodes[(int)Keys.Jump] = KeyCode.W; keyCodes[(int)Keys.Up] = KeyCode.W;
keyCodes[(int)Keys.Jump] = keyCodes[(int)Keys.Up];
keyCodes[(int)Keys.Down] = KeyCode.S;
keyCodes[(int)Keys.Dash] = KeyCode.Space; keyCodes[(int)Keys.Dash] = KeyCode.Space;
keyCodes[(int)Keys.Shoot] = KeyCode.LeftShift; keyCodes[(int)Keys.Shoot] = KeyCode.LeftShift;
break; break;
...@@ -60,7 +62,9 @@ public class PlayerControl : MonoBehaviour ...@@ -60,7 +62,9 @@ public class PlayerControl : MonoBehaviour
case 2: case 2:
keyCodes[(int)Keys.Right] = KeyCode.RightArrow; keyCodes[(int)Keys.Right] = KeyCode.RightArrow;
keyCodes[(int)Keys.Left] = KeyCode.LeftArrow; keyCodes[(int)Keys.Left] = KeyCode.LeftArrow;
keyCodes[(int)Keys.Jump] = KeyCode.UpArrow; keyCodes[(int)Keys.Up] = KeyCode.UpArrow;
keyCodes[(int)Keys.Jump] = keyCodes[(int)Keys.Up];
keyCodes[(int)Keys.Down] = KeyCode.DownArrow;
keyCodes[(int)Keys.Dash] = KeyCode.RightControl; keyCodes[(int)Keys.Dash] = KeyCode.RightControl;
keyCodes[(int)Keys.Shoot] = KeyCode.RightShift; keyCodes[(int)Keys.Shoot] = KeyCode.RightShift;
break; break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment