예제 #1
0
 public bool OutsideWorldFrame(PictureBox tar)
 {
     if (tar.Location.X < 0) //czy wychodzi z lewej lub prawej strony
     {
         return(true);
     }
     if (tar.Location.X > WorldFrame.Width)
     {
         return(true);
     }
     return(tar.Location.Y + tar.Height > WorldFrame.Height - 3 || WorldObjects1.Where(obj => obj != null).Any(obj => tar.Bounds.IntersectsWith(obj.Bounds)));
 }
예제 #2
0
 public bool InAirNoCollision(PictureBox tar)
 {
     //sprawdza czy picturebox jest poza ramką
     return(!OutsideWorldFrame(tar) && WorldObjects1.Where(obj => !tar.Bounds.IntersectsWith(obj.Bounds)).Any(obj => tar.Location.Y < WorldFrame.Width));
 }
예제 #3
0
 public bool NoCollision(PictureBox tar)
 {
     return(WorldObjects1.Where(obj => obj != null).Any(obj => tar.Bounds.IntersectsWith(obj.Bounds)));
 }