Beispiel #1
0
        public void StartGame()
        {
            //reset ball position to center
            GameBall.Position = new Vector2(WindowSize.x / 2, 338);

            //set ball direction
            BallDirection = SetBallDirection();

            //reset paddle position
            GamePaddle.Position = new Vector2(WindowSize.x / 2, 456);

            //regenerate bricks
            GenerateBrickGrid();

            //show ball & paddle
            GameBall.Show();
            GamePaddle.Show();

            //hide hud
            GameOverHud.ShowOrHideHud(show: false);

            //tell the script the game's running
            game_running = true;
        }