public FormSnakeGame() { InitializeComponent(); this.snake = new UISnake(snakeLength, segmentSize, segmentSize, Direction.Right, Pens.Green); this.appleGenerator = new UIAppleGenerator( this.pictureBoxSnakeGame.Width, this.pictureBoxSnakeGame.Height, this.appleSize, this.appleSize); do { this.apple = this.appleGenerator.CreateApple(); }while (this.snake.IsOn(apple)); this.timerSnakeGame.Start(); }
public FormSnakeGame() { InitializeComponent(); this.snake = new UISnake(snakeLength, segmentSize, segmentSize, Direction.Right, Pens.Green); this.appleGenerator = new UIAppleGenerator( this.pictureBoxSnakeGame.Width, this.pictureBoxSnakeGame.Height, this.appleSize, this.appleSize); do { this.apple = this.appleGenerator.CreateApple(); } while (this.snake.IsOn(apple)); this.timerSnakeGame.Start(); }