Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Killing enemy1 works
  • Loading branch information
smz11006 committed Nov 8, 2015
1 parent 32ba694 commit 1541fe9
Show file tree
Hide file tree
Showing 24 changed files with 26 additions and 42 deletions.
Binary file modified ShipShooter/Assets/Enemies/Enemy1 1.prefab
Binary file not shown.
2 changes: 1 addition & 1 deletion ShipShooter/Assets/Enemies/Enemy1 1.prefab.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified ShipShooter/Assets/Enemies/Enemy2.prefab
Binary file not shown.
Binary file modified ShipShooter/Assets/Enemies/Legosteroid.prefab
Binary file not shown.
Binary file modified ShipShooter/Assets/Player/BulletLego.prefab
Binary file not shown.
Binary file modified ShipShooter/Assets/Scenes/GameScene.unity
Binary file not shown.
27 changes: 18 additions & 9 deletions ShipShooter/Assets/Scripts/Enemy1.cs
Expand Up @@ -3,13 +3,22 @@ using System.Collections;

public class Enemy1 : MonoBehaviour {

// Use this for initialization
void Start () {

}

// Update is called once per frame
void Update () {

}
public int health = 1;

void OnCollisionEnter(Collision collision)
{
if (collision.gameObject.tag == "Bullet")
{
Destroy(gameObject);

}
}

void Update()
{

if (health == 0)
Destroy(gameObject);
}

}
18 changes: 7 additions & 11 deletions ShipShooter/Assets/Scripts/PlayerControls.cs
Expand Up @@ -11,7 +11,7 @@ public class PlayerControls : MonoBehaviour {
public float yPos;

public Vector3 playerLocation;

public Vector3 playerAngle = new Vector3(270, 0, 0);
//Counting shit
public float distance = 0.25f;

Expand Down Expand Up @@ -45,6 +45,8 @@ public class PlayerControls : MonoBehaviour {
// Update is called once per frame
void Update ()
{
if (transform.eulerAngles != playerAngle)
transform.eulerAngles = playerAngle;

//Movement------------------------------------------------------------------------------------------------------------
//Left
Expand Down Expand Up @@ -88,22 +90,16 @@ public class PlayerControls : MonoBehaviour {
//Canon positions


posLeftCanon = new Vector3(leftCanon.transform.position.x, leftCanon.transform.position.y, leftCanon.transform.position.z);
posRightCanon = new Vector3(rightCanon.transform.position.x + 1.21f, rightCanon.transform.position.y, rightCanon.transform.position.z);
posLeftCanon = new Vector3(leftCanon.transform.position.x, leftCanon.transform.position.y + 0.5f, leftCanon.transform.position.z);
posRightCanon = new Vector3(rightCanon.transform.position.x + 1.21f, rightCanon.transform.position.y + 0.5f, rightCanon.transform.position.z);

//Spawn Bullets
if (Input.GetKeyDown(KeyCode.Space))
{
leftBullet = (GameObject) Instantiate(playerBullet, posLeftCanon, transform.rotation);
iTween.MoveTo(leftBullet, new Vector3(leftBullet.transform.position.x, leftBullet.transform.position.y + 20, 5), 1);
// Instantiate(playerBullet, posLeftCanon, Quaternion.identity);
// // iTween.MoveTo.
//// rigidBullet.AddForce(transform.forward * thurst);
// rigidBullet.AddRelativeForce(transform.forward * thurst);


Debug.Log("got to the second");
Instantiate(playerBullet, posRightCanon, Quaternion.identity);
rightBullet = (GameObject)Instantiate(playerBullet, posRightCanon, transform.rotation);
iTween.MoveTo(rightBullet, new Vector3(rightBullet.transform.position.x, rightBullet.transform.position.y + 20, 5), 1);

}

Expand Down
Binary file modified ShipShooter/Library/CurrentLayout.dwlt
Binary file not shown.
Binary file modified ShipShooter/Library/InspectorExpandedItems.asset
Binary file not shown.
Binary file not shown.
Binary file modified ShipShooter/Library/ScriptAssemblies/Assembly-CSharp.dll.mdb
Binary file not shown.
Binary file modified ShipShooter/Library/assetDatabase3
Binary file not shown.
Binary file modified ShipShooter/Library/expandedItems
Binary file not shown.
Binary file modified ShipShooter/Library/metadata/00/00000000000000003000000000000000
Binary file not shown.
Binary file modified ShipShooter/Library/metadata/00/00000000000000004000000000000000
Binary file not shown.
Binary file modified ShipShooter/Library/metadata/3d/3d6f92a605a842645b772002f4f174a9
Binary file not shown.
Binary file modified ShipShooter/Library/metadata/6f/6ffdc1109f146e94aadecee927f14e26
Binary file not shown.
Binary file not shown.
Binary file modified ShipShooter/Library/metadata/90/9036b8076da40aa4bbfa8c39d824e915
Binary file not shown.
Binary file not shown.
Binary file modified ShipShooter/ProjectSettings/TagManager.asset
Binary file not shown.
15 changes: 0 additions & 15 deletions ShipShooter/ShipShooter.CSharp.Editor.csproj
Expand Up @@ -105,21 +105,6 @@
<Reference Include="SyntaxTree.VisualStudio.Unity.Bridge">
<HintPath>Library\UnityAssemblies\SyntaxTree.VisualStudio.Unity.Bridge.dll</HintPath>
</Reference>
<Reference Include="UnityEditor.Networking">
<HintPath>Library\UnityAssemblies\UnityEditor.Networking.dll</HintPath>
</Reference>
<Reference Include="UnityEditor.UI">
<HintPath>Library\UnityAssemblies\UnityEditor.UI.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.Networking">
<HintPath>Library\UnityAssemblies\UnityEngine.Networking.dll</HintPath>
</Reference>
<Reference Include="UnityEditor.Advertisements">
<HintPath>Library\UnityAssemblies\UnityEditor.Advertisements.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.UI">
<HintPath>Library\UnityAssemblies\UnityEngine.UI.dll</HintPath>
</Reference>
<Reference Include="Mono.Cecil">
<HintPath>Library\UnityAssemblies\Mono.Cecil.dll</HintPath>
</Reference>
Expand Down
6 changes: 0 additions & 6 deletions ShipShooter/ShipShooter.CSharp.csproj
Expand Up @@ -57,12 +57,6 @@
<Reference Include="UnityEngine.Networking">
<HintPath>Library\UnityAssemblies\UnityEngine.Networking.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.Networking">
<HintPath>Library\UnityAssemblies\UnityEngine.Networking.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.UI">
<HintPath>Library\UnityAssemblies\UnityEngine.UI.dll</HintPath>
</Reference>
<Reference Include="UnityEditor">
<HintPath>Library\UnityAssemblies\UnityEditor.dll</HintPath>
</Reference>
Expand Down

0 comments on commit 1541fe9

Please sign in to comment.