diff --git a/Assets/Level2.unity b/Assets/Level2.unity index c3c3cc5..6652b6a 100644 Binary files a/Assets/Level2.unity and b/Assets/Level2.unity differ diff --git a/Assets/Level3.unity b/Assets/Level3.unity index c45eff1..9ff6168 100644 Binary files a/Assets/Level3.unity and b/Assets/Level3.unity differ diff --git a/Assets/Scripts/EnemyPhysics.cs b/Assets/Scripts/EnemyPhysics.cs index ee9f15e..5a4235b 100644 --- a/Assets/Scripts/EnemyPhysics.cs +++ b/Assets/Scripts/EnemyPhysics.cs @@ -138,20 +138,21 @@ public class EnemyPhysics : MonoBehaviour { //Debug.Log (lastHit); } else if (lastHit=="Weapon"){ - if (hasPowerup){ - Instantiate (PowerupPrefabz, transform.position, Quaternion.identity); - } + audio.PlayOneShot (sound); CancelInvoke ("spawnBullet"); renderer.enabled = false; Invoke("selfDestruct", sound.length ); + dead=true; } } void selfDestruct(){ - - dead = true; + if (hasPowerup){ + Instantiate (PowerupPrefabz, transform.position, Quaternion.identity); + } + //dead = true; DestroyObject(this.gameObject); } @@ -179,14 +180,10 @@ public class EnemyPhysics : MonoBehaviour { } if (this.transform.position.y < -6){ - SelfDestruct(); + selfDestruct(); } } - void SelfDestruct(){ - DestroyObject (this.gameObject); - } - void startFiring(){InvokeRepeating ("spawnBullet", shootSpeed, shootSpeed);} void spawnBullet(){ Instantiate (bullet, transform.position, Quaternion.identity); diff --git a/Builds/Builds.unity3d b/Builds/Builds.unity3d index 4b468b1..ef9c7c2 100644 Binary files a/Builds/Builds.unity3d and b/Builds/Builds.unity3d differ