public Monster SpawnMonster(string monsterType) { Monster monster = null; switch (monsterType) { case "Slime": monster = new Slime (); break; case "Demon": monster = new Demon(); break; case "EyeBall": monster = new EyeBall(); break; case "AngryRock": monster = new AngryRock(); break; case "BigBadBoss": monster = new AngryRock(); break; } monster.MovementSpeed = Moxy.Random.Next ((int)monster.LowSpeed, (int)monster.HighSpeed); return monster; }
public Monster Spawn(GameTime gameTime) { Monster monster = null; lastSpawn = TimeSpan.Zero; MonsterCount++; switch (MonsterType) { case "Slime": monster = new Slime(); break; case "Demon": monster = new Demon(); break; case "EyeBall": monster = new EyeBall(); break; } monster.Location = this.Location; monster.OnDeath += OnMonsterDeath; TimeSinceLastSpawn = 0; return monster; }