Giter Site home page Giter Site logo

wuxriff / godot-game-template Goto Github PK

View Code? Open in Web Editor NEW

This project forked from maaack/godot-game-template

0.0 0.0 0.0 1.12 MB

Godot template with a main menu, options menus, pause menu, credits, scene loader, extra tools, and an example game scene.

License: MIT License

Shell 4.32% GDScript 95.68%

godot-game-template's Introduction

Godot Game Template

For Godot 4.2

This template has a main menu, options menus, pause menu, credits, scene loader, extra tools, and an example game scene.

Example on itch.io

Main Menu
Key Rebinding
Audio Controls
Pause Menu
All screenshots

Use Case

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.

Features

Base

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

Extras

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

Examples

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

How it Works

  • 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 from ATTRIBUTION.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 the PauseMenu.tscn (using InGameMenuController.gd) when triggering ui-cancel.
  • GameUI.tscn is a demo game scene that displays recognized action inputs, and features the PauseMenuController node, the LevelLoader node to advance through levels, and InGameMenuController.gd to show SuccessScene.tscn or FailureScene.tscn.

Installation

Godot Asset Library

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.

Package Icon

When starting a new project:

  1. Go to the Asset Library Projects tab.
  2. Search for "Maaack's Game Template".
  3. Click on the result to open the template details.
  4. Click to Download.
  5. Give the project a new name and destination.
  6. Click to Install & Edit.
  7. Continue with the New Project Instructions

When editing an existing project:

  1. Go to the AssetLib tab.
  2. Search for "Maaack's Game Template Plugin".
  3. Click on the result to open the plugin details.
  4. Click to Download.
  5. Check that contents are getting installed to addons/ and there are no conflicts.
  6. Click to Install.
  7. Reload the project (you may see errors before you do this).
  8. Enable the plugin from the Project Settings > Plugins tab.
  9. Continue with the Existing Project Instructions

GitHub

  1. Download the latest release version from GitHub.
  2. Extract the contents of the archive.
  3. Move the addons/maaacks_game_template folder into your project's addons/ folder.
  4. Open/Reload the project.
  5. Enable the plugin from the Project Settings > Plugins tab.
  6. Continue with the Existing Project Instructions

Minimal

Users that want a minimal set of features can try Maaack's Menu Template.

Usage

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.

Main Scene

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/.

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/.

New Project

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.

New Project Instructions

Existing Project

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.

Existing Project Instructions

Links

Attribution
License
Godot Asset Library - Template
Godot Asset Library - Plugin

godot-game-template's People

Contributors

maaack avatar ngwenyang avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.