I took a different approach at the start for the challenge as I thought that we would need to complete the level for testing purposes.
bool canDie = true;
void Update ()
{
if(state == State.Alive)
{
RespondToThrustInput();
RespondToRotationInput();
}
DebugInput();
}
void DebugInput()
{
if (Input.GetKeyDown(KeyCode.L))
{
levelLoaded += 1;
LoadNewScene();
}
else if (Input.GetKeyDown(KeyCode.C))
{
if (canDie)
{
canDie = false;
}
else
{
canDie = true;
}
}
}
private void StartDeathSequence()
{
if (canDie)
{
state = State.Dying;
rocketAudio.Stop();
rocketAudio.PlayOneShot(deathSound);
deathParticle.Play();
levelLoaded = 0;
Invoke("LoadNewScene", levelLoadDelay);
}
}