From 9ee62e7545e74bec87da55df826197a0999bab5f Mon Sep 17 00:00:00 2001 From: Will Thompson Date: Fri, 8 Nov 2024 11:32:01 +0000 Subject: [PATCH 1/7] pre-commit: Use release of godot-gdscript-toolkit The change in question was released in 4.3.0, released in August. --- .pre-commit-config.yaml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 59a84ad..e561b90 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -9,9 +9,7 @@ repos: - id: check-yaml - id: check-added-large-files - repo: https://github.com/Scony/godot-gdscript-toolkit - # Use this commit from the master branch until the next stable release with - # - rev: f836958a4487e31e3c5ab35c57c7a2128b7e2303 + rev: 4.3.3 hooks: - id: gdlint - id: gdformat From ef76fe71234b8be847fce0f651bb9ef26eff681c Mon Sep 17 00:00:00 2001 From: Will Thompson Date: Mon, 11 Nov 2024 11:58:17 +0000 Subject: [PATCH 2/7] pre-commit: Update hooks version --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index e561b90..ebc2090 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -2,7 +2,7 @@ # See https://pre-commit.com/hooks.html for more hooks repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.6.0 + rev: v5.0.0 hooks: - id: trailing-whitespace - id: end-of-file-fixer From d7c387d4b0f23117846ab70f31a432afad561ae1 Mon Sep 17 00:00:00 2001 From: Will Thompson Date: Mon, 11 Nov 2024 11:59:01 +0000 Subject: [PATCH 3/7] Add editorconfig file MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A minimal editorconfig to set the file encoding keeps being added to my working copy – I think by Godot 4.4-dev3 – so let's commit it, and add some potentially-useful rules for editing .gd files in external editors. --- .editorconfig | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 .editorconfig diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..4f246d1 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,12 @@ +root = true + +[*] +charset = utf-8 + +[*.gd] +indent_style = tab +max_line_length = 100 + +[*.md] +indent_style = space +max_line_length = 80 From edad557985fb685a69c79a26715e3f0389977895 Mon Sep 17 00:00:00 2001 From: Will Thompson Date: Mon, 11 Nov 2024 12:13:30 +0000 Subject: [PATCH 4/7] README: Consistently wrap at 80 characters Previously, half of the README was wrapped at 80 characters, while the other half used one long line per paragraph. It doesn't really matter which style is used; but it's nice to be consistent. --- README.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 6e24e43..cd4f3bd 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,12 @@ # Moddable Platformer -This mini moddable game project by [Endless OS Foundation](https://endlessos.org) is intended to help ease the learning curve into Godot. +This mini moddable game project by [Endless OS +Foundation](https://endlessos.org) is intended to help ease the learning curve +into Godot. -This sample project allows learners to engage with game creation concepts, applying various modifications to the game itself, all without reading or writing any code. +This sample project allows learners to engage with game creation concepts, +applying various modifications to the game itself, all without reading or +writing any code. The `doc/MODS.md` file details the mods that have been made available. From 056ee51a0fc09b15b6b6701da2ad8b4296d4e571 Mon Sep 17 00:00:00 2001 From: Will Thompson Date: Mon, 11 Nov 2024 12:00:02 +0000 Subject: [PATCH 5/7] player: Add class name and top-level comment This improves the presentation of the player in the inspector. --- scripts/player.gd | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/player.gd b/scripts/player.gd index 0c665c7..fa1b5f2 100644 --- a/scripts/player.gd +++ b/scripts/player.gd @@ -1,5 +1,7 @@ @tool +class_name Player extends CharacterBody2D +## A player's character, which can walk, jump, and stomp on enemies. ## Use this to change the sprite frames of your character. @export var sprite_frames: SpriteFrames = _initial_sprite_frames: From 95e95c6799b3f8e9d09358d99ed84f93aef5a7b9 Mon Sep 17 00:00:00 2001 From: Will Thompson Date: Mon, 11 Nov 2024 12:13:16 +0000 Subject: [PATCH 6/7] doc: Document player parameters --- doc/MODS.md | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/doc/MODS.md b/doc/MODS.md index d22bd16..d467043 100644 --- a/doc/MODS.md +++ b/doc/MODS.md @@ -23,6 +23,36 @@ Select the `GameLogic` node. From the Inspector, you can adjust the Gravity of the world. Decreasing gravity will allow the player to jump higher. +### Player + +Select the `Player` node. From the Inspector, you can adjust the way the player +moves in various respects. There are some relatively self-explanatory +properties: + +- **Speed**: How fast the player can move left and right. +- **Acceleration**: How quickly the player reaches its top left/right speed. +- **Jump Velocity**: How fast the player moves upwards when jumping. This, + together with gravity, controls how high the player can jump. +- **Double Jump**: If enabled, the player can jump a second time while still in + the air. This is quite a common power-up in platform games. + +There are also a number of parameters which are commonly used in platform games +that players may not notice: + +- **Jump Cut Factor**: How much to reduce the player's jump when you release + the jump key before the top of the jump. Setting this to more than 0% allows + the player to control the height of the jump by how long they hold the jump + key. +- **Coyote Time**: How long it takes for the player to start falling after they + walk off a ledge. This allows the player to jump if they press the key a + moment too late, avoiding frustration. Named after [Wile E. + Coyote](https://en.wikipedia.org/wiki/Wile_E._Coyote_and_the_Road_Runner), a + cartoon character who often runs off a cliff but does not start falling until + he notices he has done so. +- **Jump Buffer**: How early can the player press jump while still in the air, + so that they jump as soon as they land on the floor. This allows the player to + jump if they press the key a moment too early, avoiding frustration. + ## Rules ### Win condition From 64e59626b4eb64beca3cc5dcc6e6ed07a4bb8d49 Mon Sep 17 00:00:00 2001 From: Will Thompson Date: Mon, 11 Nov 2024 12:22:10 +0000 Subject: [PATCH 7/7] ci: Cancel running workflows if retriggered For rationale, see . For the linting & formatting action, the concurrency group is set to contain the PR (if any) and ref otherwise, on the basis that only the latest push to a PR or branch is interesting. For the GitHub Pages and Godot Asset Library actions, each run overwrites the result of any previous run, so the concurrency group is just the workflow name. --- .github/workflows/checks.yaml | 5 +++++ .github/workflows/github-pages.yml | 5 +++++ .github/workflows/godot-asset-library.yaml | 5 +++++ 3 files changed, 15 insertions(+) diff --git a/.github/workflows/checks.yaml b/.github/workflows/checks.yaml index a2e8673..4a66ddb 100644 --- a/.github/workflows/checks.yaml +++ b/.github/workflows/checks.yaml @@ -6,6 +6,11 @@ on: branches: - main +# Cancel any ongoing previous run if a PR is updated +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + jobs: pre-commit: name: Linting and Formatting diff --git a/.github/workflows/github-pages.yml b/.github/workflows/github-pages.yml index fd7c93b..1106ad9 100644 --- a/.github/workflows/github-pages.yml +++ b/.github/workflows/github-pages.yml @@ -5,6 +5,11 @@ on: types: - published +# Cancel any ongoing previous run if the job is re-triggered +concurrency: + group: ${{ github.workflow }} + cancel-in-progress: true + permissions: contents: read pages: write diff --git a/.github/workflows/godot-asset-library.yaml b/.github/workflows/godot-asset-library.yaml index b1ba0ed..cf4e856 100644 --- a/.github/workflows/godot-asset-library.yaml +++ b/.github/workflows/godot-asset-library.yaml @@ -3,6 +3,11 @@ on: types: - published +# Cancel any ongoing previous run if the job is re-triggered +concurrency: + group: ${{ github.workflow }} + cancel-in-progress: true + name: Push to Godot Asset Library jobs: