Esempio n. 1
0
        public Spawner CreateSpawnerWithEnemies(string enemyId, int amount)
        {
            var contentManager = GameServices.GetService<ContentManager>();
            var spawner = new Spawner(1000, 1000, new Vector2(100, 100));
            spawner.Texture = contentManager.Load<Texture2D>(GeneralSettings.TexturesPath + "spawner1");

            spawner.Enemies.AddRange(EnemyFactory.Instance.CreateEnemies(enemyId, amount));
            return spawner;
        }
Esempio n. 2
0
        public Spawner CreateSpawnerWithRandomPosition()
        {
            var graphicsDevice = GameServices.GetService<GraphicsDevice>();
            var contentManager = GameServices.GetService<ContentManager>();

            var width = graphicsDevice.Viewport.Width;
            var height = graphicsDevice.Viewport.Height;
            var random = new Random();

            var spawner = new Spawner(1000, 1000, new Vector2(random.Next(width), random.Next(height)));
            spawner.Texture = contentManager.Load<Texture2D>(GeneralSettings.TexturesPath + "spawner1");

            return spawner;
        }
Esempio n. 3
0
 public void AddSpawner(Spawner spawner)
 {
     Spawners.Add(spawner);
 }