コード例 #1
0
        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();
        }
コード例 #2
0
        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);
        }
コード例 #3
0
 public void OutputPrint(bool OnLockdown)
 {
     OutputView.PrintGame(GetPlayingField(), Game.TotalGold, OnLockdown);
 }
コード例 #4
0
ファイル: Program.cs プロジェクト: glenndewildt/Prog5RikGlenn
 static void Main(string[] args)
 {
     controller = new Controller();
     Output = new OutputView();
     Input = new InputView();
 }