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); }
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)); }
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); }
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)); }