Example #1
0
        private void Form1_Paint(object sender, System.Windows.Forms.PaintEventArgs e)
        {
            Graphics g = e.Graphics;

            g.FillRectangle(Brushes.White, 0, 0, this.ClientRectangle.Width, ClientRectangle.Height);

            TheMaze.Draw(g);

            // draw the score

            TheScore.Draw(g);

            // draw the time

            TheTime.Draw(g, TheSeconds);

            // Draw a message indicating the status of the game
            TheStatusMessage.Draw(g);

            // Draw a message indicating a Stone
            if (TheScore.Value == 1)
            {
                TheStoneMessage.Message = "Stone";
            }
            else
            {
                TheStoneMessage.Message = "Stones";
            }

            TheStoneMessage.Draw(g);


            // draw the stones

            for (int i = 0; i < Stones.Count; i++)
            {
                ((Stone)Stones[i]).Draw(g);
            }

            // also draw the eater
            TheEater.Draw(g);
        }
Example #2
0
        private void Form1_Paint(object sender, System.Windows.Forms.PaintEventArgs e)
        {
            Graphics g = e.Graphics;

            g.FillRectangle(Brushes.White, 0, 0, this.ClientRectangle.Width, ClientRectangle.Height);

            // draw the score
            TheScore.Draw(g);

            // draw the time
            TheTime.Draw(g, TheSeconds);

            // draw the stones
            for (int i = 0; i < Stones.Count; i++)
            {
                ((Stone)Stones[i]).Draw(g);
            }

            // also draw the eater
            TheEater.Draw(g);
        }