예제 #1
0
 private void DrawMove(ListOfAquaPeople swimmers)
 {
     for (int i = 0; i < swimmers.residents.Count; i++)
     {
         if (swimmers.residents.ElementAt(i).Death)
         {
             g.DrawImage(Image.FromFile("death.png"), swimmers.residents.ElementAt(i).X, swimmers.residents.ElementAt(i).Y, 150, 150);
             swimmers.residents.RemoveAt(i);
             continue;
         }
         if (swimmers.residents.ElementAt(i).Y < 650)
         {
             DrawFish(swimmers.residents.ElementAt(i));
         }
         else
         {
             DrawSnail(swimmers.residents.ElementAt(i));
         }
         DrawHealth(swimmers.residents.ElementAt(i).lifeRec, swimmers.residents.ElementAt(i).health);
     }
 }
예제 #2
0
 private void DrawMoveFish(ListOfAquaPeople swimmers)
 {
     for (int i = 0; i < swimmers.residents.Count; i++)
     {
         if (swimmers.residents.ElementAt(i).Death)
         {
             g.DrawImage(Image.FromFile("death.png"), swimmers.residents.ElementAt(i).X, swimmers.residents.ElementAt(i).Y, 150, 150);
             swimmers.residents.RemoveAt(i);
             continue;
         }
         if (swimmers.residents.ElementAt(i).turn)
         {
             if (swimmers.residents.ElementAt(i).health != 0)
             {
                 g.DrawImage(rightfish, swimmers.residents.ElementAt(i).X, swimmers.residents.ElementAt(i).Y, swimmers.residents.ElementAt(i).Width, swimmers.residents.ElementAt(i).Height);
                 swimmers.residents.ElementAt(i).turn = false;
             }
             else
             {
                 g.DrawImage(rightdiefish, swimmers.residents.ElementAt(i).X, swimmers.residents.ElementAt(i).Y, swimmers.residents.ElementAt(i).Width, swimmers.residents.ElementAt(i).Height);
             }
         }
         else
         {
             if (swimmers.residents.ElementAt(i).health != 0)
             {
                 g.DrawImage(leftfish, swimmers.residents.ElementAt(i).X, swimmers.residents.ElementAt(i).Y, 150, 95);
             }
             else
             {
                 ///
                 g.DrawImage(leftdiefish, swimmers.residents.ElementAt(i).X, swimmers.residents.ElementAt(i).Y, swimmers.residents.ElementAt(i).Width, swimmers.residents.ElementAt(i).Height);
             }
         }
         DrawHealth(swimmers.residents.ElementAt(i).lifeRec, swimmers.residents.ElementAt(i).health);
     }
 }