using UnityEngine;
using System.Collections;
using System;

public class RangedWapeon : ItemScript {

    public float range;
    //Vector3 velocity;
    //float gravity;

    //float throwHeight = 0.5f;
    //float timeToThrowApex = .3f;
    //float throwVelocity;


    // Use this for initialization
    void Start () {
        if (range == 0) range = 5;
    }
	
	// Update is called once per frame
	void Update () {

    }

    public override bool use(int direction)
    {
        GetComponent<Rigidbody2D>().isKinematic = false;
        GetComponent<Rigidbody2D>().AddForce(new Vector2(40 * direction * range, 10 * range));
        Invoke("looseFocus", 2);
        return false;
    }  

}
