示例#1
0
 private void Form1_Click(object sender, EventArgs e)
 {
     x = MousePosition.X;
     y = MousePosition.Y;
     if (y <= 650)
     {
         if (!fishFlag && foodFlag)
         {
             world.CreateFood(x, y);
             world.FoodExist();
         }
         if (fishFlag)
         {
             g.DrawImage(Image.FromFile("background.png"), 0, 0);
             world.Add(new FishAdult(g, x, y));
             BackgroundImage = bmp;
             fishFlag        = false;
         }
     }
     else
     {
         if (snailFlag)
         {
             g.DrawImage(Image.FromFile("background.png"), 0, 0);
             world.Add(new Snail(g, x, y));
             BackgroundImage = bmp;
             snailFlag       = false;
         }
         else
         {
             snailCount--;
         }
     }
 }