示例#1
0
 public MainHero(string name, int maxHealth, int att, int def, int level, MainWindow mainWindow)
     : base(name, maxHealth, att, def, level, mainWindow)
 {
     CharacterAvatar = new Avatar(               //sets default avatar parameters
         22,
         20,
         DirectoryProvider.GetRelativeDirectory(@"C:\Users\LEN\source\repos\Gra\Gra\Graphics\HeroAvatar.jpg"),
         mainWindow);
 }
示例#2
0
 void ChooseEnemyImage()        // chooses enemy's image by its class
 {
     if (Enemy.GetType().ToString() == "Gra.Knight")
     {
         SetEnemyImage(DirectoryProvider.GetRelativeDirectory(@"C:\Users\LEN\source\repos\Gra\Gra\Graphics\Knight.jpg"));
     }
     else if (Enemy.GetType().ToString() == "Gra.Dwarf")
     {
         SetEnemyImage(DirectoryProvider.GetRelativeDirectory(@"C:\Users\LEN\source\repos\Gra\Gra\Graphics\Dwarf.jpg"));
     }
 }
示例#3
0
        public Water(List <ILandscapeObject> list, MainWindow mainWindow)
        {
            Random rand = new Random();

            Element = new Avatar(
                rand.Next(1,
                          (int)mainWindow.Width / 15),
                rand.Next(1, (int)mainWindow.Height / 15),
                DirectoryProvider.GetRelativeDirectory(ImagePath),
                mainWindow);
            list.Add(this);
        }
示例#4
0
 public FightScreen(MainHero hero, Character enemy, MainWindow mainWindow)
 {
     InitializeComponent();
     WindowStartupLocation = WindowStartupLocation.CenterScreen; // lokates window in center of the screen
     this.Hero             = hero;
     this.Enemy            = enemy;
     MainWindow            = mainWindow;
     FightHandler          = new Fight(this);
     //sets hero's image
     HeroImage(DirectoryProvider.GetRelativeDirectory(@"C:\Users\LEN\source\repos\Gra\Gra\Graphics\Conan.jpg"));
     //sets enemy's image based on enemy's class
     ChooseEnemyImage();
     SetStats();
     SetButtons();
 }