public Controller() { InputView = new InputView(); OutputView = new OutputView(); map = new Map(); OutputView.DrawMap(map, Score); OutputView.PrintControls(); MyTimer = new System.Timers.Timer(); MyTimer.Elapsed += new ElapsedEventHandler(OnTimedEvent); Playing = true; Start(); }
private void PlayGame() { while (Game.IsPlaying) { int threadTimer = 300 + (int)(300 / Math.Sqrt(Game.TotalGold + 1)); //Moving, lockdown = true Game.IsLocked = true; OutputPrint(Game.IsLocked); Game.MoveAllObjects(); Game.CheckSpawnBoat(); Game.SpawnCarts(); Thread.Sleep(300); //Not moving, lockdown = false Game.IsLocked = false; OutputPrint(Game.IsLocked); Thread.Sleep(threadTimer); } OutputPrint(Game.IsLocked); OutputView.ShowLoseMessage(Game.TotalGold); }
public void OutputPrint(bool OnLockdown) { OutputView.PrintGame(GetPlayingField(), Game.TotalGold, OnLockdown); }
static void Main(string[] args) { controller = new Controller(); Output = new OutputView(); Input = new InputView(); }