diff --git a/Assets/Scripts/GameMode/ColorGameMode/RacetrackGameMode.cs b/Assets/Scripts/GameMode/ColorGameMode/RacetrackGameMode.cs index 91f43d7..a634eba 100644 --- a/Assets/Scripts/GameMode/ColorGameMode/RacetrackGameMode.cs +++ b/Assets/Scripts/GameMode/ColorGameMode/RacetrackGameMode.cs @@ -10,6 +10,7 @@ using System.Linq; public class RacetrackGameMode : GameMode { public MapManager mapManager; + public blockSpawn spawn; public int MaxRound = 999; public string nextScene = "ServerTestScene"; @@ -109,6 +110,7 @@ public class RacetrackGameMode : GameMode //We check for track sections we need to add/remove mapManager.checkTrack(); + //spawn.wakeup(); //Move the camera forward at a steady rate each round /*if (scrollSpeed > 0.0f) @@ -272,22 +274,18 @@ public class RacetrackGameMode : GameMode character.lives -= 1; character.ClientLink.Lives = character.lives; } - } private IEnumerator AnimateBlock(Material mat, float time) { - float timeElasped = 0; while (timeElasped < time) { mat.SetFloat("_Multiplier", (timeElasped / time)); yield return new WaitForEndOfFrame(); - timeElasped += Time.deltaTime; } - mat.SetFloat("_Multiplier", 1); } diff --git a/Assets/Scripts/Managers/GameManager.cs b/Assets/Scripts/Managers/GameManager.cs index 2590793..56379cb 100644 --- a/Assets/Scripts/Managers/GameManager.cs +++ b/Assets/Scripts/Managers/GameManager.cs @@ -179,7 +179,7 @@ public class GameManager : MonoBehaviour } } //spawn collectible logic blocks - spawnBlock.Spawn(); + //spawnBlock.Spawn(); //Reset some player Data diff --git a/Assets/Scripts/Networking/Server/ClientList.cs b/Assets/Scripts/Networking/Server/ClientList.cs index fe1ed1a..aec3080 100644 --- a/Assets/Scripts/Networking/Server/ClientList.cs +++ b/Assets/Scripts/Networking/Server/ClientList.cs @@ -106,6 +106,7 @@ namespace Networking.Server ConnectedClients.ForEach(p => p.conn.Send(LoginProtocols.OtherClientDisconnected, new LoginProtocols.LoginMsg(client.Name, client.Color, client.characterAnimal))); PotentialClients.ForEach(p => p.Send(LoginProtocols.OtherClientDisconnected, new LoginProtocols.LoginMsg(client.Name, client.Color, client.characterAnimal))); Debug.Log("Disconnected: " + client.Name); + //somewhere here we need to remove the disconnected client from the client list and update such things OnClientsChange.Invoke(ConnectedClients); } diff --git a/Assets/Scripts/blockSpawn.cs b/Assets/Scripts/blockSpawn.cs index dda7e10..a5c0db7 100644 --- a/Assets/Scripts/blockSpawn.cs +++ b/Assets/Scripts/blockSpawn.cs @@ -26,6 +26,7 @@ public class blockSpawn : MonoBehaviour } public void wakeup() { + SpawnBlocks.ToList().Clear(); SpawnBlocks = FindObjectsOfType().Where(p => p.isCollectableSpawnable).ToArray(); } @@ -103,20 +104,24 @@ public class blockSpawn : MonoBehaviour public void assignLogicBlock(GameObject block, float value) { - if(value > 0) + if(value > 1) { listtoUse = WeakLogicList; } - else if (value < 0 && value > (-10)) + else if (value <= 1 && value > (-4)) { listtoUse = NormalLogicList; } - else if (value <= (-10)) + else if (value <= (-5)) { listtoUse = StrongLogicList; } + //max behind camera is -6/-7 + //max lives = 3 + // ~ anyone ahead of the average will have a minimum of 4(full lives) or 2(with 1 life left) + // ~ anyone behind the average will have a minimum of -3-4(full lives) or -5/-6 (with one life left) - int number = (int)Random.Range(0, listtoUse.Length-1); + int number = Random.Range(0, listtoUse.Length-1); block.GetComponent().Collectable.element = listtoUse[number].element; block.GetComponent().Collectable.Count = listtoUse[number].Count; }