public Game() { screen = new Screen { Width = ScreenWidth, Height = ScreenHeight }; levelManager = new LevelManager(); collisionManager = new CollisionManager(); screenCollisionManager = new ScreenCollisionManager(screen); randomGenerator = new RandomGenerator(); tailManager = new TailManager(); ballManager = new BallManager(); borderManager = new BorderManager(); padManager = new PadManager(screen); ballStateMachine = new BallStateMachine(this, screenCollisionManager, collisionManager, padManager, borderManager, levelManager); padManager.Add(Edge.Top); padManager.Add(Edge.Bottom); borderManager.Create(screen); foreach (var pad in padManager) { VerifyBorderCollision(pad); } IBall ball = new Ball(randomGenerator); ball.SetSize(15, 15); ballManager.Add(ball); }
private void CreateObjects() { padManager.Create(gameConfig, players); borderManager.Create(screen, gameConfig, players); foreach (var pad in padManager) { borderCollisionManager.DetectAndVerify(borderManager, pad.Item3); } }