public static void Fire(int xIn) { if (instance == null) { instance = new MissleSingleton(); } instance.activate(xIn); }
public static MissleSingleton GetInstance() { if (instance == null) { instance = new MissleSingleton(); } return(instance); }
//----------------------------------------------------------------------------- // 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); }
public void FireMissle() { MissleSingleton.Fire(GetX()); }