Пример #1
0
        protected virtual void addEntity(Entity entity)
        {
            entitiesToAdd.Add(entity);
            Scenery scenery = entity as Scenery;

            if (scenery != null)
            {
                SceneryEntities.Add(scenery);
            }
        }
Пример #2
0
        private void addScenery(SpriteData spriteData, Vector2 position)
        {
            Scenery scenery = new Scenery(new Sprite(spriteData), position);

            scenery.Scale = new Vector2(0.5f);
            if (scenery.Sprite.Data.Animations.Count > 0)
            {
                scenery.Sprite.SetAnimation(new List <string>(scenery.Sprite.Data.Animations.Keys).Sample());
            }
            addEntity(scenery);
        }
 private void addScenery(SpriteData spriteData, Vector2 position)
 {
     Scenery scenery = new Scenery(new Sprite(spriteData), position);
     scenery.Scale = new Vector2(0.5f);
     if (scenery.Sprite.Data.Animations.Count > 0)
         scenery.Sprite.SetAnimation(new List<string>(scenery.Sprite.Data.Animations.Keys).Sample());
     addEntity(scenery);
 }