Browse Source

Game over only if high forward vel;

master
Joshua Reason 7 years ago
parent
commit
0d9c62cfbd
7 changed files with 46 additions and 3 deletions
  1. BIN
      IronToad_UnityProject/Assets/Animations/WaveRing.controller
  2. +10
    -3
      IronToad_UnityProject/Assets/Scripts/BoatController.cs
  3. +9
    -0
      IronToad_UnityProject/Assets/Sound/Music.meta
  4. +9
    -0
      IronToad_UnityProject/Assets/Sound/SFX.meta
  5. +9
    -0
      IronToad_UnityProject/Assets/Textures.meta
  6. +9
    -0
      IronToad_UnityProject/Assets/_Scenes/GreyBox_Prototype.meta
  7. BIN
      IronToad_UnityProject/Assets/water/planeWater.prefab

BIN
IronToad_UnityProject/Assets/Animations/WaveRing.controller View File


+ 10
- 3
IronToad_UnityProject/Assets/Scripts/BoatController.cs View File

@ -6,7 +6,7 @@ using UnityEngine;
public class BoatController : BuoyantObject { public class BoatController : BuoyantObject {
public float trunSpeed = 0.5f; public float trunSpeed = 0.5f;
public float breakSpeed = 20f;
// Use this for initialization // Use this for initialization
void Start() { void Start() {
@ -26,8 +26,15 @@ public class BoatController : BuoyantObject {
} }
void OnCollisionEnter(Collision collision) { 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");
}
}
} }

+ 9
- 0
IronToad_UnityProject/Assets/Sound/Music.meta View File

@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 1715d56e0d2b68246a82993db31014ab
folderAsset: yes
timeCreated: 1485006712
licenseType: Free
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

+ 9
- 0
IronToad_UnityProject/Assets/Sound/SFX.meta View File

@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: de5a3adcedb96f64183518ac89622ade
folderAsset: yes
timeCreated: 1485006712
licenseType: Free
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

+ 9
- 0
IronToad_UnityProject/Assets/Textures.meta View File

@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 2a6e699820a38a544acfc0015eb679a2
folderAsset: yes
timeCreated: 1484972317
licenseType: Free
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

+ 9
- 0
IronToad_UnityProject/Assets/_Scenes/GreyBox_Prototype.meta View File

@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 338533d5d159c00478a9fb5321b7d922
folderAsset: yes
timeCreated: 1485007190
licenseType: Free
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

BIN
IronToad_UnityProject/Assets/water/planeWater.prefab View File


Loading…
Cancel
Save