示例#1
0
//  // Called every frame. 'delta' is the elapsed time since the previous frame.
    public override void _Process(float delta)
    {
        ProcessInput(delta);
        switch (currentWeapon)
        {
        case (Weapons.REPEATER):
            iconRptr.SetModulate(new Color(1, 1, 1, 1));
            iconGren.SetModulate(new Color(1, 1, 1, 0.5f));
            iconShot.SetModulate(new Color(1, 1, 1, 0.5f));
            iconFlam.SetModulate(new Color(1, 1, 1, 0.5f));
            coolSpeed    = coolRepeater;
            ammoNum.Text = bullets.ToString();

            break;

        case (Weapons.BUCKSHOT):
            iconRptr.SetModulate(new Color(1, 1, 1, 0.5f));
            iconGren.SetModulate(new Color(1, 1, 1, 0.5f));
            iconShot.SetModulate(new Color(1, 1, 1, 1));
            iconFlam.SetModulate(new Color(1, 1, 1, 0.5f));
            coolSpeed    = coolBuckshot;
            ammoNum.Text = shells.ToString();
            break;

        case (Weapons.GRENADES):
            iconRptr.SetModulate(new Color(1, 1, 1, 0.5f));
            iconGren.SetModulate(new Color(1, 1, 1, 1));
            iconShot.SetModulate(new Color(1, 1, 1, 0.5f));
            iconFlam.SetModulate(new Color(1, 1, 1, 0.5f));
            coolSpeed    = coolGrenades;
            ammoNum.Text = grenades.ToString();
            break;

        case (Weapons.FLAMETHROWER):
            iconRptr.SetModulate(new Color(1, 1, 1, 0.5f));
            iconGren.SetModulate(new Color(1, 1, 1, 0.5f));
            iconShot.SetModulate(new Color(1, 1, 1, 0.5f));
            iconFlam.SetModulate(new Color(1, 1, 1, 1));
            coolSpeed = coolFlames;
            int fuelInt = (int)player.fuel;
            ammoNum.Text = fuelInt.ToString();
            break;
        }
        coolMeter.Value -= coolSpeed * 100 * delta;
    }