Add prompt to enter levels, add sprint button

This commit is contained in:
2022-08-29 01:43:16 -07:00
parent 571639f8d1
commit 82bf43452b
18 changed files with 1760 additions and 333 deletions

View File

@@ -24,11 +24,14 @@ namespace Scampz.GameJam.Assets.Scripts
void Move()
{
var movementSpeed = Speed;
if (Input.GetButton(InputOptions.Sprint))
movementSpeed *= 2;
var horizontalMovement = Input.GetAxisRaw(InputOptions.Horizontal);
var verticalMovement = Input.GetAxisRaw(InputOptions.Vertical);
var movementDirection = new Vector3(-horizontalMovement, 0, -verticalMovement);
var magnitude = Mathf.Clamp01(movementDirection.magnitude) * Speed;
var magnitude = Mathf.Clamp01(movementDirection.magnitude) * movementSpeed;
movementDirection.Normalize();
_ySpeed += Physics.gravity.y * Time.deltaTime;