public game3() { InitializeComponent(); new Settings(); //게임시작 GameOverTimer.Tick += UpdateScreen; GameOverTimer.Start(); StartGame(); }
private void timer1_Tick(object sender, EventArgs e) { if (Game.Hero.Health >= 0) { HeroHealth.Value = Game.Hero.Health; } enemyTimerCounter++; if (Game.Level == 2) { Game.TimeCounter--; } if (enemyTimerCounter % 2 == 0 && Game.Level == 2 && Game.Enemies.Count == 0) { Game.TimeCounter--; enemyTimerCounter = 0; Game.addMeteor(); Game.NextLevel(); } if (enemyTimerCounter == 20 && Game.Level == 1) { enemyTimerCounter = 0; Game.addEnemy(); Game.addMeteor(); } Game.MoveEnemies(); Game.MoveMeteors(); Game.MoveBoss(); if (Game.Level == 3 && Game.Boss.Health > 0) { BossHealth.Visible = true; BossHealth.Enabled = true; BossHealth.Value = Game.Boss.Health; } if (Game.Hero.Health <= 0 || Game.Boss.Health <= 0) { Game.GameOver(); HeroHealth.Visible = false; HeroHealth.Enabled = false; BossHealth.Visible = false; BossHealth.Enabled = false; GameOverTimer.Start(); GameOverLabel.Visible = true; GameOverLabel.Enabled = true; } Game.CheckBulletsImpact(); Game.CheckMeteorImpact(); }