Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Level 2 small edit
  • Loading branch information
ifb10001 committed Dec 3, 2013
1 parent 6d0fa95 commit 84c7f11
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 10 deletions.
Binary file modified Assets/Level2.unity
Binary file not shown.
Binary file modified Assets/Level3.unity
Binary file not shown.
17 changes: 7 additions & 10 deletions Assets/Scripts/EnemyPhysics.cs
Expand Up @@ -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);
}

Expand Down Expand Up @@ -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);
Expand Down
Binary file modified Builds/Builds.unity3d
Binary file not shown.

0 comments on commit 84c7f11

Please sign in to comment.