2D Shooter: The Main Menu
Objective: Create a title screen with the instructions and a way to start the game by pressing the space key.
The first thing we want to do is make a new scene. Go to file > new scene or press ctrl + N. Save this as “Main Menu” and now we’re ready to create the UI.
To make the main menu, it’s just a matter of adding images and text until you get something that resembles a title screen. I also wanted to add a flickering text similar to the game over text I made here, then I just needed to load the game scene with the keycode “space”. This should all be in a separate script, and for staying organized, any scripts for a scene should be in its own folder.
Here’s the script for the main menu that controls the scene loading and the flickering of the text.