Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
I'm Mr Meeseeks, look at me!
  • Loading branch information
smz11006 committed Nov 9, 2015
1 parent 2ef6c8c commit 6e157e7
Show file tree
Hide file tree
Showing 35 changed files with 43,328 additions and 299 deletions.
Binary file modified ShipShooter/Assets/Enemies/-Enemy2-RigidBody.prefab
Binary file not shown.
Binary file modified ShipShooter/Assets/Enemies/Enemy1 1.prefab
Binary file not shown.
Binary file modified ShipShooter/Assets/Scenes/GameScene.unity
Binary file not shown.
17 changes: 17 additions & 0 deletions ShipShooter/Assets/Scripts/Enemy1.cs
Expand Up @@ -6,6 +6,13 @@ public class Enemy1 : MonoBehaviour {
public int health = 1; public int health = 1;


public Vector3 enemyAngle = new Vector3(0, 90, 270); public Vector3 enemyAngle = new Vector3(0, 90, 270);
public float test;

//shooting -----------------------
public GameObject turret;
public GameObject bullet;
public Vector3 posCanon;
public GameObject newBullet;




void OnCollisionEnter(Collision collision) void OnCollisionEnter(Collision collision)
Expand All @@ -19,6 +26,16 @@ public class Enemy1 : MonoBehaviour {


void Update() void Update()
{ {
test = gameObject.transform.position.y;
//shooting---------------------------------------------------------------------------------
posCanon = new Vector3(turret.transform.position.x, turret.transform.position.y - 0.5f, turret.transform.position.z);
if (test % 2 == 0)
{
newBullet = (GameObject)Instantiate(bullet, posCanon, transform.rotation);
iTween.MoveTo(posCanon, new Vector3(posCanon.transform.position.x, posCanon.transform.position.y - 20, 5), 1);

}



if (health == 0) if (health == 0)
Destroy(gameObject); Destroy(gameObject);
Expand Down
9 changes: 8 additions & 1 deletion ShipShooter/Assets/Scripts/Enemy2.cs
Expand Up @@ -10,7 +10,10 @@ public class Enemy2 : MonoBehaviour {


public Vector3 enemyAngle = new Vector3(0, 270, 90); public Vector3 enemyAngle = new Vector3(0, 270, 90);



public GameObject turret;
public GameObject bullet;
public Vector3 posCanon;

void OnCollisionEnter(Collision collision) void OnCollisionEnter(Collision collision)
{ {
if (collision.gameObject.tag == "Bullet") if (collision.gameObject.tag == "Bullet")
Expand All @@ -22,7 +25,11 @@ public class Enemy2 : MonoBehaviour {


void Update() void Update()
{ {
//Shooting ===================================================
posCanon = new Vector3(turret.transform.position.x, turret.transform.position.y - 0.5f, turret.transform.position.z);



//Health-----------------------------------------------------------------------------------
if (health == 0) if (health == 0)
Destroy(gameObject); Destroy(gameObject);
if (health == 1) if (health == 1)
Expand Down
319 changes: 313 additions & 6 deletions ShipShooter/Assets/Scripts/PlayerHealth.cs
Expand Up @@ -28,8 +28,8 @@ public class PlayerHealth : MonoBehaviour {






public int playerHealth = 300; public int playerHealth = 100;
public int playerShields = 300; public int playerShields = 100;


//OnCollision //OnCollision
void OnCollisionEnter(Collision collision) void OnCollisionEnter(Collision collision)
Expand All @@ -39,10 +39,24 @@ public class PlayerHealth : MonoBehaviour {
switch (playerShields) switch (playerShields)
{ {
case 0: case 0:
playerHealth = playerHealth - 30; playerHealth = playerHealth - 10;
break; break;
default: default:
playerShields = playerShields - 20; playerShields = playerShields - 10;
break;
}

}
if (collision.gameObject.tag == "Enemy")
{
switch (playerShields)
{
case 0:
playerHealth = playerHealth - 10;
break;
default:
playerShields = playerShields - 10;
break;
} }


} }
Expand All @@ -57,6 +71,299 @@ public class PlayerHealth : MonoBehaviour {
// Update---------------------------------------------------------- // Update----------------------------------------------------------
void Update () void Update ()
{ {

//Shield Switch ------------------------------
} switch(playerShields)
{
case 0:
shieldbar1.SetActive(false);
shieldbar2.SetActive(false);
shieldbar3.SetActive(false);
shieldbar4.SetActive(false);
shieldbar5.SetActive(false);
shieldbar6.SetActive(false);
shieldbar7.SetActive(false);
shieldbar8.SetActive(false);
shieldbar9.SetActive(false);
shieldbar10.SetActive(false);

break;
case 10:
shieldbar1.SetActive(true);
shieldbar2.SetActive(false);
shieldbar3.SetActive(false);
shieldbar4.SetActive(false);
shieldbar5.SetActive(false);
shieldbar6.SetActive(false);
shieldbar7.SetActive(false);
shieldbar8.SetActive(false);
shieldbar9.SetActive(false);
shieldbar10.SetActive(false);

break;
case 20:
shieldbar1.SetActive(true);
shieldbar2.SetActive(true);
shieldbar3.SetActive(false);
shieldbar4.SetActive(false);
shieldbar5.SetActive(false);
shieldbar6.SetActive(false);
shieldbar7.SetActive(false);
shieldbar8.SetActive(false);
shieldbar9.SetActive(false);
shieldbar10.SetActive(false);

break;
case 30:
shieldbar1.SetActive(true);
shieldbar2.SetActive(true);
shieldbar3.SetActive(true);
shieldbar4.SetActive(false);
shieldbar5.SetActive(false);
shieldbar6.SetActive(false);
shieldbar7.SetActive(false);
shieldbar8.SetActive(false);
shieldbar9.SetActive(false);
shieldbar10.SetActive(false);

break;
case 40:
shieldbar1.SetActive(true);
shieldbar2.SetActive(true);
shieldbar3.SetActive(true);
shieldbar4.SetActive(true);
shieldbar5.SetActive(false);
shieldbar6.SetActive(false);
shieldbar7.SetActive(false);
shieldbar8.SetActive(false);
shieldbar9.SetActive(false);
shieldbar10.SetActive(false);

break;
case 50:
shieldbar1.SetActive(true);
shieldbar2.SetActive(true);
shieldbar3.SetActive(true);
shieldbar4.SetActive(true);
shieldbar5.SetActive(true);
shieldbar6.SetActive(false);
shieldbar7.SetActive(false);
shieldbar8.SetActive(false);
shieldbar9.SetActive(false);
shieldbar10.SetActive(false);

break;
case 60:
shieldbar1.SetActive(true);
shieldbar2.SetActive(true);
shieldbar3.SetActive(true);
shieldbar4.SetActive(true);
shieldbar5.SetActive(true);
shieldbar6.SetActive(true);
shieldbar7.SetActive(false);
shieldbar8.SetActive(false);
shieldbar9.SetActive(false);
shieldbar10.SetActive(false);

break;
case 70:
shieldbar1.SetActive(true);
shieldbar2.SetActive(true);
shieldbar3.SetActive(true);
shieldbar4.SetActive(true);
shieldbar5.SetActive(true);
shieldbar6.SetActive(true);
shieldbar7.SetActive(true);
shieldbar8.SetActive(false);
shieldbar9.SetActive(false);
shieldbar10.SetActive(false);

break;
case 80:
shieldbar1.SetActive(true);
shieldbar2.SetActive(true);
shieldbar3.SetActive(true);
shieldbar4.SetActive(true);
shieldbar5.SetActive(true);
shieldbar6.SetActive(true);
shieldbar7.SetActive(true);
shieldbar8.SetActive(true);
shieldbar9.SetActive(false);
shieldbar10.SetActive(false);

break;
case 90:
shieldbar1.SetActive(true);
shieldbar2.SetActive(true);
shieldbar3.SetActive(true);
shieldbar4.SetActive(true);
shieldbar5.SetActive(true);
shieldbar6.SetActive(true);
shieldbar7.SetActive(true);
shieldbar8.SetActive(true);
shieldbar9.SetActive(true);
shieldbar10.SetActive(false);

break;
case 100:
shieldbar1.SetActive(true);
shieldbar2.SetActive(true);
shieldbar3.SetActive(true);
shieldbar4.SetActive(true);
shieldbar5.SetActive(true);
shieldbar6.SetActive(true);
shieldbar7.SetActive(true);
shieldbar8.SetActive(true);
shieldbar9.SetActive(true);
shieldbar10.SetActive(true);

break;
}
//Health Switch ------------------------------
switch (playerHealth)
{
case 0:
healthbar1.SetActive(false);
healthbar2.SetActive(false);
healthbar3.SetActive(false);
healthbar4.SetActive(false);
healthbar5.SetActive(false);
healthbar6.SetActive(false);
healthbar7.SetActive(false);
healthbar8.SetActive(false);
healthbar9.SetActive(false);
healthbar10.SetActive(false);

break;
case 10:
healthbar1.SetActive(true);
healthbar2.SetActive(false);
healthbar3.SetActive(false);
healthbar4.SetActive(false);
healthbar5.SetActive(false);
healthbar6.SetActive(false);
healthbar7.SetActive(false);
healthbar8.SetActive(false);
healthbar9.SetActive(false);
healthbar10.SetActive(false);

break;
case 20:
healthbar1.SetActive(true);
healthbar2.SetActive(true);
healthbar3.SetActive(false);
healthbar4.SetActive(false);
healthbar5.SetActive(false);
healthbar6.SetActive(false);
healthbar7.SetActive(false);
healthbar8.SetActive(false);
healthbar9.SetActive(false);
healthbar10.SetActive(false);

break;
case 30:
healthbar1.SetActive(true);
healthbar2.SetActive(true);
healthbar3.SetActive(true);
healthbar4.SetActive(false);
healthbar5.SetActive(false);
healthbar6.SetActive(false);
healthbar7.SetActive(false);
healthbar8.SetActive(false);
healthbar9.SetActive(false);
healthbar10.SetActive(false);

break;
case 40:
healthbar1.SetActive(true);
healthbar2.SetActive(true);
healthbar3.SetActive(true);
healthbar4.SetActive(true);
healthbar5.SetActive(false);
healthbar6.SetActive(false);
healthbar7.SetActive(false);
healthbar8.SetActive(false);
healthbar9.SetActive(false);
healthbar10.SetActive(false);

break;
case 50:
healthbar1.SetActive(true);
healthbar2.SetActive(true);
healthbar3.SetActive(true);
healthbar4.SetActive(true);
healthbar5.SetActive(true);
healthbar6.SetActive(false);
healthbar7.SetActive(false);
healthbar8.SetActive(false);
healthbar9.SetActive(false);
healthbar10.SetActive(false);

break;
case 60:
healthbar1.SetActive(true);
healthbar2.SetActive(true);
healthbar3.SetActive(true);
healthbar4.SetActive(true);
healthbar5.SetActive(true);
healthbar6.SetActive(true);
healthbar7.SetActive(false);
healthbar8.SetActive(false);
healthbar9.SetActive(false);
healthbar10.SetActive(false);

break;
case 70:
healthbar1.SetActive(true);
healthbar2.SetActive(true);
healthbar3.SetActive(true);
healthbar4.SetActive(true);
healthbar5.SetActive(true);
healthbar6.SetActive(true);
healthbar7.SetActive(true);
healthbar8.SetActive(false);
healthbar9.SetActive(false);
healthbar10.SetActive(false);

break;
case 80:
healthbar1.SetActive(true);
healthbar2.SetActive(true);
healthbar3.SetActive(true);
healthbar4.SetActive(true);
healthbar5.SetActive(true);
healthbar6.SetActive(true);
healthbar7.SetActive(true);
healthbar8.SetActive(true);
healthbar9.SetActive(false);
healthbar10.SetActive(false);

break;
case 90:
healthbar1.SetActive(true);
healthbar2.SetActive(true);
healthbar3.SetActive(true);
healthbar4.SetActive(true);
healthbar5.SetActive(true);
healthbar6.SetActive(true);
healthbar7.SetActive(true);
healthbar8.SetActive(true);
healthbar9.SetActive(true);
healthbar10.SetActive(false);

break;
case 100:
healthbar1.SetActive(true);
healthbar2.SetActive(true);
healthbar3.SetActive(true);
healthbar4.SetActive(true);
healthbar5.SetActive(true);
healthbar6.SetActive(true);
healthbar7.SetActive(true);
healthbar8.SetActive(true);
healthbar9.SetActive(true);
healthbar10.SetActive(true);

break;
}
}
} }
Binary file modified ShipShooter/Library/CurrentLayout.dwlt
Binary file not shown.
Binary file not shown.
Binary file modified ShipShooter/Library/ScriptAssemblies/Assembly-CSharp.dll.mdb
Binary file not shown.

0 comments on commit 6e157e7

Please sign in to comment.