コード例 #1
0
ファイル: Game.cs プロジェクト: whztt07/DeltaEngine
		private void InitPages()
		{
			home = new HomePage(screen);			
			home.ButtonClicked += OnButtonClicked;
			playing = new Match(screen, new NumberFactory(), new LogoFactory(screen));
			playing.GameEnded += (sender, e) => ShowGameOver(e);
			gameOver = new GameOverPage(screen);
			gameOver.Hide();
			gameOver.ButtonClicked += OnButtonClicked;
		}
コード例 #2
0
ファイル: GameLogic.cs プロジェクト: whztt07/DeltaEngine
		public void CheckWave(Match match)
		{
			if (waveCount > 0)
			{
				match.CreateLogos(waveLogoCount);
				waveCount--;
				if (waveCount == 0)
					waveIndex++;
			}
			else if (match.LogoCount == 0)
			{
				var random = Randomizer.Current;
				int max = match.CurrentLevel + 1;
				int min = max < 4 ? 1 : max - 5;
				int count = random.Get(min, max);
				waveLogoCount = 1;
				switch (waveIndex)
				{
				case 0:
				case 4:
					waveCount = match.CurrentLevel;
					break;
				case 1:
					match.CreateLogos(count);
					waveIndex++;
					break;
				case 2:
					waveCount = max;
					break;
				case 3:
					match.CreateLogos(max < 5 ? max : 5);
					waveIndex++;
					break;
				case 5:
					waveLogoCount = match.CurrentLevel % 3 == 0 ? 2 : 1;
					waveCount = count;
					break;
				case 6:
					match.NextLevel();
					waveTimeout -= 0.05f;
					waveIndex = 0;
					break;
				}
			}
		}