Exemplo n.º 1
0
 public EnemyUnit(ContentManager contentManager,
                  GraphicsDevice graphicsDevice,
                  Vector2 position,
                  UnitInformation information)
     : base(contentManager,
            graphicsDevice,
            position,
            information)
 {
 }
Exemplo n.º 2
0
        public Unit(ContentManager contentManager,
                    GraphicsDevice graphicsDevice,
                    Vector2 position,
                    UnitInformation information)
        {
            _contentManager = contentManager;
            _graphicsDevice = graphicsDevice;
            Position        = position;

            string path = string.Format("Units/{0}s/{1}", information.Race, information.Texture);

            _unitTexture = _contentManager.Load <Texture2D>(path);
            _healthBar   = new HealthBar(contentManager, information.Health, position, 40);

            UnitState = EUnitState.Walk;
            Speed     = information.Speed;
            Dammage   = information.Dammage;
            Cost      = information.Cost;

            base.Load(_unitTexture.Width, 96, 96, 5);
        }