Example #1
0
    // Update is called once per frame
    void Update()
    {
        if (!Values.Dead)
        {
            MovePlayer();
            RotatePlayer();
            HUD.Weapon.sprite = HUD.Imgs [anim.GetInteger("WeaponType")];
            if (Input.GetMouseButtonDown(0) && !ThrowingBomb)
            {
                Attack();
            }
            else if (Input.GetMouseButtonDown(0) && ThrowingBomb)
            {
                if (Values.HaveBombs)
                {
                    Values.ThrowBomb();
                }
            }
            else if (Input.GetMouseButtonDown(1))
            {
                Shield();
            }
            if (Input.GetKeyDown(KeyCode.LeftShift) || Input.GetKeyDown(KeyCode.RightShift))
            {
                ChangeWeapon();
            }
            else if (Input.GetKeyDown(KeyCode.LeftControl) || Input.GetKeyDown(KeyCode.RightControl))
            {
                ThrowingBomb = !ThrowingBomb;
            }

            if (Input.GetKeyDown(KeyCode.Z))
            {
            }
            else if (Input.GetKeyDown(KeyCode.C))
            {
                Attack();
            }
        }



        HUD.Bullets.text = Values.GetBullets().ToString();
        HUD.Life.text    = Values.GetLife().ToString();
        HUD.Honor.text   = Values.GetHonors().ToString();
        HUD.Points.text  = Values.GetPoints().ToString();
    }