Skip to content
Permalink
Browse files

I'm Mr Meeseeks, look at me!

  • Loading branch information
smz11006 committed Nov 9, 2015
1 parent 2ef6c8c commit 6e157e73d675e064596bb577decdf45b767e1380
Showing with 43,328 additions and 299 deletions.
  1. BIN ShipShooter/Assets/Enemies/-Enemy2-RigidBody.prefab
  2. BIN ShipShooter/Assets/Enemies/Enemy1 1.prefab
  3. BIN ShipShooter/Assets/Scenes/GameScene.unity
  4. +17 −0 ShipShooter/Assets/Scripts/Enemy1.cs
  5. +8 −1 ShipShooter/Assets/Scripts/Enemy2.cs
  6. +313 −6 ShipShooter/Assets/Scripts/PlayerHealth.cs
  7. BIN ShipShooter/Library/CurrentLayout.dwlt
  8. BIN ShipShooter/Library/ScriptAssemblies/Assembly-CSharp-Editor.dll.mdb
  9. BIN ShipShooter/Library/ScriptAssemblies/Assembly-CSharp.dll.mdb
  10. +8 −0 ShipShooter/Library/UnityAssemblies/Mono.Cecil.xml
  11. +8 −0 ShipShooter/Library/UnityAssemblies/SyntaxTree.VisualStudio.Unity.Bridge.xml
  12. +8 −0 ShipShooter/Library/UnityAssemblies/UnityEditor.Android.Extensions.xml
  13. +8 −0 ShipShooter/Library/UnityAssemblies/UnityEditor.Graphs.xml
  14. +8 −0 ShipShooter/Library/UnityAssemblies/UnityEditor.LinuxStandalone.Extensions.xml
  15. +8 −0 ShipShooter/Library/UnityAssemblies/UnityEditor.Metro.Extensions.xml
  16. +8 −0 ShipShooter/Library/UnityAssemblies/UnityEditor.OSXStandalone.Extensions.xml
  17. +8 −0 ShipShooter/Library/UnityAssemblies/UnityEditor.SamsungTV.Extensions.xml
  18. +8 −0 ShipShooter/Library/UnityAssemblies/UnityEditor.Tizen.Extensions.xml
  19. +8 −0 ShipShooter/Library/UnityAssemblies/UnityEditor.WP8.Extensions.xml
  20. +8 −0 ShipShooter/Library/UnityAssemblies/UnityEditor.WebGL.Extensions.xml
  21. +8 −0 ShipShooter/Library/UnityAssemblies/UnityEditor.WindowsStandalone.Extensions.xml
  22. +8 −0 ShipShooter/Library/UnityAssemblies/UnityEditor.iOS.Extensions.Xcode.xml
  23. +14 −0 ShipShooter/Library/UnityAssemblies/UnityEditor.iOS.Extensions.xml
  24. +0 −155 ShipShooter/Library/UnityAssemblies/UnityEngine.Advertisements.xml
  25. +0 −123 ShipShooter/Library/UnityAssemblies/UnityEngine.Analytics.xml
  26. +42,872 −0 ShipShooter/Library/UnityAssemblies/UnityEngine.xml
  27. +0 −2 ShipShooter/Library/UnityAssemblies/version.txt
  28. BIN ShipShooter/Library/assetDatabase3
  29. BIN ShipShooter/Library/expandedItems
  30. BIN ShipShooter/Library/metadata/00/00000000000000004000000000000000
  31. BIN ShipShooter/Library/metadata/3d/3d6f92a605a842645b772002f4f174a9
  32. BIN ShipShooter/Library/metadata/66/664b40cee94497647a1815c7bd525a6c
  33. BIN ShipShooter/Library/metadata/b3/b3fbc82f895666d44928830fde115913
  34. +0 −6 ShipShooter/ShipShooter.CSharp.Editor.csproj
  35. +0 −6 ShipShooter/ShipShooter.CSharp.csproj
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -6,6 +6,13 @@ public class Enemy1 : MonoBehaviour {
public int health = 1;

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)
@@ -19,6 +26,16 @@ void OnCollisionEnter(Collision collision)

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)
Destroy(gameObject);
@@ -10,7 +10,10 @@ public class Enemy2 : MonoBehaviour {

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


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

void OnCollisionEnter(Collision collision)
{
if (collision.gameObject.tag == "Bullet")
@@ -22,7 +25,11 @@ void OnCollisionEnter(Collision collision)

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


//Health-----------------------------------------------------------------------------------
if (health == 0)
Destroy(gameObject);
if (health == 1)
@@ -28,8 +28,8 @@ public class PlayerHealth : MonoBehaviour {



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

//OnCollision
void OnCollisionEnter(Collision collision)
@@ -39,10 +39,24 @@ void OnCollisionEnter(Collision collision)
switch (playerShields)
{
case 0:
playerHealth = playerHealth - 30;
playerHealth = playerHealth - 10;
break;
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;
}

}
@@ -57,6 +71,299 @@ void Start()
// 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 not shown.
Binary file not shown.
Binary file not shown.

0 comments on commit 6e157e7

Please sign in to comment.
You can’t perform that action at this time.