* 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.
* navigation_astar: replace deprecated TileMap with TileMapLayer
* navigation_astar: use get_used_cells() instead of iterating over region
This also removes the confusing use of Tile.OBSTACLE. The tile enum is
mostly used for atlas coordinates but in this case it is compared with
the source id which only happens to be zero as well.
* navigation_astar: use constants for atlas coordinates
This makes it more obvious how to set cells in larger tilesets where the
second position is not zero.
It also removes the constant OBSTACLE which is unused since the last
commit.
* navigation_astar: mention get_used_rect()
Using it in this example is more complex (as the border has no cells)
but it's good to know.
- Add options for physics ticks per second, time scale, max physics steps per frame
and physics interpolation to the 2D and 3D physics tests demos.
- Physics ticks per second are always multiplied by time scale so that
time scale does not affect the physics simulation quality.
- Enable 4× MSAA for better debug shape display. Remove meshes/lights as
the debug collision fill make these unnecessary.
- Switch to the Mobile rendering method in the 2D physics tests demo
to allow for 2D MSAA, as it's not implemented in Compatibility yet.
- Improve collision shapes color in the 2D and 3D physics tests demos
for better visibility. Each PhysicsBody type now has its own collision
shape color.
The '$AnimatedSprite2D.play()' is called at the beginning in the '_ready' function,
when it should actually be called at the end, after selecting the animation.
* Update Platformer 2D to Godot v4.3
Before this change, if you tries to import the Platformer 2D project
using Godot v4.3 (the latest stable version of Godot, at the moment),
you would get the following warning:
> Warning: This project was last edited in Godot 4.2.
> Opening will change it to Godot 4.3.
>
> Open anyway? Project will be modified.
This change updates the project to Godot 4.3 so that that warning no
longer appears. When you upgrade to a newer version of Godot, sometimes
certain files will automatically be updated by the Godot Editor after
the upgrade has been completed. Specifically, the files won’t get
updated until after they’re opened in the Godot Editor. When creating
this commit, I tried to open every single file for Platformer 2D in the
Godot Editor to make sure that all of those automatic changes are
included in this commit.
* Replace Platformer2D’s TileMap with a TileMapLayer
Before this change, the Platformer 2D used a TileMap Node. TileMaps are
deprecated. TileMapLayers should be used instead [1].
[1]: <https://docs.godotengine.org/en/4.3/classes/class_tilemap.html#tilemap>
3.x -> 4.x:
`font_color_shadow` -> `font_shadow_color`
`font_color_selected` -> `font_selected_color`
`hseparation` -> `h_separation`
`vseparation` -> `v_separation`
`shadow_as_outline` -> `shadow_outline_size`
`panelf` and `panelnc` were removed in 3.2, as the options were never used.
See: godotengine/godot#28639
`font_color_shadow` is not a property of ProgressBar's theme, and there
doesn't seem to be an equivalent. The term "shadow" does not appear in any of:
{scene/{gui/{progress_bar,range,control},main/{canvas_item,node}},core/object/object}.{cpp,h}
This leads to code that is easier to understand and runs
faster thanks to GDScript's typed instructions.
The untyped declaration warning is now enabled on all projects
where type hints were added. All projects currently run without
any untyped declration warnings.
Dodge the Creeps and Squash the Creeps demos intentionally don't
use type hints to match the documentation, where type hints haven't
been adopted yet (given its beginner focus).
```
ERROR: Cannot create tile. The tile is outside the texture or tiles are already present in the space the tile would cover.
at: (scene\resources\2d\tile_set.cpp:4963)
ERROR: The TileSetAtlasSource atlas has no tile at (1, 0).
at: (scene\resources\2d\tile_set.cpp:5400)
ERROR: TileSetAtlasSource has no tile at (1, 0).
at: (scene\resources\2d\tile_set.cpp:5348)
```
This clears out some errors that happen on every load of this demo in Godot 4 onward.
It also makes the fonts actually work, as they did not before.
We probably don't strictly **need** these font settings for a demo, but they were here before.
I don't think `SourceCodePro-Black.ttf` was ever used, based on looking at history. So I removed it.
Both `.tres` files are gone too, as those are not used in Godot 4.
I have updated everything that used `SourceCodePro-Bold.ttf` to the new setup.
- Move all demo projects that don't require Forward+/Mobile-only features
to the Compatibility rendering method. This improves performance significantly
on low-end devices and ensures visuals are identical to a web export
of the demo.
- Set deadzone on all inputs to 0.2 for better gamepad usability.
- Remove reliance on `default_env.tres` to use built-in Environment
resources in the main scene instead (which follows the preview environment
workflow).
- Remove notices pointing to GDNative or VisualScript, since both were
removed in 4.0.
- Various bug fixes and usability tweaks to 10+ demos.
* Remove unnecessary use of `self`
* Connect to signals directly over `connect("name")`
* Use `call_deferred` on callables over `call_deferred("name"))`
* Emit signals directly over `emit_signal("name"...)`
This re-ports the following demos to Godot 4 following their latest `3.x` versions:
- 2D Navigation with AStarGrid2D
- 2D JRPG Demo
- 2D Isometric Game
- 2D Platformer
Some tweaks have also been made in the process, such as split screen players
having different colors in the 2D Platformer demo.
Co-authored-by: Nonparoxysmic <69494951+Nonparoxysmic@users.noreply.github.com>
All demos were opened with Godot 4.2.1, with the mesh format
upgraded for 3D demos.
The 3D antialiasing demo now uses Extra Cull Margin on the last
object to prevent it from disappearing too early when the camera
rotates (due to its use of shader-based animation).