created victory object and level progression
also tried to create a way to launch the game from any scene, but it doesn't really work. don't use anything in the folder called "DEBUG"
This commit is contained in:
@@ -6,6 +6,8 @@ public class ProjectileEnemy : MonoBehaviour {
|
||||
|
||||
[SerializeField] GameObject projectile;
|
||||
[SerializeField] GameObject firePoint;
|
||||
[SerializeField] [Range(0.1f, 3f)] float fireSpeed;
|
||||
[SerializeField] float projectileSpeed;
|
||||
|
||||
// Start is called before the first frame update
|
||||
void Start() {
|
||||
@@ -13,9 +15,9 @@ public class ProjectileEnemy : MonoBehaviour {
|
||||
}
|
||||
|
||||
IEnumerator Fire() {
|
||||
yield return new WaitForSeconds(3f);
|
||||
yield return new WaitForSeconds(1/fireSpeed);
|
||||
GameObject newProjectile = Instantiate(projectile, firePoint.transform.position, firePoint.transform.rotation);
|
||||
newProjectile.GetComponent<Rigidbody2D>().AddRelativeForce(new Vector2(80, 0));
|
||||
newProjectile.GetComponent<Rigidbody2D>().AddRelativeForce(new Vector2(projectileSpeed, 0));
|
||||
newProjectile.transform.Rotate(new Vector3(0,0,-90));
|
||||
StartCoroutine(Fire());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user