Esempio n. 1
0
        public Soldier(Vector2 spawnPosition, Texture2D texture, List <Entity> obstacles, int team) : base(spawnPosition, texture, obstacles, team)
        {
            soldierAI = new SoldierAI();
            AIMouseInput         aiMouse = new AIMouseInput();
            HeroAnimationHandler animationHandler;

            soldierAI.Team = team;
            if (soldierAI.Team == 1)
            {
                animationHandler            = new HeroAnimationHandler(Textures.heroTexture);
                animationHandler.animations = CreateHeroAnimations();
            }
            else
            {
                animationHandler            = new HeroAnimationHandler(Textures.EnemyTexture);
                animationHandler.animations = CreateEnemyAnimations();
            }
            Scale = 1f;
            animationHandler.Mouse = aiMouse;
            _AnimationHandler      = animationHandler;
            Health                     = 10;
            MaxHealth                  = 10;
            soldierAI.Soldier          = this;
            soldierAI.SoldierHealth    = this;
            ((AIInput)Input).soldierAI = soldierAI;
            ((AIMouseInput)animationHandler.Mouse).soldierAI = soldierAI;
            Weapon       = new Weapon(this, aiMouse);
            Weapon.Mouse = animationHandler.Mouse;
            soldierAI.RandomPlatform();
        }
        public Hero(Vector2 spawnPosition, Texture2D texture, List <Entity> obstacles, int team) : base(spawnPosition, texture, obstacles, team)
        {
            HeroAnimationHandler heroAnimationHandler = new HeroAnimationHandler(Texture);

            heroAnimationHandler.animations = CreateHeroAnimations();
            heroAnimationHandler.Mouse      = Game1.mouse;
            Input             = new PlayerInput(Game1.keyBoard);
            Team              = 1;
            Health            = 20;
            MaxHealth         = 20;
            weapon1           = new Weapon(this, heroAnimationHandler.Mouse);
            weapon2           = new RocketLauncher(this, heroAnimationHandler.Mouse);
            Weapon            = weapon1;
            _AnimationHandler = heroAnimationHandler;
        }