public Ball(ConsoleGraphics graphics, Arcanoid arcanoid) { this.graphics = graphics; this.arcanoid = arcanoid; ImgBall = graphics.LoadImage("ballBlue.png"); BallPositionX = graphics.ClientWidth / 2 - ImgBall.Width / 2; BallPositionY = graphics.ClientWidth / 2 - ImgBall.Height * 2; }
public ArcanoidGameEngine(ConsoleGraphics graphics, int fileWidth, int fieldHeight, Brick brick) : base(graphics) { FieldWidth = fileWidth; FieldHeight = fieldHeight; this.brick = brick; var arcanoid = new Arcanoid(graphics); AddObject(arcanoid); var bricks = new List <Brick>(); for (int i = 0; i < brick.brickCount; i++) { AddObject(new Brick(graphics, 128 + brick.BrickPositionX * i, 0)); AddObject(new Brick(graphics, 96 + brick.BrickPositionX * (i - 1), 36)); } var ball = new Ball(graphics, arcanoid); AddObject(ball); }