TO SQUASH: Added laser firing.
This commit is contained in:
@@ -38,6 +38,10 @@ public class Player : MonoBehaviour
|
||||
|
||||
public GameObject verticalBarrierPrefab;
|
||||
|
||||
public GameObject horizontalLaserPrefab;
|
||||
|
||||
public GameObject verticalLaserPrefab;
|
||||
|
||||
public int lives = 8;
|
||||
|
||||
public int score = 0;
|
||||
@@ -109,6 +113,7 @@ public class Player : MonoBehaviour
|
||||
return;
|
||||
}
|
||||
|
||||
// TODO: Generalize this to work with subset of the board bounds.
|
||||
// Initialize the magnets.
|
||||
magnetLeft.GetComponent<SpriteRenderer>().enabled = false;
|
||||
magnetRight.GetComponent<SpriteRenderer>().enabled = false;
|
||||
@@ -367,14 +372,14 @@ public class Player : MonoBehaviour
|
||||
muzzleAnimator.SetTrigger("firing");
|
||||
laserCount--;
|
||||
|
||||
// if (flipped)
|
||||
// {
|
||||
// Instantiate(verticalBarrierPrefab, transform.position, Quaternion.identity);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// Instantiate(horizontalBarrierPrefab, transform.position, Quaternion.identity);
|
||||
// }
|
||||
if (flipped)
|
||||
{
|
||||
Instantiate(verticalLaserPrefab, transform.position, Quaternion.identity);
|
||||
}
|
||||
else
|
||||
{
|
||||
Instantiate(horizontalLaserPrefab, transform.position, Quaternion.identity);
|
||||
}
|
||||
|
||||
DisableLaser();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user