From 3ad6568707ff3115cb9a2f5eaa226f39d17afe9c Mon Sep 17 00:00:00 2001 From: Sam Date: Sat, 6 May 2023 17:37:35 -0700 Subject: [PATCH 1/7] more balance to caverns --- .../DEBUG/PersistantData/DebugCanvas.prefab | 6 +- Assets/Scenes/GrappleScene.unity | 224 +++++++++++++++++- 2 files changed, 220 insertions(+), 10 deletions(-) diff --git a/Assets/Prefabs/DEBUG/PersistantData/DebugCanvas.prefab b/Assets/Prefabs/DEBUG/PersistantData/DebugCanvas.prefab index 751b3af..c13e00e 100644 --- a/Assets/Prefabs/DEBUG/PersistantData/DebugCanvas.prefab +++ b/Assets/Prefabs/DEBUG/PersistantData/DebugCanvas.prefab @@ -1113,7 +1113,7 @@ MonoBehaviour: m_OnCullStateChanged: m_PersistentCalls: m_Calls: [] - m_text: Rolling Caves + m_text: Rolling Caverns m_isRightToLeft: 0 m_fontAsset: {fileID: 11400000, guid: 6854b27dee6494bd1bab796422f6a3b1, type: 2} m_sharedMaterial: {fileID: 55571796086095593, guid: 6854b27dee6494bd1bab796422f6a3b1, type: 2} @@ -1387,7 +1387,7 @@ RectTransform: m_Children: - {fileID: 7749526488533549851} m_Father: {fileID: 0} - m_RootOrder: 4 + m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0} @@ -2463,7 +2463,7 @@ MonoBehaviour: m_OnCullStateChanged: m_PersistentCalls: m_Calls: [] - m_text: Clarinet Swamp + m_text: Reed Swamp m_isRightToLeft: 0 m_fontAsset: {fileID: 11400000, guid: 6854b27dee6494bd1bab796422f6a3b1, type: 2} m_sharedMaterial: {fileID: 55571796086095593, guid: 6854b27dee6494bd1bab796422f6a3b1, type: 2} diff --git a/Assets/Scenes/GrappleScene.unity b/Assets/Scenes/GrappleScene.unity index a63c66e..f595fb3 100644 --- a/Assets/Scenes/GrappleScene.unity +++ b/Assets/Scenes/GrappleScene.unity @@ -1521,6 +1521,7 @@ Transform: - {fileID: 1866363915} - {fileID: 906228767} - {fileID: 1383539494} + - {fileID: 2120089895} - {fileID: 1027734973} - {fileID: 1507343986} - {fileID: 672084753} @@ -3960,6 +3961,84 @@ Transform: m_CorrespondingSourceObject: {fileID: 493245979038171992, guid: fe6515c8ba67e4334bd83dff507ec83e, type: 3} m_PrefabInstance: {fileID: 1107305515} m_PrefabAsset: {fileID: 0} +--- !u!1001 &1126560255 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 1413690797} + m_Modifications: + - target: {fileID: 367295637452716247, guid: 94c7d43583a3b46c58e7d4e253eae896, type: 3} + propertyPath: m_Name + value: GrappleBox (7) + objectReference: {fileID: 0} + - target: {fileID: 1025473297745678352, guid: 94c7d43583a3b46c58e7d4e253eae896, type: 3} + propertyPath: m_Radius + value: 1.9 + objectReference: {fileID: 0} + - target: {fileID: 1025473297745678352, guid: 94c7d43583a3b46c58e7d4e253eae896, type: 3} + propertyPath: m_Offset.y + value: -19.99 + objectReference: {fileID: 0} + - target: {fileID: 8452658923215583967, guid: 94c7d43583a3b46c58e7d4e253eae896, type: 3} + propertyPath: m_RootOrder + value: -1 + objectReference: {fileID: 0} + - target: {fileID: 8452658923215583967, guid: 94c7d43583a3b46c58e7d4e253eae896, type: 3} + propertyPath: m_LocalScale.x + value: 3.02 + objectReference: {fileID: 0} + - target: {fileID: 8452658923215583967, guid: 94c7d43583a3b46c58e7d4e253eae896, type: 3} + propertyPath: m_LocalPosition.x + value: -23.47 + objectReference: {fileID: 0} + - target: {fileID: 8452658923215583967, guid: 94c7d43583a3b46c58e7d4e253eae896, type: 3} + propertyPath: m_LocalPosition.y + value: 16.94 + objectReference: {fileID: 0} + - target: {fileID: 8452658923215583967, guid: 94c7d43583a3b46c58e7d4e253eae896, type: 3} + propertyPath: m_LocalPosition.z + value: 2 + objectReference: {fileID: 0} + - target: {fileID: 8452658923215583967, guid: 94c7d43583a3b46c58e7d4e253eae896, type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 8452658923215583967, guid: 94c7d43583a3b46c58e7d4e253eae896, type: 3} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 8452658923215583967, guid: 94c7d43583a3b46c58e7d4e253eae896, type: 3} + propertyPath: m_LocalRotation.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 8452658923215583967, guid: 94c7d43583a3b46c58e7d4e253eae896, type: 3} + propertyPath: m_LocalRotation.z + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 8452658923215583967, guid: 94c7d43583a3b46c58e7d4e253eae896, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8452658923215583967, guid: 94c7d43583a3b46c58e7d4e253eae896, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8452658923215583967, guid: 94c7d43583a3b46c58e7d4e253eae896, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 94c7d43583a3b46c58e7d4e253eae896, type: 3} +--- !u!4 &1126560256 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 8452658923215583967, guid: 94c7d43583a3b46c58e7d4e253eae896, type: 3} + m_PrefabInstance: {fileID: 1126560255} + m_PrefabAsset: {fileID: 0} --- !u!1001 &1192387873 PrefabInstance: m_ObjectHideFlags: 0 @@ -4963,6 +5042,7 @@ Transform: - {fileID: 1817875257} - {fileID: 684906576} - {fileID: 1325296802} + - {fileID: 1126560256} m_Father: {fileID: 0} m_RootOrder: 24 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} @@ -52090,6 +52170,36 @@ Tilemap: m_TileObjectToInstantiateIndex: 65535 dummyAlignment: 0 m_AllTileFlags: 1073741825 + - first: {x: -25, y: 16, z: 0} + second: + serializedVersion: 2 + m_TileIndex: 26 + m_TileSpriteIndex: 23 + m_TileMatrixIndex: 2 + m_TileColorIndex: 0 + m_TileObjectToInstantiateIndex: 65535 + dummyAlignment: 0 + m_AllTileFlags: 1073741825 + - first: {x: -24, y: 16, z: 0} + second: + serializedVersion: 2 + m_TileIndex: 26 + m_TileSpriteIndex: 23 + m_TileMatrixIndex: 2 + m_TileColorIndex: 0 + m_TileObjectToInstantiateIndex: 65535 + dummyAlignment: 0 + m_AllTileFlags: 1073741825 + - first: {x: -23, y: 16, z: 0} + second: + serializedVersion: 2 + m_TileIndex: 26 + m_TileSpriteIndex: 23 + m_TileMatrixIndex: 2 + m_TileColorIndex: 0 + m_TileObjectToInstantiateIndex: 65535 + dummyAlignment: 0 + m_AllTileFlags: 1073741825 - first: {x: 1, y: 16, z: 0} second: serializedVersion: 2 @@ -113014,7 +113124,7 @@ Tilemap: m_Data: {fileID: 11400000, guid: 605c24591df054320be61ee96783195e, type: 2} - m_RefCount: 204 m_Data: {fileID: 11400000, guid: db381af5bd75b4f909d3c46f4deafd2e, type: 2} - - m_RefCount: 21 + - m_RefCount: 24 m_Data: {fileID: 11400000, guid: 8ad16cf41deb94cf4afd912c15465261, type: 2} - m_RefCount: 17 m_Data: {fileID: 11400000, guid: 5ce4e22fedcc84d03b3e2f51a7fb77fa, type: 2} @@ -113095,7 +113205,7 @@ Tilemap: m_Data: {fileID: 1707607318, guid: 2097266264e574d71a38da279b45c7c0, type: 3} - m_RefCount: 18 m_Data: {fileID: 208169506, guid: 2097266264e574d71a38da279b45c7c0, type: 3} - - m_RefCount: 21 + - m_RefCount: 24 m_Data: {fileID: 858304779, guid: 2097266264e574d71a38da279b45c7c0, type: 3} - m_RefCount: 13 m_Data: {fileID: -1027637906, guid: 2097266264e574d71a38da279b45c7c0, type: 3} @@ -113172,7 +113282,7 @@ Tilemap: e31: 0 e32: 0 e33: 1 - - m_RefCount: 21 + - m_RefCount: 24 m_Data: e00: -1 e01: 0.00000008742278 @@ -113281,7 +113391,7 @@ Tilemap: e32: 0 e33: 1 m_TileColorArray: - - m_RefCount: 10382 + - m_RefCount: 10385 m_Data: {r: 1, g: 1, b: 1, a: 1} - m_RefCount: 0 m_Data: {r: 0.742567, g: 0.36139938, b: 0.43682057, a: 1} @@ -114570,8 +114680,28 @@ CompositeCollider2D: Y: 190000000 - X: -270000000 Y: 170000000 - - X: -220000000 + - X: -250000000 Y: 170000000 + - X: -250000000 + Y: 167500000 + - X: -248124992 + Y: 166875008 + - X: -240937504 + Y: 166875008 + - X: -240000000 + Y: 167500000 + - X: -238124992 + Y: 166875008 + - X: -230937504 + Y: 166875008 + - X: -230000000 + Y: 167500000 + - X: -228124992 + Y: 166875008 + - X: -220937504 + Y: 166875008 + - X: -220000000 + Y: 167500000 - X: -220000000 Y: 220000000 - X: -140000000 @@ -115653,7 +115783,17 @@ CompositeCollider2D: - {x: -24, y: 19} - {x: -27, y: 19} - {x: -27, y: 17} - - {x: -22, y: 17} + - {x: -25, y: 17} + - {x: -25, y: 16.75} + - {x: -24.8125, y: 16.687502} + - {x: -24.09375, y: 16.687502} + - {x: -24, y: 16.75} + - {x: -23.8125, y: 16.687502} + - {x: -23.09375, y: 16.687502} + - {x: -23, y: 16.75} + - {x: -22.8125, y: 16.687502} + - {x: -22.09375, y: 16.687502} + - {x: -22, y: 16.75} - {x: -22, y: 22} - {x: -14, y: 22} - {x: -14, y: 21.937502} @@ -116328,7 +116468,7 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 493245979038171992, guid: c33beb037603b4e12a75275ec13369ef, type: 3} propertyPath: m_LocalPosition.y - value: 9.604257 + value: 7.18 objectReference: {fileID: 0} - target: {fileID: 493245979038171992, guid: c33beb037603b4e12a75275ec13369ef, type: 3} propertyPath: m_LocalPosition.z @@ -116512,6 +116652,76 @@ Transform: m_CorrespondingSourceObject: {fileID: 5447655033524966674, guid: 5e69412b9141e4bdeaaaf00f6dce7b82, type: 3} m_PrefabInstance: {fileID: 2062345891} m_PrefabAsset: {fileID: 0} +--- !u!1001 &2120089894 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 340437845} + m_Modifications: + - target: {fileID: 493245979038171992, guid: c33beb037603b4e12a75275ec13369ef, type: 3} + propertyPath: m_RootOrder + value: -1 + objectReference: {fileID: 0} + - target: {fileID: 493245979038171992, guid: c33beb037603b4e12a75275ec13369ef, type: 3} + propertyPath: m_LocalPosition.x + value: -68.88 + objectReference: {fileID: 0} + - target: {fileID: 493245979038171992, guid: c33beb037603b4e12a75275ec13369ef, type: 3} + propertyPath: m_LocalPosition.y + value: 48.02 + objectReference: {fileID: 0} + - target: {fileID: 493245979038171992, guid: c33beb037603b4e12a75275ec13369ef, type: 3} + propertyPath: m_LocalPosition.z + value: -1.3654507 + objectReference: {fileID: 0} + - target: {fileID: 493245979038171992, guid: c33beb037603b4e12a75275ec13369ef, type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 493245979038171992, guid: c33beb037603b4e12a75275ec13369ef, type: 3} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 493245979038171992, guid: c33beb037603b4e12a75275ec13369ef, type: 3} + propertyPath: m_LocalRotation.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 493245979038171992, guid: c33beb037603b4e12a75275ec13369ef, type: 3} + propertyPath: m_LocalRotation.z + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 493245979038171992, guid: c33beb037603b4e12a75275ec13369ef, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 493245979038171992, guid: c33beb037603b4e12a75275ec13369ef, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 493245979038171992, guid: c33beb037603b4e12a75275ec13369ef, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 493245979038171997, guid: c33beb037603b4e12a75275ec13369ef, type: 3} + propertyPath: m_Name + value: Bat (18) + objectReference: {fileID: 0} + - target: {fileID: 493245979038171999, guid: c33beb037603b4e12a75275ec13369ef, type: 3} + propertyPath: m_FlipX + value: 1 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: c33beb037603b4e12a75275ec13369ef, type: 3} +--- !u!4 &2120089895 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 493245979038171992, guid: c33beb037603b4e12a75275ec13369ef, type: 3} + m_PrefabInstance: {fileID: 2120089894} + m_PrefabAsset: {fileID: 0} --- !u!1001 &1926772931522546277 PrefabInstance: m_ObjectHideFlags: 0 From dcfae28ee37c252fd50d77019dd18fd87c2702fa Mon Sep 17 00:00:00 2001 From: Sam Date: Sat, 6 May 2023 18:12:32 -0700 Subject: [PATCH 2/7] fixed enemies not dying if pinned --- Assets/Scripts/EnemyPatrol.cs | 18 +++++++++++++++--- Assets/Scripts/TambourineBehavior.cs | 13 +++++++------ 2 files changed, 22 insertions(+), 9 deletions(-) diff --git a/Assets/Scripts/EnemyPatrol.cs b/Assets/Scripts/EnemyPatrol.cs index c9cf147..f915a41 100644 --- a/Assets/Scripts/EnemyPatrol.cs +++ b/Assets/Scripts/EnemyPatrol.cs @@ -4,7 +4,9 @@ using UnityEngine; public class EnemyPatrol : MonoBehaviour { + [Header("Tambourine")] [HideInInspector] public bool pinned = false; + [HideInInspector] public TambourineBehavior pinnedTambourine; [Header("Horizontal")] public bool isHorizontal; @@ -60,13 +62,15 @@ public class EnemyPatrol : MonoBehaviour { } } - public void TogglePin(bool isPinned) { + public void TogglePin(bool isPinned, TambourineBehavior tambourine) { + this.pinned = isPinned; if (isPinned) { animator.speed = 0; + this.pinnedTambourine = tambourine; } else { animator.speed = 1; + this.pinnedTambourine = null; } - } public void DefeatEnemy() { @@ -75,10 +79,18 @@ public class EnemyPatrol : MonoBehaviour { IEnumerator Defeat() { isPlayingDefeatAnimation = true; + if (pinned) { + pinnedTambourine.DestroySelf(); + TogglePin(false, this.pinnedTambourine); + } this.gameObject.GetComponent().enabled = false; animator.Play("Explosion"); + float explosionTime = .25f; + // print("explosiontime: " + explosionTime); this.gameObject.GetComponent().Play(); - yield return new WaitForSeconds(animator.GetCurrentAnimatorStateInfo(0).length); + // print("reached early point"); + yield return new WaitForSeconds(explosionTime); + // print("reached late point"); this.gameObject.GetComponent().enabled = true; isPlayingDefeatAnimation = false; this.gameObject.SetActive(false); diff --git a/Assets/Scripts/TambourineBehavior.cs b/Assets/Scripts/TambourineBehavior.cs index ac96d06..d731096 100644 --- a/Assets/Scripts/TambourineBehavior.cs +++ b/Assets/Scripts/TambourineBehavior.cs @@ -72,14 +72,13 @@ public class TambourineBehavior : MonoBehaviour { if (col.tag == "Enemy") { this.gameObject.GetComponent().enabled = false; collidedObject = col.gameObject; - print("Pinning to enemy"); + // print("Pinning to enemy"); this.gameObject.GetComponent().enabled = false; - collidedObject.GetComponent().pinned = true; - collidedObject.GetComponent().TogglePin(true); + collidedObject.GetComponent().TogglePin(true, this); } else if (col.tag == "Projectile") { this.gameObject.GetComponent().enabled = false; collidedObject = col.gameObject; - print("pinned to projectile"); + // print("pinned to projectile"); this.gameObject.GetComponent().enabled = false; collidedObject.GetComponent().Pin(); } @@ -106,8 +105,10 @@ public class TambourineBehavior : MonoBehaviour { } if (collidedObject != null && collidedObject.tag == "Enemy") { - collidedObject.GetComponent().pinned = false; - collidedObject.GetComponent().TogglePin(false); + EnemyPatrol enemy = collidedObject.GetComponent(); + if (!enemy.isPlayingDefeatAnimation) { + enemy.TogglePin(false, this); + } } else if (collidedObject != null && collidedObject.tag == "Projectile") { collidedObject.GetComponent().Explode(); } From 9b3bc81173bad84511909a33ece10982ea291691 Mon Sep 17 00:00:00 2001 From: Sam Date: Sat, 6 May 2023 18:25:35 -0700 Subject: [PATCH 3/7] fixed: player no longer holds grapple after dying to projectile --- Assets/Scripts/PlayerBehavior.cs | 14 +++++--------- Assets/Scripts/PlayerController.cs | 9 ++++----- 2 files changed, 9 insertions(+), 14 deletions(-) diff --git a/Assets/Scripts/PlayerBehavior.cs b/Assets/Scripts/PlayerBehavior.cs index efb98a8..c1af501 100644 --- a/Assets/Scripts/PlayerBehavior.cs +++ b/Assets/Scripts/PlayerBehavior.cs @@ -226,7 +226,7 @@ public class PlayerBehavior : MonoBehaviour void LetGoOfGrapple() { bool currentlyPaused = StateController.Instance.isPaused; if (grapplingRope.isGrappling && !currentlyPaused) { - print("currently paused is " + currentlyPaused + ", releasing grapple"); + // print("currently paused is " + currentlyPaused + ", releasing grapple"); if (tambourine != null) { tambourine.GetComponent().DestroySelf(); } @@ -362,7 +362,10 @@ public class PlayerBehavior : MonoBehaviour IEnumerator DestroyPlayer() { if (playerIsAlive) { - print("destroyPlayer called"); + if (grapplingRope.isGrappling) { + LetGoOfGrapple(); + } + // print("destroyPlayer called"); playerIsAlive = false; audioSource.clip = deathSound; audioSource.loop = false; @@ -371,15 +374,8 @@ public class PlayerBehavior : MonoBehaviour // animate animator.Play("Die"); - // yield return new WaitForSeconds(animator.GetCurrentAnimatorStateInfo(0).length); yield return new WaitForSeconds(audioSource.clip.length); - // this.stateController.SetDeathCanvasActive(true); - - if (grapplingRope.isGrappling) { - LetGoOfGrapple(); - } - // destroy all tambourines GameObject[] currentTambourines = GameObject.FindGameObjectsWithTag("tambourine"); print("tambs found: " + currentTambourines.Length); diff --git a/Assets/Scripts/PlayerController.cs b/Assets/Scripts/PlayerController.cs index ac1a26a..d84696d 100644 --- a/Assets/Scripts/PlayerController.cs +++ b/Assets/Scripts/PlayerController.cs @@ -287,15 +287,14 @@ public class PlayerMovement : MonoBehaviour #region Calculate AccelRate float accelRate; - //Gets an acceleration value based on if we are accelerating (includes turning) - //or trying to decelerate (stop). As well as applying a multiplier if we're air borne. - if (LastOnGroundTime > 0) { + // accelerate or decelerate + if (LastOnGroundTime > 0) { // if grounded accelRate = (Mathf.Abs(targetSpeed) > 0.01f) ? Data.runAccelAmount : Data.runDeccelAmount; } - else if (wasGrappling) { + else if (wasGrappling) { // if grappling accelRate = (Mathf.Abs(targetSpeed) > 0.01f) ? Data.runAccelAmount * Data.accelInAir : Data.runDeccelAmount * (Data.deccelInAir / 5); } - else { + else { // if in air accelRate = (Mathf.Abs(targetSpeed) > 0.01f) ? Data.runAccelAmount * Data.accelInAir : Data.runDeccelAmount * Data.deccelInAir; } #endregion From 05cf1c729b53ee227463f7e640585f3ee4aad0e3 Mon Sep 17 00:00:00 2001 From: Sam Date: Sat, 6 May 2023 18:32:19 -0700 Subject: [PATCH 4/7] fixed explosion animation should've been in previous commit but it didn't save bc unity being unity --- Assets/Animations/Bat/BatController.controller | 2 +- Assets/Animations/Effects/Explosion.anim | 2 +- Assets/Scenes/GrappleScene.unity | 8 ++++++++ 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/Assets/Animations/Bat/BatController.controller b/Assets/Animations/Bat/BatController.controller index 0df2907..eec0bee 100644 --- a/Assets/Animations/Bat/BatController.controller +++ b/Assets/Animations/Bat/BatController.controller @@ -65,7 +65,7 @@ AnimatorController: m_DefaultFloat: 0 m_DefaultInt: 0 m_DefaultBool: 0 - m_Controller: {fileID: 0} + m_Controller: {fileID: 9100000} m_AnimatorLayers: - serializedVersion: 5 m_Name: Base Layer diff --git a/Assets/Animations/Effects/Explosion.anim b/Assets/Animations/Effects/Explosion.anim index 41fba88..5693c67 100644 --- a/Assets/Animations/Effects/Explosion.anim +++ b/Assets/Animations/Effects/Explosion.anim @@ -82,7 +82,7 @@ AnimationClip: m_Level: 0 m_CycleOffset: 0 m_HasAdditiveReferencePose: 0 - m_LoopTime: 1 + m_LoopTime: 0 m_LoopBlend: 0 m_LoopBlendOrientation: 0 m_LoopBlendPositionY: 0 diff --git a/Assets/Scenes/GrappleScene.unity b/Assets/Scenes/GrappleScene.unity index f595fb3..3951f46 100644 --- a/Assets/Scenes/GrappleScene.unity +++ b/Assets/Scenes/GrappleScene.unity @@ -2303,6 +2303,14 @@ PrefabInstance: propertyPath: m_Name value: Slug (4) objectReference: {fileID: 0} + - target: {fileID: 493245979038171999, guid: fe6515c8ba67e4334bd83dff507ec83e, type: 3} + propertyPath: m_FlipX + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 493245979038171999, guid: fe6515c8ba67e4334bd83dff507ec83e, type: 3} + propertyPath: m_FlipY + value: 1 + objectReference: {fileID: 0} - target: {fileID: 4018407283885727215, guid: fe6515c8ba67e4334bd83dff507ec83e, type: 3} propertyPath: rangeHorizontal value: 2 From c13793565d91f01f336773696e8c95776cb01f27 Mon Sep 17 00:00:00 2001 From: Sam Date: Sat, 6 May 2023 18:49:45 -0700 Subject: [PATCH 5/7] fixed dialog box array resizing errors --- Assets/Scripts/DialogBoxes.cs | 14 ++++++++++++-- Assets/Scripts/EnemyPatrol.cs | 2 +- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/Assets/Scripts/DialogBoxes.cs b/Assets/Scripts/DialogBoxes.cs index 7d7dd61..bcd9938 100644 --- a/Assets/Scripts/DialogBoxes.cs +++ b/Assets/Scripts/DialogBoxes.cs @@ -22,10 +22,11 @@ public class DialogBoxes : MonoBehaviour // Start is called before the first frame update - void Start() + void Awake() { textField = this.gameObject.GetComponent(); ReconfigureSpriteArray(); + print("reconfigured"); textField.text = dialogMessages[0]; backgroundImageObject.sprite = images[0]; } @@ -35,6 +36,8 @@ public class DialogBoxes : MonoBehaviour messageCount += 1; if (messageCount < dialogMessages.Length) { + print("looking at message " + messageCount); + print("messages: " + dialogMessages.Length + ", images: " + images.Length); textField.text = dialogMessages[messageCount]; backgroundImageObject.sprite = images[messageCount]; } @@ -50,13 +53,19 @@ public class DialogBoxes : MonoBehaviour void ReconfigureSpriteArray() { + print("attempting to reconfigure"); // resize if need to if (images.Length != dialogMessages.Length) { + print("resizing"); Sprite[] newImagesArray = new Sprite[dialogMessages.Length]; for (int i = 0; i < newImagesArray.Length; i++) { - newImagesArray[i] = images[i]; + if (i < images.Length) { + newImagesArray[i] = images[i]; + } else { + newImagesArray[i] = null; + } } images = newImagesArray; } @@ -69,6 +78,7 @@ public class DialogBoxes : MonoBehaviour images[i] = images[i - 1]; } } + print(images.Length); } } diff --git a/Assets/Scripts/EnemyPatrol.cs b/Assets/Scripts/EnemyPatrol.cs index f915a41..055f76d 100644 --- a/Assets/Scripts/EnemyPatrol.cs +++ b/Assets/Scripts/EnemyPatrol.cs @@ -47,7 +47,7 @@ public class EnemyPatrol : MonoBehaviour { void Update() { if (!pinned) { if (isHorizontal) { - if (transform.position.x >= xRight || transform.position.x <= xLeft) { + if (transform.position.x > xRight || transform.position.x < xLeft) { movementVectorHorizontal = -movementVectorHorizontal; GetComponent().flipX = !GetComponent().flipX; } From b6804e29862e531692717cf514090777ee2c9284 Mon Sep 17 00:00:00 2001 From: Sam Date: Sat, 6 May 2023 19:05:46 -0700 Subject: [PATCH 6/7] removed commented out code and print statements the console should finally be message free! except for the unity memory leak lol but that one's not on us --- Assets/Scripts/CameraMovement.cs | 3 --- Assets/Scripts/DebugSceneSwitcher.cs | 2 -- Assets/Scripts/DialogBoxes.cs | 6 ------ Assets/Scripts/EnemyPatrol.cs | 3 --- Assets/Scripts/PlayerBehavior.cs | 14 -------------- Assets/Scripts/PlayerController.cs | 11 ----------- Assets/Scripts/PlayerData.cs | 11 ----------- Assets/Scripts/SceneController.cs | 5 ----- Assets/Scripts/StateController.cs | 5 ----- Assets/Scripts/TambourineBehavior.cs | 8 -------- Assets/Scripts/Tutorial_GrapplingGun.cs | 15 +-------------- Assets/Scripts/Tutorial_GrapplingRope.cs | 9 --------- 12 files changed, 1 insertion(+), 91 deletions(-) diff --git a/Assets/Scripts/CameraMovement.cs b/Assets/Scripts/CameraMovement.cs index 8b8b309..ca8d78d 100644 --- a/Assets/Scripts/CameraMovement.cs +++ b/Assets/Scripts/CameraMovement.cs @@ -45,8 +45,5 @@ public class CameraMovement : MonoBehaviour { public void FindPlayer() { player = GameObject.FindGameObjectWithTag("Player"); - // if (player == null) { - // print("null player!"); - // } } } diff --git a/Assets/Scripts/DebugSceneSwitcher.cs b/Assets/Scripts/DebugSceneSwitcher.cs index b09ef57..e14ddee 100644 --- a/Assets/Scripts/DebugSceneSwitcher.cs +++ b/Assets/Scripts/DebugSceneSwitcher.cs @@ -33,7 +33,6 @@ public class DebugSceneSwitcher : MonoBehaviour for (int i = 0; i < SceneManager.sceneCountInBuildSettings; i++) { string newName = System.IO.Path.GetFileNameWithoutExtension(SceneUtility.GetScenePathByBuildIndex(i)); - print(newName); sceneNames.Add(newName); } sceneDropdown.AddOptions(sceneNames); @@ -45,7 +44,6 @@ public class DebugSceneSwitcher : MonoBehaviour public void ChangeScene(int index) { - // print(index); SceneController.Instance.LoadChosenScene(index); this.gameObject.SetActive(false); } diff --git a/Assets/Scripts/DialogBoxes.cs b/Assets/Scripts/DialogBoxes.cs index bcd9938..9713490 100644 --- a/Assets/Scripts/DialogBoxes.cs +++ b/Assets/Scripts/DialogBoxes.cs @@ -26,7 +26,6 @@ public class DialogBoxes : MonoBehaviour { textField = this.gameObject.GetComponent(); ReconfigureSpriteArray(); - print("reconfigured"); textField.text = dialogMessages[0]; backgroundImageObject.sprite = images[0]; } @@ -36,8 +35,6 @@ public class DialogBoxes : MonoBehaviour messageCount += 1; if (messageCount < dialogMessages.Length) { - print("looking at message " + messageCount); - print("messages: " + dialogMessages.Length + ", images: " + images.Length); textField.text = dialogMessages[messageCount]; backgroundImageObject.sprite = images[messageCount]; } @@ -53,11 +50,9 @@ public class DialogBoxes : MonoBehaviour void ReconfigureSpriteArray() { - print("attempting to reconfigure"); // resize if need to if (images.Length != dialogMessages.Length) { - print("resizing"); Sprite[] newImagesArray = new Sprite[dialogMessages.Length]; for (int i = 0; i < newImagesArray.Length; i++) { @@ -78,7 +73,6 @@ public class DialogBoxes : MonoBehaviour images[i] = images[i - 1]; } } - print(images.Length); } } diff --git a/Assets/Scripts/EnemyPatrol.cs b/Assets/Scripts/EnemyPatrol.cs index 055f76d..ad091cc 100644 --- a/Assets/Scripts/EnemyPatrol.cs +++ b/Assets/Scripts/EnemyPatrol.cs @@ -86,11 +86,8 @@ public class EnemyPatrol : MonoBehaviour { this.gameObject.GetComponent().enabled = false; animator.Play("Explosion"); float explosionTime = .25f; - // print("explosiontime: " + explosionTime); this.gameObject.GetComponent().Play(); - // print("reached early point"); yield return new WaitForSeconds(explosionTime); - // print("reached late point"); this.gameObject.GetComponent().enabled = true; isPlayingDefeatAnimation = false; this.gameObject.SetActive(false); diff --git a/Assets/Scripts/PlayerBehavior.cs b/Assets/Scripts/PlayerBehavior.cs index c1af501..cd48bd8 100644 --- a/Assets/Scripts/PlayerBehavior.cs +++ b/Assets/Scripts/PlayerBehavior.cs @@ -24,7 +24,6 @@ public class PlayerBehavior : MonoBehaviour private bool isDash = false; public float dashForce = 1f; public float dashTime = 1.0f; - private float dashInc = 0.1f; private float currentDash = 0.0f; private bool forceAdded = false; Vector2 dashVec; @@ -146,9 +145,6 @@ public class PlayerBehavior : MonoBehaviour if (this.playerInput.actions["CymbalCrash"].WasPressedThisFrame()) { // Play the sound this.gameUI.ToggleCymbal(false); - // this.audioSource.clip = cymbalSound; - // this.audioSource.loop = false; - // this.audioSource.Play(); cymbalAudio.Play(); // Set the cymbal active for the equivalent of one second @@ -226,7 +222,6 @@ public class PlayerBehavior : MonoBehaviour void LetGoOfGrapple() { bool currentlyPaused = StateController.Instance.isPaused; if (grapplingRope.isGrappling && !currentlyPaused) { - // print("currently paused is " + currentlyPaused + ", releasing grapple"); if (tambourine != null) { tambourine.GetComponent().DestroySelf(); } @@ -241,7 +236,6 @@ public class PlayerBehavior : MonoBehaviour } else { reflect = new Vector2(saveVelocity.x * reflectForce, -(saveVelocity.y) * reflectForce); - //reflect = new Vector2(saveVelocity.x * 1.1f, -(saveVelocity.y) * reflectForce); hasBounced = true; } _rb.AddForce(reflect, ForceMode2D.Impulse); @@ -250,7 +244,6 @@ public class PlayerBehavior : MonoBehaviour } void Water() { - print("water dash " + isDash); if(isDash) { saveVelocity = _rb.velocity / velocityCut; if (isDash) { @@ -268,7 +261,6 @@ public class PlayerBehavior : MonoBehaviour grappleSurface = col.gameObject; } else if (col.tag == "instaDeath") { - print("player fell in spikes"); StartCoroutine(DestroyPlayer()); } else if (col.tag == "spawnPoint") { @@ -331,7 +323,6 @@ public class PlayerBehavior : MonoBehaviour } else { StartCoroutine(DestroyPlayer()); - print("enemy defeated player"); } } else if (collision.gameObject.tag == "Projectile") { @@ -365,7 +356,6 @@ public class PlayerBehavior : MonoBehaviour if (grapplingRope.isGrappling) { LetGoOfGrapple(); } - // print("destroyPlayer called"); playerIsAlive = false; audioSource.clip = deathSound; audioSource.loop = false; @@ -378,14 +368,10 @@ public class PlayerBehavior : MonoBehaviour // destroy all tambourines GameObject[] currentTambourines = GameObject.FindGameObjectsWithTag("tambourine"); - print("tambs found: " + currentTambourines.Length); if (currentTambourines != null) { foreach (GameObject tambourine in currentTambourines) { if (tambourine != null) { tambourine.GetComponent().DestroySelf(); - print("tamb destroyed"); - } else { - print("null tamb"); } } } diff --git a/Assets/Scripts/PlayerController.cs b/Assets/Scripts/PlayerController.cs index d84696d..64574a2 100644 --- a/Assets/Scripts/PlayerController.cs +++ b/Assets/Scripts/PlayerController.cs @@ -125,7 +125,6 @@ public class PlayerMovement : MonoBehaviour isRegFalling = false; } else { - // print("not jumping"); if (!_isJumpFalling && !isRegFalling) { if (unlockedTrumpet) { trumpet = 1; @@ -143,7 +142,6 @@ public class PlayerMovement : MonoBehaviour #region JUMP CHECKS if (IsJumping && RB.velocity.y <= 0) { IsJumping = false; - // print("isJumping " + IsJumping); _isJumpFalling = true; } @@ -162,7 +160,6 @@ public class PlayerMovement : MonoBehaviour _isJumpFalling = false; bool inCoyoteTime = LastOnGroundTime > 0; - //print("coyote time: " + inCoyoteTime); Jump(); @@ -186,7 +183,6 @@ public class PlayerMovement : MonoBehaviour // stop sound if needed if (soundPlaying && (isRegFalling || IsJumping || _isJumpFalling)) { - print("footsteps stop"); audioSource.Stop(); soundPlaying = false; } @@ -201,10 +197,6 @@ public class PlayerMovement : MonoBehaviour #region GRAVITY //Higher gravity if we've released the jump input or are falling - // if (IsSliding) - // { - // SetGravityScale(0); - // } if (RB.velocity.y < 0 && _moveInput.y < 0) { //Much higher gravity if holding down SetGravityScale(Data.gravityScale * Data.fastFallGravityMult); @@ -234,13 +226,11 @@ public class PlayerMovement : MonoBehaviour #region SOUND CHECKS if (!IsJumping && !_isJumpFalling && !isRegFalling && _moveInput.x != 0) { if (!soundPlaying) { - // print("footsteps PLAY"); audioSource.Play(); soundPlaying = true; } } else if (soundPlaying && audioSource.clip.name == "footsteps") { - // print("footsteps stop"); audioSource.Stop(); soundPlaying = false; } @@ -375,7 +365,6 @@ public class PlayerMovement : MonoBehaviour } public bool IsGrounded() { - // print(Physics2D.OverlapBox(this.transform.position, _groundCheckSize, 0, _groundLayer) && !IsJumping); return (Physics2D.OverlapBox(new Vector2(this.transform.position.x, this.transform.position.y - _groundCheckOffset), _groundCheckSize, 0, _groundLayer) && !IsJumping); } diff --git a/Assets/Scripts/PlayerData.cs b/Assets/Scripts/PlayerData.cs index 0fc540b..22e7fa8 100644 --- a/Assets/Scripts/PlayerData.cs +++ b/Assets/Scripts/PlayerData.cs @@ -44,19 +44,8 @@ public class PlayerData : ScriptableObject public float jumpHangAccelerationMult; public float jumpHangMaxSpeedMult; - [Header("Wall Jump")] - public Vector2 wallJumpForce; //The actual force (this time set by us) applied to the player when wall jumping. - [Space(5)] - [Range(0f, 1f)] public float wallJumpRunLerp; //Reduces the effect of player's movement while wall jumping. - [Range(0f, 1.5f)] public float wallJumpTime; //Time after wall jumping the player's movement is slowed for. - public bool doTurnOnWallJump; //Player will rotate to face wall jumping direction - [Space(20)] - [Header("Slide")] - public float slideSpeed; - public float slideAccel; - [Header("Assists")] [Range(0.01f, 0.5f)] public float coyoteTime; //Grace period after falling off a platform, where you can still jump [Range(0.01f, 0.5f)] public float jumpInputBufferTime; //Grace period after pressing jump where a jump will be automatically performed once the requirements (eg. being grounded) are met. diff --git a/Assets/Scripts/SceneController.cs b/Assets/Scripts/SceneController.cs index a32615c..9f98fc4 100644 --- a/Assets/Scripts/SceneController.cs +++ b/Assets/Scripts/SceneController.cs @@ -29,11 +29,6 @@ public class SceneController : MonoBehaviour void OnSceneLoaded(Scene scene, LoadSceneMode mode) { GameObject pauseMenu = GameObject.Find("PauseMenuCanvas"); - if (pauseMenu != null) - { - // Button quitButton = GameObject.Find("QuitButton").GetComponent