Beispiel #1
0
        void chuyenvitri()
        {
            Random rd = new Random();
            int    x  = rd.Next(panelMain.Width - 108);
            int    y  = rd.Next(panelMain.Height - 50);

            label1.Location = new Point(x, y);
            label1.Text     = WordGenerator.GetRandomWord();
        }
Beispiel #2
0
        private void timer1_Tick(object sender, EventArgs e)
        {
            Random rd = new Random();
            int    x  = rd.Next(panelMain.Width - 108);
            int    y  = rd.Next(panelMain.Height - 50);

            label1.Location = new Point(x, y);
            label1.Text     = WordGenerator.GetRandomWord();
            progressBar1.PerformStep();
            if (progressBar1.Value >= progressBar1.Maximum)
            {
                EndGame();
            }
        }