Commit 91008069 authored by Chrysis248's avatar Chrysis248
Browse files

jump animation seedling

parent a813ff8a
......@@ -30,7 +30,10 @@ public abstract class Character : MonoBehaviour, VariableSoundPlayer.SoundOwner
public VariableSoundPlayer.ActivateSoundDelegate activateSound { get; set; } = delegate{};
public bool getGroundStatus()
{
return isGrounded;
}
void Awake()
{
rigidbody = GetComponent<Rigidbody2D>();
......
......@@ -2,6 +2,7 @@
public class InputManager : MonoBehaviour
{
public Animator animator;
[SerializeField] private Player player = null;
[SerializeField] private UI_SceneManager scene = null;
[SerializeField] private RopeSystem ropesys = null;
......@@ -21,6 +22,16 @@ public class InputManager : MonoBehaviour
// Update is called once per frame
void Update()
{
if (Input.GetButton("Horizontal"))
{
animator.SetFloat("speed", 1F);
}
if (Input.GetButtonUp("Horizontal"))
{
animator.SetFloat("speed", 0F);
}
if (Input.GetButtonDown("Cancel"))
{
scene.TogglePause();
......@@ -30,11 +41,25 @@ public class InputManager : MonoBehaviour
{
return;
}
if (Input.GetButtonDown("Jump"))
{
animator.SetBool("isJumping", true);
jump = true;
}
if (Input.GetButton("Jump"))
{
animator.SetBool("isJumping", true);
jump = true;
}
if (player.getGroundStatus())
{
animator.SetBool("isJumping", false);
}
if (Input.GetButtonDown("Attack"))
{
attack = true;
......
......@@ -140,6 +140,8 @@ public class RopeSystem : MonoBehaviour, VariableSoundPlayer.SoundOwner
if (hit.collider.GetComponentInParent<PullableObject>() != null)
{
ropeAttached = true;
ropePositions.Add(hit.point);
wrapPointsLookup.Add(hit.point, 0);
springJoint.enabled = true;
springJoint.distance = Vector2.Distance(playerPosition, hit.point);
springJoint.connectedBody = hit.collider.GetComponentInParent<Rigidbody2D>();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment