public Form1()
        {
            InitializeComponent();

            game = new Game(DisplayRectangle, random);
            game.GameOver += Game_GameOver;
        }
Exemple #2
0
 public Form1()
 {
     InitializeComponent();
     random = new Random();
     stars = new Stars(ClientRectangle);
     game = Game.GetInstance();
     game.setClientRectangle(ClientRectangle);
     game.NextWave();
 }
Exemple #3
0
        public Main()
        {
            InitializeComponent();

            gameTimer.Interval = 10;
            gameTimer.Tick += new EventHandler(gameTimer_Tick);
            gameTimer.Enabled = true;

            animationTimer.Interval = 100;
            animationTimer.Tick += new EventHandler(animationTimer_Tick);
            animationTimer.Enabled = true;

            game = new Game(this);
        }
Exemple #4
0
 /// <summary>
 /// An attempt at the Singleton design pattern but really just a way for other classes to get an instance of this class.
 /// </summary>
 /// <returns>An instance of The Game. (You just lost The Game.)</returns>
 public static Game GetInstance()
 {
     if (instance == null)
     {
         instance = new Game();
     }
     return instance;
 }
 public Form1()
 {
     InitializeComponent();
     m_game = new Game(ClientRectangle);
     animationTimer.Enabled = true;
 }