コード例 #1
0
        public Form1()
        {
            InitializeComponent();

            game = new Game(DisplayRectangle, random);
            game.GameOver += Game_GameOver;
        }
コード例 #2
0
ファイル: Form1.cs プロジェクト: APerson241/Invaders
 public Form1()
 {
     InitializeComponent();
     random = new Random();
     stars = new Stars(ClientRectangle);
     game = Game.GetInstance();
     game.setClientRectangle(ClientRectangle);
     game.NextWave();
 }
コード例 #3
0
ファイル: Main.cs プロジェクト: seclu/Invaders
        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);
        }
コード例 #4
0
ファイル: Game.cs プロジェクト: APerson241/Invaders
 /// <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;
 }
コード例 #5
0
 public Form1()
 {
     InitializeComponent();
     m_game = new Game(ClientRectangle);
     animationTimer.Enabled = true;
 }