GameDev : Game Over Text Flicker!
Now, why not create a Text Flicker System like arcade games?
I s really fun, and it is not so difficult!
The simple logic to do this is enable / disable the Text right?
Probably with some “delay” from one state to another.
And again, the Coroutine comes to help us!
If we create a new method GameOverFlickerRoutine(), not void but IEnumerator
we need an Infinite Loop to continue flickering our Text.
So, while (true), we change the Text from SetActive true to false with a delay
Then we make a change inside the If statement
And we call the Coroutine
There is another type of method if you prefer
We simply change the Text from “Game Over” to nothing “ ”, but the logic is the same.
Again, I prefer use directly SetActive(), but if you prefer change the String content is absolutely fine.
As you can see, different way but same logic give us the same result. We have a Coroutine, we Start it when we die, and everything works perfectly.