Skip to content
Permalink
Browse files

Killing enemy1 works

  • Loading branch information
smz11006 committed Nov 8, 2015
1 parent 32ba694 commit 1541fe97968485f4103bfb249bc7208f38d76131
Binary file not shown.

Some generated files are not rendered by default. Learn more.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -3,13 +3,22 @@

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);
}

}
@@ -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;

@@ -45,6 +45,8 @@ void Start ()
// Update is called once per frame
void Update ()
{
if (transform.eulerAngles != playerAngle)
transform.eulerAngles = playerAngle;

//Movement------------------------------------------------------------------------------------------------------------
//Left
@@ -88,22 +90,16 @@ void Update ()
//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);

}

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN +36 Bytes (100%) ShipShooter/Library/expandedItems
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -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>
@@ -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>

0 comments on commit 1541fe9

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