public void OnNewMapLoaded(Game game) { UpdateScore(); string[] models = { "sheep", "pig", "skeleton", "zombie", "creeper", "spider" }; for (int i = 0; i < 254; i++) { MobEntity fail = new MobEntity(game, models[rnd.Next(models.Length)]); float x = rnd.Next(0, game.World.Width) + 0.5f; float z = rnd.Next(0, game.World.Length) + 0.5f; Vector3 pos = Respawn.FindSpawnPosition(game, x, z, fail.Size); fail.SetLocation(LocationUpdate.MakePos(pos, false), false); game.Entities[i] = fail; } }
void IGameComponent.OnNewMapLoaded(Game game) { UpdateScore(); wasOnGround = true; showedDeathScreen = false; game.LocalPlayer.Health = 20; string[] models = { "sheep", "pig", "skeleton", "zombie", "creeper", "spider" }; for (int i = 0; i < 254; i++) { MobEntity fail = new MobEntity(game, models[rnd.Next(models.Length)]); float x = rnd.Next(0, game.World.Width) + 0.5f; float z = rnd.Next(0, game.World.Length) + 0.5f; Vector3 pos = Respawn.FindSpawnPosition(game, x, z, fail.Size); fail.SetLocation(LocationUpdate.MakePos(pos, false), false); game.Entities.List[i] = fail; } }
public void OnNewMapLoaded(Game game) { for (int i = 0; i < ((int)((oldlength + oldwidth / 2) / 5)); i++) { game.Entities[i] = null; } game.Chat.Add("&fScore: &e" + score, MessageType.Status1); string[] models = { "sheep", "pig", "skeleton", "zombie", "creeper", "spider" }; for (int i = 0; i < ((int)((game.World.Length + game.World.Width / 2) / 5)); i++) { MobEntity fail = new MobEntity(game, models[rnd.Next(models.Length)]); float x = rnd.Next(0, game.World.Width) + 0.5f; float z = rnd.Next(0, game.World.Length) + 0.5f; Vector3 pos = Respawn.FindSpawnPosition(game, x, z, fail.Size); fail.SetLocation(LocationUpdate.MakePos(pos, false), false); game.Entities[i] = fail; game.Entities[i].Health = 10; } oldwidth = game.World.Width; oldlength = game.World.Length; }