示例#1
0
 private static void CheckStopBottomBorder(Rectangle rect, Velocity2D vel, Rectangle borders)
 {
     if (rect.Bottom <= borders.Bottom)
     {
         return;
     }
     vel.Velocity = new Vector2D(vel.Velocity.X, -0.02f);
     rect.Bottom  = borders.Bottom;
 }
示例#2
0
 private static void CheckStopTopBorder(Rectangle rect, Velocity2D vel, Rectangle borders)
 {
     if (rect.Top >= borders.Top)
     {
         return;
     }
     vel.Velocity = new Vector2D(vel.Velocity.X, 0.02f);
     rect.Top     = borders.Top;
 }
示例#3
0
 private static void CheckStopLeftBorder(Rectangle rect, Velocity2D vel, Rectangle borders)
 {
     if (rect.Left >= borders.Left)
     {
         return;
     }
     vel.Velocity = new Vector2D(0.02f, vel.Velocity.Y);
     rect.Left    = borders.Left;
 }
示例#4
0
 private static void CheckStopRightBorder(Rectangle rect, Velocity2D vel, Rectangle borders)
 {
     if (rect.Right <= borders.Right)
     {
         return;
     }
     vel.Velocity = new Vector2D(-0.02f, vel.Velocity.Y);
     rect.Right   = borders.Right;
 }
示例#5
0
 private static void CheckStopBottomBorder(Rectangle rect, Velocity2D vel, Rectangle borders)
 {
     if (rect.Bottom <= borders.Bottom)
         return;
     vel.Velocity = new Vector2D(vel.Velocity.X, -0.02f);
     rect.Bottom = borders.Bottom;
 }
示例#6
0
 private static void CheckStopTopBorder(Rectangle rect, Velocity2D vel, Rectangle borders)
 {
     if (rect.Top >= borders.Top)
         return;
     vel.Velocity = new Vector2D(vel.Velocity.X, 0.02f);
     rect.Top = borders.Top;
 }
示例#7
0
 private static void CheckStopRightBorder(Rectangle rect, Velocity2D vel, Rectangle borders)
 {
     if (rect.Right <= borders.Right)
         return;
     vel.Velocity = new Vector2D(-0.02f, vel.Velocity.Y);
     rect.Right = borders.Right;
 }
示例#8
0
 private static void CheckStopLeftBorder(Rectangle rect, Velocity2D vel, Rectangle borders)
 {
     if (rect.Left >= borders.Left)
         return;
     vel.Velocity = new Vector2D(0.02f, vel.Velocity.Y);
     rect.Left = borders.Left;
 }