Пример #1
0
 private static void CHeckIfHittingABorder(PlayerPlane entity)
 {
     if (entity.defeated)
     {
         return;
     }
     isHittingABorder = false;
     drawArea         = entity.Get <Rectangle>();
     movementSpeed    = entity.Get <Velocity2D>();
     CheckStopTopBorder(ScreenSpace.Current.Viewport);
     CheckStopBottomBorder(ScreenSpace.Current.Viewport);
     entity.Set(drawArea);
     entity.Set(movementSpeed);
 }
Пример #2
0
            private static void CalculateRectAfterMove(PlayerPlane entity)
            {
                var pointAfterVerticalMovement = new Vector2D(entity.Get <Rectangle>().TopLeft.X,
                                                              entity.Get <Rectangle>().TopLeft.Y + entity.Get <Velocity2D>().velocity.Y *Time.Delta);

                entity.Set(new Rectangle(pointAfterVerticalMovement, entity.Get <Rectangle>().Size));
            }
Пример #3
0
 private static void CHeckIfHittingABorder(PlayerPlane entity)
 {
     if (entity.defeated)
         return;
     isHittingABorder = false;
     drawArea = entity.Get<Rectangle>();
     movementSpeed = entity.Get<Velocity2D>();
     CheckStopTopBorder(ScreenSpace.Current.Viewport);
     CheckStopBottomBorder(ScreenSpace.Current.Viewport);
     entity.Set(drawArea);
     entity.Set(movementSpeed);
 }
Пример #4
0
 private static void CalculateRectAfterMove(PlayerPlane entity)
 {
     var pointAfterVerticalMovement = new Vector2D(entity.Get<Rectangle>().TopLeft.X,
         entity.Get<Rectangle>().TopLeft.Y + entity.Get<Velocity2D>().velocity.Y * Time.Delta);
     entity.Set(new Rectangle(pointAfterVerticalMovement, entity.Get<Rectangle>().Size));
 }