From 0d9c62cfbddb516fd80ad7f5817d4626edaceaa8 Mon Sep 17 00:00:00 2001 From: Joshua Reason Date: Sun, 22 Jan 2017 09:29:22 +1100 Subject: [PATCH] Game over only if high forward vel; --- .../Assets/Animations/WaveRing.controller | Bin 7032 -> 7032 bytes .../Assets/Scripts/BoatController.cs | 13 ++++++++++--- IronToad_UnityProject/Assets/Sound/Music.meta | 9 +++++++++ IronToad_UnityProject/Assets/Sound/SFX.meta | 9 +++++++++ IronToad_UnityProject/Assets/Textures.meta | 9 +++++++++ .../Assets/_Scenes/GreyBox_Prototype.meta | 9 +++++++++ .../Assets/water/planeWater.prefab | Bin 9444 -> 9584 bytes 7 files changed, 46 insertions(+), 3 deletions(-) create mode 100644 IronToad_UnityProject/Assets/Sound/Music.meta create mode 100644 IronToad_UnityProject/Assets/Sound/SFX.meta create mode 100644 IronToad_UnityProject/Assets/Textures.meta create mode 100644 IronToad_UnityProject/Assets/_Scenes/GreyBox_Prototype.meta diff --git a/IronToad_UnityProject/Assets/Animations/WaveRing.controller b/IronToad_UnityProject/Assets/Animations/WaveRing.controller index b6d10d8154d8ee9a71fb515be9693e5fa7d55d72..6766e28481e9b4ebc10a7e1e3aba3c7072062d1a 100644 GIT binary patch delta 15 Xcmexi_QPz$94Y3rXM85lm%0f6Kxzlj delta 15 Xcmexi_QPz$94Tf728PM=rEUTMG>Zl6 diff --git a/IronToad_UnityProject/Assets/Scripts/BoatController.cs b/IronToad_UnityProject/Assets/Scripts/BoatController.cs index 3a6a134..e381ce8 100644 --- a/IronToad_UnityProject/Assets/Scripts/BoatController.cs +++ b/IronToad_UnityProject/Assets/Scripts/BoatController.cs @@ -6,7 +6,7 @@ using UnityEngine; public class BoatController : BuoyantObject { public float trunSpeed = 0.5f; - + public float breakSpeed = 20f; // Use this for initialization void Start() { @@ -26,8 +26,15 @@ public class BoatController : BuoyantObject { } void OnCollisionEnter(Collision collision) { - if (collision.gameObject.CompareTag("Rock")) - NotificationServer.notify("show GameOverPanel"); + if (collision.gameObject.CompareTag("Rock")) { + + float forwardHitSpeed = Vector3.Project(collision.relativeVelocity, transform.forward).magnitude; + + Debug.Log("Forward hit:" + forwardHitSpeed); + if (forwardHitSpeed > breakSpeed) { + NotificationServer.notify("show GameOverPanel"); + } + } } diff --git a/IronToad_UnityProject/Assets/Sound/Music.meta b/IronToad_UnityProject/Assets/Sound/Music.meta new file mode 100644 index 0000000..5559b43 --- /dev/null +++ b/IronToad_UnityProject/Assets/Sound/Music.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 1715d56e0d2b68246a82993db31014ab +folderAsset: yes +timeCreated: 1485006712 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/IronToad_UnityProject/Assets/Sound/SFX.meta b/IronToad_UnityProject/Assets/Sound/SFX.meta new file mode 100644 index 0000000..5548a6b --- /dev/null +++ b/IronToad_UnityProject/Assets/Sound/SFX.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: de5a3adcedb96f64183518ac89622ade +folderAsset: yes +timeCreated: 1485006712 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/IronToad_UnityProject/Assets/Textures.meta b/IronToad_UnityProject/Assets/Textures.meta new file mode 100644 index 0000000..ffdd440 --- /dev/null +++ b/IronToad_UnityProject/Assets/Textures.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 2a6e699820a38a544acfc0015eb679a2 +folderAsset: yes +timeCreated: 1484972317 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/IronToad_UnityProject/Assets/_Scenes/GreyBox_Prototype.meta b/IronToad_UnityProject/Assets/_Scenes/GreyBox_Prototype.meta new file mode 100644 index 0000000..47507ca --- /dev/null +++ b/IronToad_UnityProject/Assets/_Scenes/GreyBox_Prototype.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 338533d5d159c00478a9fb5321b7d922 +folderAsset: yes +timeCreated: 1485007190 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/IronToad_UnityProject/Assets/water/planeWater.prefab b/IronToad_UnityProject/Assets/water/planeWater.prefab index bcacca62b90642a81995ca4a763a0de56cbd58d4..908261ed6e8bade64e048a5582700b8906815274 100644 GIT binary patch delta 196 zcmaFj`N2zofkCmJfkCx^fq_8~$X>8fz*$<9U&gPc?1A{li;AnuoLP?U(*erf+ngbN zn^}{QfstW9kb4n`d4O0Gh(Umnfr;TB14Dxtkj(YA1Y*SpZF~a`#o6G0z k%kbR1U${O{EQy(kfnl?N;uU5dR-o}G9ECp|-owTK0GlH-9RL6T delta 97 zcmez1^~6(vfkBaxfkEX70|SE~kgc#$z*$;Uptke^1H