阵列计数器不工作

时间:2013-06-06 17:00:23

标签: c# wpf

我正在尝试使用放在屏幕上的图像数组制作一个计数器,在3秒后,图像应该消失,但它们不会消失,我正在删除deleteMole()中的图像,并创建并在createImage()中命名图像。

任何帮助?

uint[] CounterArray;

// Change Image from "Hut" to Mole \\
private void ChangeImage()
{
    int NumberofImages = Convert.ToInt32(NumofImages);
    MoleList = new uint[NumberofImages];
    string Moleimage = TUtils.GetIniFileString(Moleini, "ImagePath", "PictureFile", Root + "mole2.png");

    if (NameCount == NumberofImages)
        NameCount = -1;

    NameCount++;

    Image newImage = HoleImage();

    molePopup = MoleImage();

        Image mole = new Image();

        Grid.SetColumn(mole, ranCol);
        Grid.SetRow(mole, ranRow);
        grid_Main.Children.Add(mole);

        for (NameCount = 0; NameCount < NumofImages; NameCount++)
        {
            CounterArray = new uint[3];
        }

    //Calling MoileLifeCounter for Mole Death
        moleLifeCounter();

        mole.MouseUp += new MouseButtonEventHandler((o, e) =>
            {
                grid_Main.Children.Remove(mole);
                MolePoints++;
            });
}

//Make Mole Disapear 
private void deleteMole()
{

    NumofImages = TUtils.GetIniInt(Moleini, "NumPictures", "pictures", 8);
    NumberofImages = Convert.ToInt32(NumofImages);

    for (int j = 0; j < NumofImages; j++)
    {

        CounterArray[j]--;

        if (CounterArray[j] == 0)
        {

//Delete Image
        }

        else
        {

            break;
        }

    }

}

}

0 个答案:

没有答案