mirror of
https://github.com/frizbee19/FebGameJam.git
synced 2026-09-11 08:17:01 +00:00
Main Menu pog
This commit is contained in:
1 parent
1394b0051e
commit
973f0153a3
99 files changed
+14446
-51
No files matched your search
@@ -0,0 +1,35 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class PlayerMovement : MonoBehaviour
|
||||
{
|
||||
public Movement controller;
|
||||
float horizontalMove = 0f;
|
||||
public float runSpeed = 40f;
|
||||
bool jump = false;
|
||||
bool crouch = false;
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
horizontalMove = Input.GetAxisRaw("Horizontal") * runSpeed;
|
||||
if (Input.GetButtonDown("Jump"))
|
||||
{
|
||||
jump = true;
|
||||
}
|
||||
if (Input.GetKeyDown(KeyCode.LeftShift))
|
||||
{
|
||||
crouch = true;
|
||||
} else if (Input.GetKeyUp(KeyCode.LeftShift))
|
||||
{
|
||||
crouch = false;
|
||||
}
|
||||
}
|
||||
|
||||
void FixedUpdate()
|
||||
{
|
||||
controller.Move(horizontalMove *Time.fixedDeltaTime, crouch, jump);
|
||||
jump = false;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user