Beispiel #1
0
    //Use this for gliding over fires
    //void Updraft() {

    /*
     * At the moment this is just bound to a key,
     * this will be changed when we have a fire object and a way to check for collision
     * between the dragon and the air above a fire.
     */
    //rigidbody.AddForce(new Vector2(0, 1.25F * velocity));
    //}

    // Update is called once per frame
    public virtual void Update()
    {
        Input.simulateMouseWithTouches = true;

        if (Input.GetMouseButtonDown(0) && health.HasStamina && clickLeft())
        {
            rigidbody.AddForce(new Vector2(velocity * .55F, velocity));
            health.ChangeStamina(-1);
            Audi.Play();
        }
        if (Input.GetKeyDown(KeyCode.LeftAlt))
        {
            //Updraft();
        }
    }