Example #1
0
 public override void UpdatePosition(Ball ball)
 {
     if (ball.GetDirection() > 1.5 * Math.PI || ball.GetDirection() < 0.5 * Math.PI)
      {
          if (ball.GetPosition().Y - 5 > GetPosition().Y + GetSize().Height / 2)
          {
              MoveDown();
          }
          else if (ball.GetPosition().Y == GetPosition().Y + GetSize().Height / 2)
          {
          }
          else if (ball.GetPosition().Y + 5 < GetPosition().Y + GetSize().Height / 2)
          {
              MoveUp();
          }
      }
      base.UpdatePosition(ball);
 }
Example #2
0
 protected override void Initialize()
 {
     screenHeight = 600;
     screenWidth = 800;
     menu = new Menu();
     gamestate = GameStates.Menu;
     resetTimer = 0;
     resetTimerInUse = true;
     lastScored = false;
     graphics.PreferredBackBufferWidth = screenWidth;
     graphics.PreferredBackBufferHeight = screenHeight;
     graphics.IsFullScreen = false;
     graphics.ApplyChanges();
     ball = new Ball(Content, new Vector2(screenWidth, screenHeight));
     SetUpMulti();
     input = new Input();
     base.Initialize();
 }