A batteries-included template for the Godot Engine, designed for game jams.
Sections:
There are a few different ways you can start a new project from this template, depending on whether you want to use GitHub or another provider.
Create a new repository from the template here, then clone your repository locally to start working.
Replace my-project with the name of your project, then run the following command to create a
project as a private GitHub repo and clone it into your current directory:
gh repo create "my-project" --clone --template CreatedBySeb/godot-jamjar --privateReplace the value of PROJECT_NAME with the name of your project, then run the following to create
a new local repository based on the template in your current directory:
export PROJECT_NAME="my-project"
git clone https://github.com/CreatedBySeb/godot-jamjar.git --depth 1 "$PROJECT_NAME"
cd "$PROJECT_NAME"
rm -rf .git
git init
git add .
git commit -m "New Godot JamJar project"*Note: You still need to create a remote Git repository and push your local repository to it if you want to collaborate on your project or back it up remotely.*
build/web/- Where the default Web export will be placed, see Project Defaultsdemo/- A small Asteroids sample, see Demo Projectsystems/- The common game systems the template includes for you out-of-boxdefault_bus_layout.tres- The template's audio bus layout, seeAudioSystemproject.godot- Project-specific Godot settings, see Project Defaults
This template configures a few project settings differently from the Godot defaults for a better jamming/prototyping experience.
- A window size of 1920x1080 (1080p), with borderless windows enabled
- Scaling enabled for canvas items (2D elements)
- An audio bus with 'BGM' (Background Music) and 'SFX' (Sound Effects) channels to make it easier to
balance (see also
AudioSystem) - Additional GDScript warnings:
- Untyped Declarations: Static types help with avoiding bugs, but also yield performance improvements in Godot, so this helps you take advantage of this
- Unsafe Access: These helps avoid assuming a node will be a type other than what it is guaranteed to be, which can lead to difficult to find bugs
- A Web export preset configured to build to
build/web/index.html, so that thewebdirectory is ready to be zipped and uploaded to a site like Itch.io or used by GitHub Actions
These are some common game systems that most games will need, so they have been added to the template to enable you to spend more time on your unique logic. Any system marked with [Autoload] is provided as an autoload, so is always accessible as a singleton by its name.
A basic main menu is provided in main_menu.tscn and set as the entrypoint for the project. It has
a basic layout that is easy to tweak, built on top of a theme assigned to the root node. It has a
play button, which loads the configured game_scene, a help button, which toggles a pop up with
instructions, a quit button (on supported platforms), which quits the game, and a mute toggle at the
bottom right. It also has a space for credits at the bottom left.
[Autoload]
This system provides some convenience methods for working with continuous sounds and for adding pitch variation to sounds (which helps make them less repetitive).
It uses one AudioStreamPlayer node for the BGM (though it can be easily adapted to add more),
which is exposed via the bgm property. For sound effects, any AudioStreamPlayer node that is a
direct child of the SFX node will be auto-registered into its sfx dictionary property, and can
be used with the convenience methods. You can configure multiple tracks for the BGM, and specify a
default one to play when the game starts, which you can then switch between using the relevant
methods. There is also a mute method for globally enabling or disabling playback.
During development, an error will be raised if an AudioStreamPlayer in the AudioSystem has an
incorrect bus, which could lead to incorrect mixing.
[Autoload]
This system provides some cross-platform methods for reading and persisting data, such as for configuring settings, saving high scores and recording progress. By default it treats unexpected data as if there was nothing there and overwrites it, but you may want to replace this logic if you update the save format in the future. It currently doesn't support native objects (e.g. resources), but could be modified to do so.
[Autoload]
This system provides methods for loading resources (including scenes) in the background to avoid
interrupting gameplay, and for transitioning to a new scene then performing actions afterwards. The
main idea is that you can load in a new scene using bg_load, which will return a PackedScene,
then you can instantiate this, do any configuration required and then call transition with it. You
could also use bg_load for streaming in level chunks, enemies, assets or anything else you may
need soon but don't want to block the main thread for.
This repository contains a demo project, which is a version of Asteroids, used for development and
to showcase some of the systems provided by the template. It is largely self-contained to the
demo/ folder, but some of the systems have had values set or assets added for the demo project.
These are safe to leave in place, or can be removed. Note that if you remove the demo/ folder,
then you will need to ensure you remove any demo assets from the systems or you may encounter
errors.
Below is a list of affected systems:
AudioSystem: Contains a BGM track and sound effects. To clean up, delete all the nodes under SFX, then click the 'BGM' node and click the circular arrow next to 'Stream'
Most of this template is provided under the MIT License, though some of the included assets are subject to other licenses from their original creators.
logo.svg: Godot Logo by Andrea Calabró, licensed under CC-BY 4.0demo/bgm.ogg: 'Background space track' by yd, licensed under CC0demo/asteroid.png,demo/laser.png,demo/ship.png: 'Simple Space' by Kenney, licensed under CC0demo/explosion.ogg,demo/laser.ogg,demo/thruster.ogg: 'Sci-fi Sounds' by Kenney, licensed under CC0
Filenames don't necessarily match with their sources. All other files are original and licensed under the MIT License.