David Briscoe aecf661c9c Fix and improve Role Playing Game: Gamepad, TileMapLayer, upgrade for 4.4.1 (#1248)
* Improve gamepad behaviour in rpg

Fix gamepad can't do dialogue.
Fix character often plays bump animation with gamepad when there's no
obstacles around.

Add gamepad A to ui_accept so gamepads can press buttons in dialogue and
combat.

Use get_vector so we get an automatic deadzone on our input.

Round our input direction so we don't pass Vector2i(0,0) to
request_move, get denied, and then do a bump animation.

* Use SpriteFrames instead of animating texture

Seems like Godot 4 doesn't allow toggling AnimationPlayer tracks by
making children editable so the texture is no longer being set and the
player is invisible. Regardless, this workflow is also not scalable to
multiple enemy types. Instead, use SpriteFrames to setup different
visuals for each slime.

Triggers animations from code alongside AnimationPlayer calls because
doing it in AnimationPlayer seemed unnecessarily complex.

* Give all slimes a common base class

Split player input handling from walker to allow both slimes to use the
same visual setup. In a real game, you'd want this kind of setup so
enemies are able to walk on the grid too.

Remove unused actor.gd -- looks like this was an early version of
walker.gd.

Setup opponent slime as type=Actor because otherwise you can't fight
them.

* Convert TileMap to TileMapLayer

Used "Extract TileMap layers as individual TileMapLayer nodes" in the
TileMap editor and removed the 0 layer argument from functions in
grid.gd

* Explain and rename facing direction node

When I first started looking into the character, I couldn't figure out
what this play button texture was for. After experimenting, it might be
an old version of the character visuals or a demo to show how to make
your character rotate.

* Fade to black between scenes

Fix blue screen when entering combat.

Our fade ColorRect was hidden so it never displayed. We removed the
exploration scene before fading so the fade started with an empty scene
with a blue skybox.

* Loop idle animation in combat

Add AnimationTree to combat character setup so we can tell when the
take_damage animation completes. This was harder than expected because
by default Godot modulates to black and sets scale to 0 unless you
specify otherwise with the RESET animation.

* Add a CanvasLayer above each clickable Control root

Fix mouse can't click buttons.

Seems like we're not able to click buttons in Godot 4 without a
CanvasLayer root. Adding that makes it work, but required some
restructuring to point at the correct node. In cases like combat+ui,
change it to emit a signal to use the "call down, signal up" pattern.

* Remove error comment that no longer occurs

Neither winning nor fleeing triggers this warning on Godot
v4.4.1.stable.official [49a5bc7b6].

* Rename parent -> grid

Make it clearer that the parent of the player and other pawns is
expected to be our Grid class.
2025-09-16 15:42:25 +02:00
2025-08-12 02:09:28 +00:00
2025-05-29 02:43:03 +02:00
2025-03-21 02:00:41 +01:00
2024-03-06 19:32:56 +01:00

Godot demo projects

Each folder containing a project.godot file is a demo project meant to be used with Godot Engine, the open source 2D and 3D game engine.

Godot versions

  • The master branch is compatible with Godot's master development branch (next 4.x release).
  • The 3.x branch is compatible with Godot's 3.x development branch (next 3.x release).
  • The other branches are compatible with the matching stable versions of Godot:
    • 4.2 branch for Godot 4.2.x.
    • 4.1 branch for Godot 4.1.x.
    • 4.0 branch for Godot 4.0.x.
    • 3.5 branch for Godot 3.5.x.
    • 3.4 branch for Godot 3.4.x.
    • 3.3 branch for Godot 3.3.x.
    • 3.2 branch for Godot 3.2.x.
    • 3.1 branch for Godot 3.1.x.
    • 3.0 branch for Godot 3.0.x.
    • 2.1 branch for Godot 2.1.x.

Importing all demos

To import all demos at once in the project manager:

  • Clone this repository or download a ZIP archive.
    • If you've downloaded a ZIP archive, extract it somewhere.
  • Open the Godot project manager and click the Scan button on the right.
  • Choose the path to the folder containing all demos.
  • All demos should now appear in the project manager.

Try the demos in your browser

Most of the demos are exported to GitHub Pages. They can be viewed here.

Note: The performance of Godot in a browser is lower than natively on desktop. For the best performance, consider downloading the demos.

License

Those demos are distributed under the terms of the MIT license, as described in the LICENSE.md file.

Description
No description provided
Readme 1.2 GiB
Languages
GDScript 89%
C# 9.4%
JavaScript 0.7%
GLSL 0.5%
Shell 0.2%
Other 0.2%