diff --git a/Assets/Prefabs/Door.prefab b/Assets/Prefabs/Door.prefab index 1cd27dc..07d7f07 100644 --- a/Assets/Prefabs/Door.prefab +++ b/Assets/Prefabs/Door.prefab @@ -78,6 +78,8 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 379e789da7c069c4fa9e34de20cb23bc, type: 3} m_Name: m_EditorClassIdentifier: + trigger: {fileID: 0} + inverted: 0 --- !u!212 &212264353888458790 SpriteRenderer: m_ObjectHideFlags: 1 @@ -112,7 +114,7 @@ SpriteRenderer: m_SortingLayerID: 1398306609 m_SortingLayer: 2 m_SortingOrder: 0 - m_Sprite: {fileID: 21300010, guid: f0425e92c7345064ab2dccbd778f3b15, type: 3} + m_Sprite: {fileID: 21300024, guid: f0425e92c7345064ab2dccbd778f3b15, type: 3} m_Color: {r: 1, g: 1, b: 1, a: 1} m_FlipX: 0 m_FlipY: 0 diff --git a/Assets/Scenes/gameplay.unity b/Assets/Scenes/gameplay.unity index bb78316..a3087e9 100644 --- a/Assets/Scenes/gameplay.unity +++ b/Assets/Scenes/gameplay.unity @@ -311,6 +311,11 @@ Prefab: propertyPath: bombTimer value: 1 objectReference: {fileID: 0} + - target: {fileID: 114831880267786856, guid: c4d410a301c013a468dc133a094e5478, + type: 2} + propertyPath: respawner + value: + objectReference: {fileID: 1113148580} m_RemovedComponents: [] m_ParentPrefab: {fileID: 100100000, guid: c4d410a301c013a468dc133a094e5478, type: 2} m_IsPrefabParent: 0 @@ -6964,6 +6969,11 @@ Prefab: propertyPath: timer value: 1 objectReference: {fileID: 0} + - target: {fileID: 114937917394596370, guid: 37dd8e63a4accd043b621e3886a2e847, + type: 2} + propertyPath: respawner + value: + objectReference: {fileID: 1127108196} m_RemovedComponents: [] m_ParentPrefab: {fileID: 100100000, guid: 37dd8e63a4accd043b621e3886a2e847, type: 2} m_IsPrefabParent: 0 @@ -9008,6 +9018,11 @@ Prefab: propertyPath: timer value: 1 objectReference: {fileID: 0} + - target: {fileID: 114937917394596370, guid: 37dd8e63a4accd043b621e3886a2e847, + type: 2} + propertyPath: respawner + value: + objectReference: {fileID: 1407204881} m_RemovedComponents: [] m_ParentPrefab: {fileID: 100100000, guid: 37dd8e63a4accd043b621e3886a2e847, type: 2} m_IsPrefabParent: 0 @@ -13165,6 +13180,11 @@ Prefab: propertyPath: timer value: 1 objectReference: {fileID: 0} + - target: {fileID: 114937917394596370, guid: 37dd8e63a4accd043b621e3886a2e847, + type: 2} + propertyPath: respawner + value: + objectReference: {fileID: 875103198} m_RemovedComponents: [] m_ParentPrefab: {fileID: 100100000, guid: 37dd8e63a4accd043b621e3886a2e847, type: 2} m_IsPrefabParent: 0 @@ -14779,6 +14799,11 @@ Prefab: propertyPath: timer value: 1 objectReference: {fileID: 0} + - target: {fileID: 114937917394596370, guid: 37dd8e63a4accd043b621e3886a2e847, + type: 2} + propertyPath: respawner + value: + objectReference: {fileID: 1531377536} m_RemovedComponents: [] m_ParentPrefab: {fileID: 100100000, guid: 37dd8e63a4accd043b621e3886a2e847, type: 2} m_IsPrefabParent: 0 @@ -15772,6 +15797,11 @@ Prefab: propertyPath: timer value: -1 objectReference: {fileID: 0} + - target: {fileID: 114937917394596370, guid: 37dd8e63a4accd043b621e3886a2e847, + type: 2} + propertyPath: respawner + value: + objectReference: {fileID: 1529703469} m_RemovedComponents: [] m_ParentPrefab: {fileID: 100100000, guid: 37dd8e63a4accd043b621e3886a2e847, type: 2} m_IsPrefabParent: 0 diff --git a/Assets/Scripts/Blocks/BlockIce.cs b/Assets/Scripts/Blocks/BlockIce.cs index fafb9b7..cf8318e 100644 --- a/Assets/Scripts/Blocks/BlockIce.cs +++ b/Assets/Scripts/Blocks/BlockIce.cs @@ -11,6 +11,8 @@ public class BlockIce : MonoBehaviour { public GameObject bombPrefab; public Sprite alternateSprite; + public Respawner respawner; //can be respawned + void Awake() { spriteRenderer = GetComponent (); rigidBody = GetComponent (); @@ -35,7 +37,9 @@ public class BlockIce : MonoBehaviour { GameObject bomb = Instantiate (bombPrefab); bomb.transform.position = transform.position; bomb.GetComponent ().timer = bombTimer; + bomb.GetComponent ().respawner = respawner; } + respawner.enabled = true; Destroy (gameObject); } diff --git a/Assets/Scripts/Bomb.cs b/Assets/Scripts/Bomb.cs index ebd285a..79f669e 100644 --- a/Assets/Scripts/Bomb.cs +++ b/Assets/Scripts/Bomb.cs @@ -10,6 +10,8 @@ public class Bomb : MonoBehaviour { GameObject explosion; public GameObject iceBlockPrefab; + public Respawner respawner; //this can be respawned + float birthTime; void Awake() { @@ -36,6 +38,7 @@ public class Bomb : MonoBehaviour { GameObject iceBlock = Instantiate (iceBlockPrefab); iceBlock.transform.position = transform.position; iceBlock.GetComponent ().bombTimer = timer - (Time.time - birthTime); + iceBlock.GetComponent ().respawner = respawner; Destroy (gameObject); } @@ -50,6 +53,7 @@ public class Bomb : MonoBehaviour { yield return new WaitForSeconds (delay); explosion.SetActive (true); transform.DetachChildren (); + respawner.enabled = true; Destroy (gameObject); } } diff --git a/Assets/Scripts/Respawner.cs b/Assets/Scripts/Respawner.cs index d6d3bd6..d2c937f 100644 --- a/Assets/Scripts/Respawner.cs +++ b/Assets/Scripts/Respawner.cs @@ -29,6 +29,23 @@ public class Respawner : MonoBehaviour { instance.SetActive (true); instance.transform.position = startPos; timer = float.NegativeInfinity; + + //what is it? + if (instance.GetComponent() != null) { + instance.GetComponent ().respawner = this; + } + + if (instance.GetComponent() != null) { + instance.GetComponent ().respawner = this; + } + + this.enabled = false; + } + } + + void OnEnable() { + if (timer != float.NegativeInfinity) { + timer = Time.time; } } } diff --git a/Assets/Sprites/tiles_ip.png b/Assets/Sprites/tiles_ip.png index d98fa7a..21cf765 100644 --- a/Assets/Sprites/tiles_ip.png +++ b/Assets/Sprites/tiles_ip.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:5393e4691a47a5e469998cf5228a87c8188f50ca4987a000db028a66c9840f2b -size 1249 +oid sha256:a5f7aadde193468b39db8c2b88e6132c006e29dfb727e0932d952cf056bc0bef +size 1301 diff --git a/Assets/Sprites/tiles_ip.png.meta b/Assets/Sprites/tiles_ip.png.meta index 05e8ae5..439b1f1 100644 --- a/Assets/Sprites/tiles_ip.png.meta +++ b/Assets/Sprites/tiles_ip.png.meta @@ -16,6 +16,7 @@ TextureImporter: 21300018: tiles_ip_9 21300020: tiles_ip_10 21300022: tiles_ip_11 + 21300024: tiles_ip_12 externalObjects: {} serializedVersion: 4 mipmaps: @@ -270,6 +271,20 @@ TextureImporter: outline: [] physicsShape: [] tessellationDetail: 0 + - serializedVersion: 2 + name: tiles_ip_12 + rect: + serializedVersion: 2 + x: 64 + y: 0 + width: 16 + height: 16 + alignment: 0 + pivot: {x: 0, y: 0} + border: {x: 0, y: 0, z: 0, w: 0} + outline: [] + physicsShape: [] + tessellationDetail: 0 outline: [] physicsShape: [] spritePackingTag: