示例#1
0
        private void Form1_Paint(object sender, PaintEventArgs e)
        {
            food.drawfood(paper);
            paper = e.Graphics;
            Snake.snakedraw(paper);

            for (int i = 0; i < Snake.snakerec.Length; i++)
            {
                if (Snake.snakerec[i].IntersectsWith(food.foodrec))
                {
                    food.fooloc(randfood);
                }
            }
        }
示例#2
0
        int score  = 0;    //score


        private void Form1_Paint(object sender, PaintEventArgs e)
        {
            paper = e.Graphics;
            food.drawfood(paper);
            snakes.drawSnake(paper);
        }