private void shurAnimTimer_Elapsed(object sender, ElapsedEventArgs e) { if (this.flyingShurs.Count > 0) { foreach (var shuriken in this.flyingShurs) { // check if shuriken hits the enemy if (shuriken.col + shuriken.objectWidth / 2 == Game.Enemy.col && (shuriken.row + 3 >= Game.Enemy.row && shuriken.row + 3 <= Game.Enemy.row + Game.Enemy.objectHight)) { shuriken.Color = ConsoleColor.Black; shuriken.Draw(); this.flyingShurs.Remove(shuriken); Game.EnemyHealth--; Game.UpdateEnemyHealth(); Game.Enemy.fireballThrowTimer.Interval -= 200; if (Game.EnemyHealth <= 0) { Game.Level++; } } // else if shuriken reaches the end of screen , remove it else if (shuriken.col > 250) { shuriken.Color = ConsoleColor.Black; shuriken.Draw(); this.flyingShurs.Remove(shuriken); } shuriken.Move(Directions.Right, 5); } } }
private static List <GameObject> ninjaStars = new List <GameObject>(); //the ninja stars currently available public static void ConstructPlayField() { Console.CursorVisible = false; GameObject building = new GameObject("building.txt", 1, 24); building.Color = ConsoleColor.DarkGray; building.Draw(); GameObject enemyHealth = new GameObject("EnemyHealth.txt", 200, 3); enemyHealth.Color = ConsoleColor.Red; enemyHealth.Draw(); GameObject ninjaStars = new GameObject("NinjaStars.txt", 10, 3); ninjaStars.Color = ConsoleColor.Green; ninjaStars.Draw(); GameObject buildingStrength = new GameObject("BuildingStrength.txt", 90, 3); buildingStrength.Color = ConsoleColor.Yellow; buildingStrength.Draw(); Sounds.MainTheme.PlayLooping(); UpdateBuildingStrength(); UpdateEnemyHealth(); UpdateNinjaStars(); Player.Color = ConsoleColor.DarkGreen; Player.TopConstraint = 20; Player.LeftConstraint = 63; Player.RightConstraint = 100; Player.Draw(); }
public static void Intro() { GameObject introScreen = new GameObject("introScreen.txt", 1, 1); introScreen.Draw(); Console.ReadKey(); }
public static void GameLose() { GameObject Lose = new GameObject("Lose.txt", 1, 1); Lose.Draw(); var key = Console.ReadKey(); }
public static void GameWin() { GameObject Win = new GameObject("Win.txt", 1, 1); Win.Draw(); var key = Console.ReadKey(); }
public static void SplashScreenLevel3() { GameObject ScreenLevel3 = new GameObject("ScreenLevel3.txt", 1, 1); ScreenLevel3.Draw(); var key = Console.ReadKey(); }
public void ThrowFiraballs() { fireball = new GameObject("fireball.txt", this.col - 30, this.row); fireball.Color = ConsoleColor.DarkYellow; fireball.Draw(); fireballs.Add(fireball); }
public void ThrowFiraballs() { fireball = new GameObject("fireball.txt", this.col - 30, (this.row+10)); fireball.Color = ConsoleColor.DarkYellow; fireball.Draw(); fireballs.Add(fireball); Sounds.PlayFireballThrow(); }
public static void Spash(string name, int time = 5000) { GameObject splashscreen = new GameObject(name, 1, 1); splashscreen.Draw(); Thread.Sleep(time); Console.ReadKey(); }
public static void Win() { Console.Clear(); Sounds.GameWinSound.Play(); GameObject gameWin = new GameObject("win_new.txt", 1, 1); gameWin.Color = ConsoleColor.Red; gameWin.Draw(); Thread.Sleep(5000); }
public static void GameOver() { Thread.Sleep(500); Console.Clear(); GameObject gameOverText = new GameObject("GameOver.txt", 30, 40); gameOverText.Color = ConsoleColor.Red; gameOverText.Draw(); Sounds.MainTheme.Stop(); Sounds.GameOverSound.Play(); }
public static void GameOver() { Thread.Sleep(500); Console.Clear(); GameObject gameOverText = new GameObject("GameOver_new.txt", 1, 1); gameOverText.Color = ConsoleColor.Red; gameOverText.Draw(); Sounds.GameOverSound.Play(); }
private static List<GameObject> ninjaStars = new List<GameObject>(); //the ninja stars currently available #endregion Fields #region Methods public static void ConstructPlayField() { Console.CursorVisible = false; GameObject building = new GameObject("building.txt", 1, 24); building.Color = ConsoleColor.DarkGray; building.Draw(); GameObject enemyHealth = new GameObject("EnemyHealth.txt", 200, 3); enemyHealth.Color = ConsoleColor.Red; enemyHealth.Draw(); GameObject ninjaStars = new GameObject("NinjaStars.txt", 10, 3); ninjaStars.Color = ConsoleColor.Green; ninjaStars.Draw(); GameObject buildingStrength = new GameObject("BuildingStrength.txt", 90, 3); buildingStrength.Color = ConsoleColor.Yellow; buildingStrength.Draw(); UpdateBuildingStrength(); UpdateEnemyHealth(); UpdateNinjaStars(); Player.Color = ConsoleColor.DarkGreen; Player.TopConstraint = 20; Player.LeftConstraint = 63; Player.RightConstraint = 100; Player.Draw(); }
public static void GameOver() { Thread.Sleep(500); Console.Clear(); GameObject gameOverText = new GameObject("GameOver_new.txt", 1, 1); gameOverText.Color = ConsoleColor.Red; gameOverText.Draw(); Sounds.GameOverSound.Play(); }
public static void Win() { Console.Clear(); Sounds.GameWinSound.Play(); GameObject gameWin = new GameObject("win_new.txt", 1, 1); gameWin.Color = ConsoleColor.Red; gameWin.Draw(); Thread.Sleep(5000); }
public static void Spash(string name, int time = 5000) { GameObject splashscreen = new GameObject(name, 1, 1); splashscreen.Draw(); Thread.Sleep(time); Console.ReadKey(); }