private void MainForm_Load(object sender, System.EventArgs e) { KeyPreview = true; Game.Settings settings = new Game.Settings(this) { BallDiameter = 18, BallBackColor = System.Drawing.Color.Yellow, RacketSpeed = 24, RacketWidth = 120, RacketHeight = 4, RacketInitialDistance = 30, RacketBackColor = System.Drawing.Color.Green, BoardWidth = 360, BoardHeight = 480, BoardBorderThickness = 1, BoardBackColor = System.Drawing.Color.Red, BoardBorderColor = System.Drawing.Color.Blue, }; Game.Board board = new Game.Board(scene: scenePictureBox, settings: settings); Game.Racket racket = new Game.Racket(scene: scenePictureBox, settings: settings, board: board); //string pathName = // Infrastructure.Utility.GetPathName("Space.jpg"); //if (System.IO.File.Exists(pathName)) //{ // scenePictureBox.ImageLocation = pathName; //} Balls = new System.Collections.Generic.List <Game.Ball>(); for (int index = 1; index <= 1; index++) { Game.Ball ball = new Game.Ball(scene: scenePictureBox, settings: settings, board: board, racket: racket); Balls.Add(ball); } }
public GameEngine(Game.Settings settings, IGameUserInputOutput ui) { Settings = settings; this.ui = ui; }