public void OnBossDeath() { Console.WriteLine("forwarding"); if (!queue.FastForward()) { BHGame.OnWinCondition(); } }
public void Update() { foreach (var update in queue.Pop(clock.getTimeSinceLastUpdate())) { update.Execute(); } if (queue.isEmpty()) { if (timeEmpty < 30000) { timeEmpty += clock.getTimeSinceLastUpdate(); } else { BHGame.OnWinCondition(); } } }
static void Main(string[] args) { //Default case goes here IGameFactory factory = new LevelCreator(); //IGameFactory factory = new TestLevelCreeator(); //IGameFactory factory = new GameDirectorLevel1Creator(); // IGameFactory factory = new TestLevelCreator(); Controller controller = new Controller(); bool cheatMode = false; for (int i = 0; i < args.Length; i++) { if (string.Equals(args[i], "-level", StringComparison.CurrentCultureIgnoreCase)) { if (string.Equals(args[i + 1], "test", StringComparison.OrdinalIgnoreCase)) { factory = new TestLevelCreator(); } else if (string.Equals(args[i + 1], "level1")) { factory = new LevelCreator(); } else { throw new Exception("Invalid level specified"); } //skip the next entry in args i++; } else if (string.Equals(args[i], "-keybinding", StringComparison.CurrentCultureIgnoreCase)) { try { ControlLoader loader = new ControlLoader(args[i + 1]); controller.OnRebind += loader.OnLoadKeys; loader.OnLoadKeys(controller, EventArgs.Empty); } catch (Exception e) { Console.WriteLine("Failed to load keys, default will be used"); } //skip the next entry in args i++; } else if (string.Equals(args[i], "-cheatmode", StringComparison.CurrentCultureIgnoreCase)) { cheatMode = true; } else { Console.WriteLine("Unknown parameter: " + args[i]); } } factory.setCheatMode(cheatMode); if (args.Length > 0) { } using (var game = new BHGame(factory, controller)) { game.Run(); } }
public override void Execute() { BHGame.OnWinCondition(); //TODO modify this to display an on screen prompt instead of console output Console.WriteLine("Congratulations, you win!"); }