コード例 #1
0
 public static void Fire(int xIn)
 {
     if (instance == null)
     {
         instance = new MissleSingleton();
     }
     instance.activate(xIn);
 }
コード例 #2
0
 public static MissleSingleton GetInstance()
 {
     if (instance == null)
     {
         instance = new MissleSingleton();
     }
     return(instance);
 }
コード例 #3
0
        //-----------------------------------------------------------------------------
        // Game::LoadContent()
        //		Allows you to load all content needed for your engine,
        //	    such as objects, graphics, etc.
        //-----------------------------------------------------------------------------
        public override void LoadContent()
        {
            menu.init();
            Squad[]     AlienRows   = new Squad[GameSpecs.AlienRowCount];
            Squad[]     AlienCols   = new Squad[GameSpecs.AlienColCount];
            SimpleSquad activeChars = new Squad(GameSpecs.TotalAliens + GameSpecs.players + 1);

            player1.Init();
            controls = new Controls(ref player1);

            SquadFactory SF = new SquadFactory();

            SF.BuildAliens(ref AlienRows, ref AlienCols, ref activeChars);

            activeChars.AddAlien(player1, GameSpecs.TotalAliens);
            activeChars.AddAlien(MissleSingleton.GetCharacter(), GameSpecs.TotalAliens + 1);
            characters.AddSimpleSquad(activeChars);
            aliens.AddRowsAndCols(AlienRows, AlienCols);
            collision.AddArmy(ref aliens);
            collision.AddCharMissle();

            Debug.WriteLine("(Width,Height): {0}, {1}", GameSpecs.ScreenWidth, GameSpecs.ScreenHeight);
        }
コード例 #4
0
 public void FireMissle()
 {
     MissleSingleton.Fire(GetX());
 }