Remove auto rotate in the normal script and add F as a shoot key along with left click

This commit is contained in:
Lncvrt committed 2025-10-08 11:30:32 -07:00
1 parent 5f430f79b1
commit 4372f7862f
2 files changed
+2 -5

No files matched your search

+1 -4
View File
@@ -96,7 +96,7 @@ public class GamePlayer : MonoBehaviour
{ {
doMoveRight = true; doMoveRight = true;
} }
if (controllerJump || Keyboard.current.spaceKey.isPressed || Keyboard.current.upArrowKey.isPressed || Keyboard.current.wKey.isPressed || Keyboard.current.downArrowKey.isPressed || Keyboard.current.sKey.isPressed || Keyboard.current.kKey.isPressed || Keyboard.current.iKey.isPressed || Mouse.current.leftButton.isPressed || (Gamepad.current != null && Gamepad.current.buttonSouth.isPressed)) if (controllerJump || Keyboard.current.spaceKey.isPressed || Keyboard.current.upArrowKey.isPressed || Keyboard.current.wKey.isPressed || Keyboard.current.downArrowKey.isPressed || Keyboard.current.sKey.isPressed || Keyboard.current.kKey.isPressed || Keyboard.current.iKey.isPressed || (Gamepad.current != null && Gamepad.current.buttonSouth.isPressed))
{ {
doJump = true; doJump = true;
} }
@@ -124,13 +124,11 @@ public class GamePlayer : MonoBehaviour
{ {
bird.transform.position += new UnityEngine.Vector3(-movespeed, 0f, 0f); bird.transform.position += new UnityEngine.Vector3(-movespeed, 0f, 0f);
ClampPosition(bird); ClampPosition(bird);
bird.transform.localScale = new UnityEngine.Vector3(1.35f, 1.35f, 1.35f);
} }
if (doMoveRight && !doMoveLeft) if (doMoveRight && !doMoveLeft)
{ {
bird.transform.position += new UnityEngine.Vector3(movespeed, 0f, 0f); bird.transform.position += new UnityEngine.Vector3(movespeed, 0f, 0f);
ClampPosition(bird); ClampPosition(bird);
bird.transform.localScale = new UnityEngine.Vector3(-1.35f, 1.35f, 1.35f);
} }
if (doJump && isGrounded) if (doJump && isGrounded)
{ {
@@ -597,7 +595,6 @@ public class GamePlayer : MonoBehaviour
void Respawn() void Respawn()
{ {
bird.transform.position = new UnityEngine.Vector3(0f, -4.3f, 0f); bird.transform.position = new UnityEngine.Vector3(0f, -4.3f, 0f);
bird.transform.localScale = new UnityEngine.Vector3(1.35f, 1.35f, 1.35f);
rb.gravityScale = 0f; rb.gravityScale = 0f;
rb.linearVelocity = UnityEngine.Vector2.zero; rb.linearVelocity = UnityEngine.Vector2.zero;
score = 0; score = 0;
+1 -1
View File
@@ -51,7 +51,7 @@ public class GunHandler : MonoBehaviour
transform.rotation = Quaternion.Euler(0f, 0f, clamped); transform.rotation = Quaternion.Euler(0f, 0f, clamped);
if (Keyboard.current.leftShiftKey.wasPressedThisFrame || Keyboard.current.rightShiftKey.wasPressedThisFrame) if (Keyboard.current.leftShiftKey.wasPressedThisFrame || Keyboard.current.rightShiftKey.wasPressedThisFrame || Keyboard.current.fKey.wasPressedThisFrame || Mouse.current.leftButton.wasPressedThisFrame)
{ {
Vector3 offset = new(0.6932073f, 0.352302f, 0f); Vector3 offset = new(0.6932073f, 0.352302f, 0f);
if (flipped) offset.x = -offset.x; if (flipped) offset.x = -offset.x;