diff --git a/ShipShooter/Assets/Enemies/-Enemy2-RigidBody.prefab b/ShipShooter/Assets/Enemies/-Enemy2-RigidBody.prefab
index 5627f99b..d3d6a70e 100644
Binary files a/ShipShooter/Assets/Enemies/-Enemy2-RigidBody.prefab and b/ShipShooter/Assets/Enemies/-Enemy2-RigidBody.prefab differ
diff --git a/ShipShooter/Assets/Enemies/Enemy2Bullet.prefab b/ShipShooter/Assets/Enemies/Enemy2Bullet.prefab
index 10453b11..49bca5da 100644
Binary files a/ShipShooter/Assets/Enemies/Enemy2Bullet.prefab and b/ShipShooter/Assets/Enemies/Enemy2Bullet.prefab differ
diff --git a/ShipShooter/Assets/Scenes/GameScene.unity b/ShipShooter/Assets/Scenes/GameScene.unity
index 060511f4..afde90a3 100644
Binary files a/ShipShooter/Assets/Scenes/GameScene.unity and b/ShipShooter/Assets/Scenes/GameScene.unity differ
diff --git a/ShipShooter/Assets/Scripts/BackgroundScroll.cs b/ShipShooter/Assets/Scripts/BackgroundScroll.cs
index 4bbb8ec5..9546b70e 100644
--- a/ShipShooter/Assets/Scripts/BackgroundScroll.cs
+++ b/ShipShooter/Assets/Scripts/BackgroundScroll.cs
@@ -5,6 +5,6 @@ public class BackgroundScroll : MonoBehaviour {
void Start ()
{
- iTween.MoveTo(gameObject, iTween.Hash("path", iTweenPath.GetPath("BackgroundTrack"), "time", 30, "transition", "easeinSine"));
+ iTween.MoveTo(gameObject, iTween.Hash("path", iTweenPath.GetPath("BackgroundTrack"), "time", 60));
}
}
diff --git a/ShipShooter/Assets/Scripts/Enemy1.cs b/ShipShooter/Assets/Scripts/Enemy1.cs
index 0793d24b..a0a38df1 100644
--- a/ShipShooter/Assets/Scripts/Enemy1.cs
+++ b/ShipShooter/Assets/Scripts/Enemy1.cs
@@ -31,7 +31,7 @@ public class Enemy1 : MonoBehaviour {
testInt = Mathf.RoundToInt(test);
//shooting---------------------------------------------------------------------------------
posCanon = new Vector3(turret.transform.position.x, turret.transform.position.y - 0.5f, turret.transform.position.z);
- if (testInt % 2 == 0)
+ if (testInt % 4 == 0)
{
newBullet = (GameObject)Instantiate(bullet, posCanon, transform.rotation);
iTween.MoveTo(newBullet, new Vector3(newBullet.transform.position.x, newBullet.transform.position.y - 40, 5), 1);
diff --git a/ShipShooter/Assets/Scripts/Enemy2.cs b/ShipShooter/Assets/Scripts/Enemy2.cs
index 7f88337d..66491120 100644
--- a/ShipShooter/Assets/Scripts/Enemy2.cs
+++ b/ShipShooter/Assets/Scripts/Enemy2.cs
@@ -13,23 +13,42 @@ public class Enemy2 : MonoBehaviour {
public GameObject turret;
public GameObject bullet;
public Vector3 posCanon;
-
+
+ public float test;
+ public int testInt;
+ public GameObject newBullet;
+
+ public Vector3 playerPos;
+ public GameObject player;
+
void OnCollisionEnter(Collision collision)
{
if (collision.gameObject.tag == "Bullet")
{
+ Destroy(gameObject);
- health = health - 1;
}
}
void Update()
{
+
+
+ playerPos = new Vector3(player.transform.position.x, player.transform.position.y - 30, player.transform.position.z);
+
//Shooting ===================================================
- posCanon = new Vector3(turret.transform.position.x, turret.transform.position.y - 0.5f, turret.transform.position.z);
+ posCanon = new Vector3(gameObject.transform.position.x, gameObject.transform.position.y - 0.5f, gameObject.transform.position.z);
+ test = gameObject.transform.position.y;
+ testInt = Mathf.RoundToInt(test);
+ //shooting---------------------------------------------------------------------------------
+ if (testInt % 4 == 0)
+ {
+ newBullet = (GameObject)Instantiate(bullet, posCanon, transform.rotation);
+ iTween.MoveTo(newBullet, playerPos, 1);
+ }
-//Health-----------------------------------------------------------------------------------
+ //Health-----------------------------------------------------------------------------------
if (health == 0)
Destroy(gameObject);
if (health == 1)
diff --git a/ShipShooter/Assets/Scripts/EnemySpawner.cs b/ShipShooter/Assets/Scripts/EnemySpawner.cs
index 8581efdd..6997da5b 100644
--- a/ShipShooter/Assets/Scripts/EnemySpawner.cs
+++ b/ShipShooter/Assets/Scripts/EnemySpawner.cs
@@ -56,7 +56,7 @@ public class EnemySpawner : MonoBehaviour {
public void EdgeSpawn()
{
enemy1_left1 = (GameObject)Instantiate(enemy1, spawn1, Quaternion.Euler(enemyAngle));
- enemy1_right1 = (GameObject)Instantiate(enemy1, spawn1, Quaternion.Euler(enemyAngle));
+ enemy1_right1 = (GameObject)Instantiate(enemy1, spawn12, Quaternion.Euler(enemyAngle));
iTween.MoveTo(enemy1_left1, iTween.Hash("path", iTweenPath.GetPath("LeftCurve1"), "time", 10));
iTween.MoveTo(enemy1_right1, iTween.Hash("path", iTweenPath.GetPath("RightCurve1"), "time", 10));
@@ -64,7 +64,7 @@ public class EnemySpawner : MonoBehaviour {
public void EdgeSpawnIn()
{
enemy1_left2 = (GameObject)Instantiate(enemy1, spawn2, Quaternion.Euler(enemyAngle));
- enemy1_right2 = (GameObject)Instantiate(enemy1, spawn2, Quaternion.Euler(enemyAngle));
+ enemy1_right2 = (GameObject)Instantiate(enemy1, spawn11, Quaternion.Euler(enemyAngle));
iTween.MoveTo(enemy1_left2, iTween.Hash("path", iTweenPath.GetPath("LeftCurve2"), "time", 10));
iTween.MoveTo(enemy1_right2, iTween.Hash("path", iTweenPath.GetPath("RightCurve2"), "time", 10));
@@ -74,13 +74,30 @@ public class EnemySpawner : MonoBehaviour {
public void EdgeSpawnLast()
{
enemy1_left3 = (GameObject)Instantiate(enemy1, spawn3, Quaternion.Euler(enemyAngle));
- enemy1_right3 = (GameObject)Instantiate(enemy1, spawn3, Quaternion.Euler(enemyAngle));
+ enemy1_right3 = (GameObject)Instantiate(enemy1, spawn10, Quaternion.Euler(enemyAngle));
iTween.MoveTo(enemy1_left3, iTween.Hash("path", iTweenPath.GetPath("LeftCurve3"), "time", 10));
iTween.MoveTo(enemy1_right3, iTween.Hash("path", iTweenPath.GetPath("RightCurve3"), "time", 10));
}
+ public void MidSpawnEdges()
+ {
+ enemy1_left1 = (GameObject)Instantiate(enemy2, spawn4, Quaternion.Euler(enemyAngle));
+ enemy1_right1 = (GameObject)Instantiate(enemy2, spawn9, Quaternion.Euler(enemyAngle));
+
+ iTween.MoveTo(enemy1_left1, iTween.Hash("path", iTweenPath.GetPath("CrossPath Mid-Left 1"), "time", 10));
+ iTween.MoveTo(enemy1_right1, iTween.Hash("path", iTweenPath.GetPath("CrossPath Mid-Right 1"), "time", 10));
+ }
+ public void MidSpawnMids()
+ {
+ enemy1_left1 = (GameObject)Instantiate(enemy2, spawn5, Quaternion.Euler(enemyAngle));
+ enemy1_right1 = (GameObject)Instantiate(enemy2, spawn8, Quaternion.Euler(enemyAngle));
+
+ iTween.MoveTo(enemy1_left1, iTween.Hash("path", iTweenPath.GetPath("CrossPath Mid-Left 2"), "time", 10));
+ iTween.MoveTo(enemy1_right1, iTween.Hash("path", iTweenPath.GetPath("CrossPath Mid-Right 2"), "time", 10));
+ }
+
//IEnumerator
IEnumerator EnemySpawn()
{
@@ -91,7 +108,7 @@ public class EnemySpawner : MonoBehaviour {
Debug.Log("Enumerator Starts");
enemy1count = 1;
enemy1_left1 = (GameObject)Instantiate(enemy1, spawn1, Quaternion.Euler(enemyAngle));
- enemy1_right1 = (GameObject)Instantiate(enemy1, spawn1, Quaternion.Euler(enemyAngle));
+ enemy1_right1 = (GameObject)Instantiate(enemy1, spawn12, Quaternion.Euler(enemyAngle));
iTween.MoveTo(enemy1_left1, iTween.Hash("path", iTweenPath.GetPath("LeftCurve1"), "time", 10));
iTween.MoveTo(enemy1_right1, iTween.Hash("path", iTweenPath.GetPath("RightCurve1"), "time", 10));
@@ -100,7 +117,7 @@ public class EnemySpawner : MonoBehaviour {
yield return new WaitForSeconds(0.2f);
enemy1_left2 = (GameObject)Instantiate(enemy1, spawn2, Quaternion.Euler(enemyAngle));
- enemy1_right2 = (GameObject)Instantiate(enemy1, spawn2, Quaternion.Euler(enemyAngle));
+ enemy1_right2 = (GameObject)Instantiate(enemy1, spawn11, Quaternion.Euler(enemyAngle));
iTween.MoveTo(enemy1_left2, iTween.Hash("path", iTweenPath.GetPath("LeftCurve2"), "time", 10));
iTween.MoveTo(enemy1_right2, iTween.Hash("path", iTweenPath.GetPath("RightCurve2"), "time", 10));
@@ -113,9 +130,22 @@ public class EnemySpawner : MonoBehaviour {
iTween.MoveTo(enemy1_left3, iTween.Hash("path", iTweenPath.GetPath("LeftCurve3"), "time", 10));
iTween.MoveTo(enemy1_right3, iTween.Hash("path", iTweenPath.GetPath("RightCurve3"), "time", 10));
// EdgeSpawnLast();
+
+ yield return new WaitForSeconds(2f);
+ MidSpawnEdges();
+
+ yield return new WaitForSeconds(2f);
+ MidSpawnMids();
+ yield return new WaitForSeconds(2f);
+
+ EdgeSpawn();
+ MidSpawnEdges();
+ yield return new WaitForSeconds(2f);
+
+
+
Debug.Log("enumerator Ends");
- //randomNum = Random.Range(1, 3);
- //enemy1count = 0;
+
}
}
diff --git a/ShipShooter/Assets/Scripts/Legosteroid.cs b/ShipShooter/Assets/Scripts/Legosteroid.cs
new file mode 100644
index 00000000..593a978a
--- /dev/null
+++ b/ShipShooter/Assets/Scripts/Legosteroid.cs
@@ -0,0 +1,11 @@
+using UnityEngine;
+using System.Collections;
+
+public class Legosteroid : MonoBehaviour {
+
+ public gameObject legosteroid;
+ public gameObject piece1;
+ public gameObject piece2;
+ public gameObject piece3;
+ public gameObject piece4;
+}
diff --git a/ShipShooter/Assets/Scripts/Legosteroid.cs.meta b/ShipShooter/Assets/Scripts/Legosteroid.cs.meta
new file mode 100644
index 00000000..ab10ae2e
--- /dev/null
+++ b/ShipShooter/Assets/Scripts/Legosteroid.cs.meta
@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: 5906a6a77aa99d442a84c7cffa7b6507
+timeCreated: 1447124083
+licenseType: Free
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/ShipShooter/Assets/Scripts/PlayerHealth.cs b/ShipShooter/Assets/Scripts/PlayerHealth.cs
index c29b77bd..708eb77d 100644
--- a/ShipShooter/Assets/Scripts/PlayerHealth.cs
+++ b/ShipShooter/Assets/Scripts/PlayerHealth.cs
@@ -26,6 +26,12 @@ public class PlayerHealth : MonoBehaviour {
public GameObject shieldbar9;
public GameObject shieldbar10;
+ //Player Position =====================
+ public Vector3 playerPos;
+ public Vector3 staticPos;
+
+ public float distance;
+ public int distanceInt;
public int playerHealth = 100;
@@ -62,21 +68,39 @@ public class PlayerHealth : MonoBehaviour {
}
}
- if (playerHealth == 0)
- {
- }
+
//Start-----------------------------------------------------------
void Start()
{
-
+ staticPos = new Vector3(gameObject.transform.position.x, gameObject.transform.position.y, gameObject.transform.position.z);
}
// Update----------------------------------------------------------
void Update ()
{
+ //Death Condition ----------------------------
+ if (playerHealth <= 0)
+ {
+ Application.LoadLevel(2);
+ }
+ //Shield Regen
+ playerPos = new Vector3(gameObject.transform.position.x, gameObject.transform.position.y, gameObject.transform.position.z);
+ distance = Vector3.Distance(playerPos, staticPos);
+ distanceInt = Mathf.RoundToInt(distance);
+
+ if (playerShields < 100)
+ {
+ if (distanceInt % 10 == 0)
+ {
+ playerShields = playerShields + 10;
+ // staticPos = new Vector3(gameObject.transform.position.x, gameObject.transform.position.y, gameObject.transform.position.z);
+ staticPos = playerPos;
+ }
+ }
+
//Shield Switch ------------------------------
- switch(playerShields)
+ switch (playerShields)
{
case 0:
shieldbar1.SetActive(false);
diff --git a/ShipShooter/Library/CurrentLayout.dwlt b/ShipShooter/Library/CurrentLayout.dwlt
index e48bebab..60715c5f 100644
Binary files a/ShipShooter/Library/CurrentLayout.dwlt and b/ShipShooter/Library/CurrentLayout.dwlt differ
diff --git a/ShipShooter/Library/ScriptAssemblies/Assembly-CSharp-Editor.dll.mdb b/ShipShooter/Library/ScriptAssemblies/Assembly-CSharp-Editor.dll.mdb
index b452b3c6..c283da44 100644
Binary files a/ShipShooter/Library/ScriptAssemblies/Assembly-CSharp-Editor.dll.mdb and b/ShipShooter/Library/ScriptAssemblies/Assembly-CSharp-Editor.dll.mdb differ
diff --git a/ShipShooter/Library/ScriptAssemblies/Assembly-CSharp.dll.mdb b/ShipShooter/Library/ScriptAssemblies/Assembly-CSharp.dll.mdb
index f1aa4c0f..700fee6a 100644
Binary files a/ShipShooter/Library/ScriptAssemblies/Assembly-CSharp.dll.mdb and b/ShipShooter/Library/ScriptAssemblies/Assembly-CSharp.dll.mdb differ
diff --git a/ShipShooter/Library/assetDatabase3 b/ShipShooter/Library/assetDatabase3
index f49e13b7..1f8df302 100644
Binary files a/ShipShooter/Library/assetDatabase3 and b/ShipShooter/Library/assetDatabase3 differ
diff --git a/ShipShooter/Library/expandedItems b/ShipShooter/Library/expandedItems
index 038264dc..2cada958 100644
Binary files a/ShipShooter/Library/expandedItems and b/ShipShooter/Library/expandedItems differ
diff --git a/ShipShooter/Library/metadata/00/00000000000000004000000000000000 b/ShipShooter/Library/metadata/00/00000000000000004000000000000000
index 3b46ef8d..3a663f1a 100644
Binary files a/ShipShooter/Library/metadata/00/00000000000000004000000000000000 and b/ShipShooter/Library/metadata/00/00000000000000004000000000000000 differ
diff --git a/ShipShooter/Library/metadata/3d/3d6f92a605a842645b772002f4f174a9 b/ShipShooter/Library/metadata/3d/3d6f92a605a842645b772002f4f174a9
index 780b3993..961372ec 100644
Binary files a/ShipShooter/Library/metadata/3d/3d6f92a605a842645b772002f4f174a9 and b/ShipShooter/Library/metadata/3d/3d6f92a605a842645b772002f4f174a9 differ
diff --git a/ShipShooter/Library/metadata/59/5906a6a77aa99d442a84c7cffa7b6507 b/ShipShooter/Library/metadata/59/5906a6a77aa99d442a84c7cffa7b6507
new file mode 100644
index 00000000..54e8ce40
Binary files /dev/null and b/ShipShooter/Library/metadata/59/5906a6a77aa99d442a84c7cffa7b6507 differ
diff --git a/ShipShooter/Library/metadata/59/5906a6a77aa99d442a84c7cffa7b6507.info b/ShipShooter/Library/metadata/59/5906a6a77aa99d442a84c7cffa7b6507.info
new file mode 100644
index 00000000..44d5cfc8
Binary files /dev/null and b/ShipShooter/Library/metadata/59/5906a6a77aa99d442a84c7cffa7b6507.info differ
diff --git a/ShipShooter/Library/metadata/66/664b40cee94497647a1815c7bd525a6c b/ShipShooter/Library/metadata/66/664b40cee94497647a1815c7bd525a6c
index b770a428..47dacbeb 100644
Binary files a/ShipShooter/Library/metadata/66/664b40cee94497647a1815c7bd525a6c and b/ShipShooter/Library/metadata/66/664b40cee94497647a1815c7bd525a6c differ
diff --git a/ShipShooter/Library/metadata/b3/b3fbc82f895666d44928830fde115913 b/ShipShooter/Library/metadata/b3/b3fbc82f895666d44928830fde115913
index f2e5baba..e38bd1d9 100644
Binary files a/ShipShooter/Library/metadata/b3/b3fbc82f895666d44928830fde115913 and b/ShipShooter/Library/metadata/b3/b3fbc82f895666d44928830fde115913 differ
diff --git a/ShipShooter/Library/metadata/b8/b8d9d8ca408b6484eb25aa1be2f7919b b/ShipShooter/Library/metadata/b8/b8d9d8ca408b6484eb25aa1be2f7919b
index e3dd0b09..ea8d0277 100644
Binary files a/ShipShooter/Library/metadata/b8/b8d9d8ca408b6484eb25aa1be2f7919b and b/ShipShooter/Library/metadata/b8/b8d9d8ca408b6484eb25aa1be2f7919b differ
diff --git a/ShipShooter/Library/metadata/f7/f7772ef56e6010145ace7cd4ac93f07d b/ShipShooter/Library/metadata/f7/f7772ef56e6010145ace7cd4ac93f07d
index f1658e11..5ae01618 100644
Binary files a/ShipShooter/Library/metadata/f7/f7772ef56e6010145ace7cd4ac93f07d and b/ShipShooter/Library/metadata/f7/f7772ef56e6010145ace7cd4ac93f07d differ
diff --git a/ShipShooter/ShipShooter.CSharp.csproj b/ShipShooter/ShipShooter.CSharp.csproj
index f58634a2..bae9a557 100644
--- a/ShipShooter/ShipShooter.CSharp.csproj
+++ b/ShipShooter/ShipShooter.CSharp.csproj
@@ -73,6 +73,7 @@
+