Space Shooter Flashcards
(6 cards)
Difference in mechanic of player shooting and enemy shooting
Player shooting: Uses a coroutine
Enemy shooting: Uses a timer
How do we change the collision layer of an object?
Physics 2D then Layer Collision Matrix
What value do we access to make the background scroll?
The texture offset -> Y
Loading scene by name and index
You can load scenes with both the scene index and the string name of the scene
(0) Allows you to do something with the index 0
(“0”); Allows you to do something with the name 0
Code to play sound
AudioSource.PlayClipAtPoint(deathSound, Camera.main.transform.position, deathSoundVolume);
Debugging a Coroutine
Coroutine needs IEnumerator as the return type and a yield return statement inside the coroutine. It also needs to be called using StartCoroutine();