public Hero createHero(string heroName) { Hero hero = new Hero(heroName, 1, 0, 100, 0, 0, 0, 25, 25, 25, 25, null, null); Console.WriteLine("Weclome to the true man's World! " + heroName); Console.ReadLine(); hero.addStatsPoints(10); hero.showStats(); return(hero); }
static public void checkLevel(Hero hero) { foreach (int expGrade in expToLevelUp) { if (hero.experience >= expGrade) { levels++; } if (levels > heroLevelBefore) { Console.WriteLine("You Leveled Up!"); Console.ReadKey(); hero.addStatsPoints(5); hero.heroLevel = levels + 1; heroLevelBefore = hero.heroLevel; } } }