void Update() { if (Input.GetKeyDown(KeyCode.W) && !Input.GetKeyDown(KeyCode.D) && !Input.GetKeyDown(KeyCode.E)) { //LOOK UP bulletSide = 0; } if (!Input.GetKey(KeyCode.W) && Input.GetKey(KeyCode.D)) { pm.Movement(1); if (!rightSide && Input.GetKeyDown(KeyCode.D)) { rightSide = !rightSide; fc.Flip(); } bulletSide = 1; //walking animation } if (Input.GetKeyDown(KeyCode.W) && Input.GetKeyDown(KeyCode.D)) { //LOOK DIAGONALr //SHOOT DIAGONALr } if (!Input.GetKey(KeyCode.W) && Input.GetKey(KeyCode.A)) { pm.Movement(-1); if (rightSide && Input.GetKeyDown(KeyCode.A)) { rightSide = !rightSide; fc.Flip(); } bulletSide = 1; //walking animation } if (Input.GetKeyDown(KeyCode.W) && Input.GetKeyDown(KeyCode.A)) { //LOOK DIAGONALl //SHOOT DIAGONALl } if (Input.GetKeyDown(KeyCode.Q)) { pj.Jump(); //jump animation } if (Input.GetKeyDown(KeyCode.E)) { bs.Shoot(bulletSide); //shooting animation } }
void Update() { if (Input.GetKeyDown(KeyCode.UpArrow) && !Input.GetKeyDown(KeyCode.RightArrow) && !Input.GetKeyDown(KeyCode.LeftArrow)) { //LOOK UP bulletSide = 0; } if (!Input.GetKey(KeyCode.UpArrow) && Input.GetKey(KeyCode.RightArrow)) { pm.Movement(1); if (!rightSide && Input.GetKeyDown(KeyCode.RightArrow)) { rightSide = !rightSide; fc.Flip(); } bulletSide = 1; //walking animation } if (!Input.GetKey(KeyCode.UpArrow) && Input.GetKey(KeyCode.LeftArrow)) { pm.Movement(-1); if (rightSide && Input.GetKeyDown(KeyCode.LeftArrow)) { rightSide = !rightSide; fc.Flip(); } bulletSide = 1; //walking animation } if (Input.GetKeyDown(KeyCode.Semicolon)) { pj.Jump(); //jump animation } if (Input.GetKeyDown(KeyCode.RightShift)) { bs.Shoot(bulletSide); //shooting animation } }