From 96fcac2b78500a2f7b3bbc34d0405857acde0c45 Mon Sep 17 00:00:00 2001 From: Claire Peta Date: Wed, 16 Oct 2019 16:27:29 +1100 Subject: [PATCH 1/2] Have to head home, psu hof small changes i made while play testing for bugs and whatnot --- Assets/Data/GameModes/New Racetrack Game Mode.asset | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Assets/Data/GameModes/New Racetrack Game Mode.asset b/Assets/Data/GameModes/New Racetrack Game Mode.asset index 147ea22..8ba9509 100644 --- a/Assets/Data/GameModes/New Racetrack Game Mode.asset +++ b/Assets/Data/GameModes/New Racetrack Game Mode.asset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:4117b175989a656bcab19a092766b204dfe62d93ef109b952ab744e5f60375ca -size 705 +oid sha256:fba61611447ef6cbabeeb62d26b6ee21478bd4a47351bc8b94c97c479e4a3cf1 +size 793 From aad92061848f9213ddeb17ffb08245bab87abc6a Mon Sep 17 00:00:00 2001 From: Claire Peta Date: Wed, 16 Oct 2019 16:29:12 +1100 Subject: [PATCH 2/2] Have to head home, psu hof small changes i made while play testing for bugs and whatnot (forgot to stage all on previous push) --- Assets/Plugins/IngameDebugConsole.meta | 8 ------- Assets/Scripts/Components.meta | 8 ------- Assets/Scripts/Managers/GameManager.cs | 1 - Assets/Scripts/Map Generation/MapManager.cs | 4 ++-- Assets/Scripts/blockSpawn.cs | 26 +++++++++------------ 5 files changed, 13 insertions(+), 34 deletions(-) delete mode 100644 Assets/Plugins/IngameDebugConsole.meta delete mode 100644 Assets/Scripts/Components.meta diff --git a/Assets/Plugins/IngameDebugConsole.meta b/Assets/Plugins/IngameDebugConsole.meta deleted file mode 100644 index 36375af..0000000 --- a/Assets/Plugins/IngameDebugConsole.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 5f8eae876be4b03438375a82d2c69b4d -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/Components.meta b/Assets/Scripts/Components.meta deleted file mode 100644 index 5a95b09..0000000 --- a/Assets/Scripts/Components.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 8d7394d70ec233849a60a26da5f23b75 -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/Managers/GameManager.cs b/Assets/Scripts/Managers/GameManager.cs index 5dcfc86..0d80479 100644 --- a/Assets/Scripts/Managers/GameManager.cs +++ b/Assets/Scripts/Managers/GameManager.cs @@ -196,7 +196,6 @@ public class GameManager : MonoBehaviour } } //spawn collectible logic blocks - Debug.Log("Spawwn script called from manager"); spawnBlock.Spawn(); diff --git a/Assets/Scripts/Map Generation/MapManager.cs b/Assets/Scripts/Map Generation/MapManager.cs index e2a63a8..2328e10 100644 --- a/Assets/Scripts/Map Generation/MapManager.cs +++ b/Assets/Scripts/Map Generation/MapManager.cs @@ -353,9 +353,9 @@ public class MapManager : ScriptableObject //If it's not, then we remove it if (!(checkView(firstSectionEnd))) { - spawn.GetComponent().updatePositions(startX + activeSections[0].length); + spawn.GetComponent().updatePositions((int)startX + activeSections[0].length); startX += activeSections[0].length; - spawn.GetComponent().updatePositions(startX); + spawn.GetComponent().updatePositions((int)startX); activeSections[0].destroySection(); activeSections.RemoveAt(0); diff --git a/Assets/Scripts/blockSpawn.cs b/Assets/Scripts/blockSpawn.cs index dbcd02e..8be3e9d 100644 --- a/Assets/Scripts/blockSpawn.cs +++ b/Assets/Scripts/blockSpawn.cs @@ -40,14 +40,14 @@ public class blockSpawn : MonoBehaviour } min_x = (int)ConnectedClients[ConnectedClients.Count - 1].playerCharacter.transform.position.x; - max_x = (int)ConnectedClients[0].playerCharacter.transform.position.x +3; + max_x = (int)ConnectedClients[0].playerCharacter.transform.position.x + 4; Debug.Log("count before update " + SpawnBlocks.Count); - updatePositions(min_x - 1); updatePlayerPositions(); + Debug.Log("count mid update " + SpawnBlocks.Count); + updatePositions(min_x - 1); Debug.Log("count after update " + SpawnBlocks.Count); - Debug.Log("adding possible spawn locations"); //Check points within the bounds of players possibleSpawnLocations.Clear(); foreach (Block point in SpawnBlocks) @@ -61,7 +61,7 @@ public class blockSpawn : MonoBehaviour //pick a random value from those available, checks the location //then removes it to remove the possibility of duplicates - Debug.Log("count after add " + possibleSpawnLocations.Count); + Debug.Log("possibleSpawnLocations count " + possibleSpawnLocations.Count); int triesCount = 0; @@ -71,9 +71,7 @@ public class blockSpawn : MonoBehaviour { if(possibleSpawnLocations.Count > 0){ int choice = Random.Range(0, possibleSpawnLocations.Count - 1); - Debug.Log("count inside " + possibleSpawnLocations.Count); bool spawned = checkLocation(possibleSpawnLocations[choice].transform.position); - Debug.Log("bool spawned = " + spawned); if (spawned == true) { possibleSpawnLocations.RemoveAt(choice); @@ -86,12 +84,11 @@ public class blockSpawn : MonoBehaviour } else { - Debug.Log("spawn else"); goto escape; } - Debug.Log("spawnNumber " + spawnNumber); + //Debug.Log("spawnNumber " + spawnNumber); } - Debug.Log("SpawnTries: " + triesCount); + //Debug.Log("SpawnTries: " + triesCount); } escape: spawnNumber = 2; @@ -99,24 +96,22 @@ public class blockSpawn : MonoBehaviour private bool checkLocation(Vector3 spawnposition) { - Debug.Log("Check location function"); bool duplicate = checkDuplicatePosition(spawnposition); if (duplicate == false) { spawnBlock(spawnposition); - Debug.Log("spawned at" + spawnposition); + //Debug.Log("spawned at" + spawnposition); return true; } else { - Debug.Log("Fail to spawn at " + spawnposition); + //Debug.Log("Fail to spawn at " + spawnposition); return false; } } private bool checkDuplicatePosition(Vector3 spawnposition) { - Debug.Log("Check duplicate function"); if (spawnedLocations.Count > 0) { for (int k = 0; k < spawnedLocations.Count; k++) @@ -163,12 +158,13 @@ public class blockSpawn : MonoBehaviour block.GetComponent().Collectable.Count = 1; } - public void updatePositions(float max) + public void updatePositions(int min) { for(int i = SpawnBlocks.Count -1; i>=0; i--) { - if(SpawnBlocks[i].transform.position.x <= (int)max) + if(SpawnBlocks[i].transform.position.x <= min) { + Debug.Log("block to remove position x: " + SpawnBlocks[i].transform.position.x); SpawnBlocks.Remove(SpawnBlocks[i]); } }