For Godot 4.2
This template has a main menu, options menus, pause menu, credits, scene loader, extra tools, and an example game scene.
Setup menus and accessibility features in about 15 minutes.
The core components can support a larger project, but the template was originally built to support smaller projects and game jams.
The base/
folder holds the core components of the menus application.
- Main Menu
- Options Menus
- Credits
- Loading Screen
- Persistent Settings
- Simple Config Interface
- Keyboard/Mouse Support
- Gamepad Support
- UI Sound Controller
- Background Music Controller
The extras/
folder holds components that extend the core application.
- Pause Menu
- Opening Scene
- Success & Failure Scenes
- Logging Scripts
- Additional Autoloaded Classes
- Scripts for Testing & Releasing
The examples/
folder contains an example project using inherited scenes from the base/
and extras/
.
- Example Game Scene
- Level Advancement
- End Credits
- Additional Inherited Scenes:
- Game Options Menu w/ Reset button
- Master Options Menu w/ Game Options tab
- Main Menu w/ Animations
- Pause Menu w/ Linked Scenes
- Loading Screen w/ Shader Pre-caching
AppConfig.tscn
is set as the first autoload. It loads all the configuration settings from the config file (if it exists).SceneLoader.tscn
is set as the second autoload. It can load scenes in the background or with a loading screen (LoadingScreen.tscn
by default).Opening.tscn
is a simple scene for fading in/out a few images at the start of the game. It then loads the next scene (MainMenu.tscn
).MainMenu.tscn
is where a player can start the game, change settings, watch credits, or quit. It can link to the path of a game scene to play, and the packed scene of an options menu to use.Credits.tscn
reads fromATTRIBUTION.md
to automatically generate the content for it's scrolling text label.- The
UISoundController
node automatically attaches sounds to buttons, tab bars, sliders, and line edits in the scene.ProjectUISoundController.tscn
is an autload used to apply UI sounds project-wide. ProjectMusicController.tscn
is an autoload that keeps music playing between scenes. It detects music stream players as they are added to the scene tree, reparents them to itself, and blends the tracks.InGameMenuController.gd
controls opening and closing a menu and pausing the game in the background.- The
PauseMenuController
node loads thePauseMenu.tscn
(usingInGameMenuController.gd
) when triggeringui-cancel
. GameUI.tscn
is a demo game scene that displays recognized action inputs, and features thePauseMenuController
node, theLevelLoader
node to advance through levels, andInGameMenuController.gd
to showSuccessScene.tscn
orFailureScene.tscn
.
This package is available as both a template and a plugin, meaning it can be used to start a new project, or added to an existing project.
When starting a new project:
- Go to the
Asset Library Projects
tab. - Search for "Maaack's Game Template".
- Click on the result to open the template details.
- Click to Download.
- Give the project a new name and destination.
- Click to Install & Edit.
- Continue with the New Project Instructions
When editing an existing project:
- Go to the
AssetLib
tab. - Search for "Maaack's Game Template Plugin".
- Click on the result to open the plugin details.
- Click to Download.
- Check that contents are getting installed to
addons/
and there are no conflicts. - Click to Install.
- Reload the project (you may see errors before you do this).
- Enable the plugin from the Project Settings > Plugins tab.
- Continue with the Existing Project Instructions
- Download the latest release version from GitHub.
- Extract the contents of the archive.
- Move the
addons/maaacks_game_template
folder into your project'saddons/
folder. - Open/Reload the project.
- Enable the plugin from the Project Settings > Plugins tab.
- Continue with the Existing Project Instructions
Users that want a minimal set of features can try Maaack's Menu Template.
Developers can make changes directly to the contents of the scenes in addons/maaacks_game_template/base/scenes/
. However, before making major changes, it is recommended developers make copy of a scene, or inherit from one, and save it in their project's directory outside of addons/
. This avoids changes getting lost either from the package updating, or because of a .gitignore
.
Set your project's main scene to MainMenu.tscn
, Opening.tscn
, or any scene that inherits from those.
In the template version, the project's main scene starts as OpeningWithLogo.tscn.tscn
in res://Examples/
.
Changes can be made directly to the contents of the examples/
folder. Alternatively, the folder can be copied or renamed.
Most scenes that a developer would commonly change are in the examples/
directory, and all the scenes and links can be changed to suit the developer's needs. Scenes in examples/
link to others within the same directory, though they often inherit from either base/
or extras/
.
These instructions assume starting with the entire contents of the project folder. This will be the case when cloning the repo, or starting from the template version in the Godot Asset Library.
For an existing project, developers can copy the contents of the addons/
folder into their project. This will also be the case when installing the plugin version in the Godot Asset Library.
Attribution
License
Godot Asset Library - Template
Godot Asset Library - Plugin