This is a high score game so technically there is no way to BEAT the game.
once the fruit has piled up to the top of the screen
and is overlapping the container boundary
Add a new function to the the functions group Call it gameOver
Create a sub-event and In the function disable physics on all the fruit
When the game is over we want to gently fade to black and display the players score.
Add a new tiled background to the Temp layout.
Use the Fader image file or fill the rectangle with black.
Set the Size to 1080 x 1920
To display the Game Over message and the score
Add a new Text Object to the Temp layout
Set the properties as shown
Add the Tween behaviour to TextGameOver
For the Text itself, set it using BBCode (an older form of HTML)
Final display properties for the text are shown:
In the gameOver function we can now show the fader, the game over message and the score
The Game Over function needs to be called somewhere
We will check if the fruit is overlapping the top of the screen. If it is, and the fruit is active, then we call the game over function.