mirror of
https://github.com/frizbee19/FebGameJam.git
synced 2026-09-11 08:17:01 +00:00
hehe forgor to push double jump memes
This commit is contained in:
1 parent
70cbc01c25
commit
4c7900d435
5 files changed
+33
-22
No files matched your search
@@ -21,6 +21,7 @@ public class Movement : MonoBehaviour
|
||||
private bool m_FacingRight = true; // For determining which way the player is currently facing.
|
||||
private Vector3 m_Velocity = Vector3.zero;
|
||||
public static bool pause = false;
|
||||
private bool dj = false;
|
||||
|
||||
[Header("Events")]
|
||||
[Space]
|
||||
@@ -135,6 +136,11 @@ public class Movement : MonoBehaviour
|
||||
// Add a vertical force to the player.
|
||||
m_Grounded = false;
|
||||
m_Rigidbody2D.AddForce(new Vector2(0f, m_JumpForce));
|
||||
dj = false;
|
||||
}else if (jump && dj == false){
|
||||
m_Grounded = false;
|
||||
m_Rigidbody2D.AddForce(new Vector2(0f, m_JumpForce));
|
||||
dj = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ using UnityEngine;
|
||||
public class PlayerMovement : MonoBehaviour
|
||||
{
|
||||
public Movement controller;
|
||||
public Animator animator;
|
||||
//public Animator animator;
|
||||
public float runSpeed = 40f;
|
||||
float horizontalMove = 0f;
|
||||
bool jump = false;
|
||||
@@ -14,7 +14,7 @@ public class PlayerMovement : MonoBehaviour
|
||||
// Update is called once per frame
|
||||
void Update() {
|
||||
// Horizontal value is for the animation state machine. No code required, wow!
|
||||
animator.SetFloat("Horizontal", Input.GetAxis("Horizontal"));
|
||||
//animator.SetFloat("Horizontal", Input.GetAxis("Horizontal"));
|
||||
|
||||
horizontalMove = Input.GetAxisRaw("Horizontal") * runSpeed;
|
||||
|
||||
|
||||
Reference in new issue
Block a user