using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class BallScript : MonoBehaviour
{
    public Rigidbody2D rb2dBall;
    bool isJumping;


    void Update()
    {
     
    }
    
    void OnTriggerStay2D(Collider2D col)
    {
        isJumping = false;
    }
    void OnTriggerExit2D(Collider2D col)
    {
        isJumping = true;
    }
    public void TryJump(float power)
    {
        if (!isJumping)
        {

            rb2dBall.AddForce(Vector3.up * power, ForceMode2D.Impulse);
        }
    }

}
