Пример #1
0
        public MapObject(ObjectDescriptor descriptor, ResourceManager resources, Renderer renderer, Vector position)
        {
            SpriteDescriptor spriteDesc = resources.GetSpriteDescriptor(descriptor.Sprites[descriptor.DefaultSprite]);
            sprite = new Sprite(spriteDesc, resources);
            Position = new Vector(position);
            DisplayPosition = new Vector(position);
            this.renderer = renderer;

            sprite.PlayAnimation(spriteDesc.DefaultAnimation, true);

            Name = descriptor.Name;
            ExtraProperties = new Dictionary<string, string>();
        }