Compare commits

..

470 Commits
3.x ... master

Author SHA1 Message Date
Hugo Locurcio
b509950099 Update web exports to Godot 4.5.1 (#1290) 2025-12-30 19:53:58 -08:00
Hugo Locurcio
db745e5e59 Add SMAA option to the 3D antialiasing and graphics settings demos (#1278)
- Rename various labels for readability.
- Use infinity symbol when FPS limit is set to 0.
- Use lossless compression for ship textures since they are low-resolution,
  and applied to a large object (making VRAM compression look bad).
2025-11-26 10:37:17 -08:00
Hugo Locurcio
ecbb2ee713 Use skybox in Platformer 3D demo to improve sky quality (#1282)
- Restore support for multiple aspect ratios which was inadvertently
  removed in a previous PR.
- Fix corner fix preview incorrectly using VRAM compression (it's
  low-resolution, and only displayed in the editor anyway).
2025-11-26 08:26:46 -08:00
Dmitry
bf544aefd9 Improve user experience: Add movement on the Y-axis, Show FPS. List options backwards (#1283)
Co-authored-by: Hugo Locurcio <hugo.locurcio@hugo.pro>
2025-11-26 08:18:40 -08:00
dependabot[bot]
156044e6dd Bump actions/checkout from 5 to 6 (#1281)
Bumps [actions/checkout](https://github.com/actions/checkout) from 5 to 6.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v5...v6)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-11-20 11:24:41 -08:00
Hugo Locurcio
245cbfc66a Revert engine version to 4.5 for demos with upgraded TileMapLayer
The demos still work on 4.5.1.stable, so there's no need to increase
the project version.
2025-11-06 20:02:28 +01:00
staruwos
a90d9d8c9a Update TileMap nodes to TileMapLayer in various demos (#1276) 2025-11-06 20:00:30 +01:00
Hugo Locurcio
51fadd795c Link C# version in Squash the Creeps demo README (#1274)
- Also add a link the other way around (from the C# version
  to the GDScript version) to match Dodge the Creeps.
- Use GitHub admonition syntax.
2025-11-06 17:31:21 +01:00
Aaron Franke
6a0325b0b8 Fix URLs and remove --base from Lychee CI workflow 2025-11-03 22:34:09 -08:00
Marcus Ilgner
41171d85d4 Update isometric dungeon to 4.3+ TileMapLayer (#1268)
After opening the isometric dungeon demo, there was a warning about TileMap
having been deprecated so I updated it to use the new TileMapLayer instead.
2025-11-03 18:43:32 +01:00
Hugo Locurcio
6adcbc912e Fix animations not looping and player materials in 3D Platformer demo (#1266)
- Use Forward+ renderer as intended
  (the project was accidentally changed to Mobile in a recent commit).
2025-10-20 21:27:25 -07:00
Aaron Franke
8a582321ae Skip Shadertoy in Lychee URL checks (#1267) 2025-10-20 16:02:04 -07:00
Aaron Franke
520b4a7870 Improve style in many demos (#1263) 2025-10-11 05:03:59 -07:00
Aaron Franke
0ae09b7e5a Overhaul silly material creator plugin demo (#1261) 2025-10-11 03:22:04 -07:00
A Thousand Ships
0343cedd48 General proofreading (#1262)
* General proofreading for grammar and spelling
* General formatting
* Addition of appropriate literals where appropriate, i.e. `&"foo"` for `StringName` cases and `^"foo/bar"` for `NodePath` cases
2025-10-11 01:39:59 -07:00
Vissa
a01005f397 Add Multiple Windows Demo (#1103) 2025-10-08 15:00:22 -07:00
Šarūnas Ramonas
7d73b8c4cb Refactor Material Creator Plugin Demo to use custom resource-based data (#1219) 2025-10-07 16:02:21 -07:00
Aaron Franke
217436bce6 Merge pull request #1168 from rburing/webxr_demo
Add WebXR demo
2025-10-07 14:36:03 -07:00
Aaron Franke
7c6cd796d7 Style and type safety fixes 2025-10-07 14:17:42 -07:00
Ricardo Buring
a2e97c0a25 Add WebXR demo
Based on https://docs.godotengine.org/en/stable/classes/class_webxrinterface.html
and https://www.snopekgames.com/tutorial/2023/how-make-vr-game-webxr-godot-4

Co-Authored-By: David Snopek <dsnopek@gmail.com>
2025-10-04 12:52:41 +02:00
Aaron Franke
14fcc0e133 Update all demo projects for Godot 4.5 and use path-deterministic UIDs (#1258) 2025-10-03 16:22:39 -07:00
Aaron Franke
de00da353c Remove schedule from Check URLs action
This is going to create lots of noise, especially in forks... how about let's not spam this action every day.
2025-10-03 12:49:32 -07:00
Ruben Garcia
656595a6d2 Update README.md - Indicate demo obsolete for godot 4.3+ (#1204) 2025-10-02 19:38:25 -07:00
captain-redbeard
588c1cd257 Add Squash the Creeps 3D C# demo for Godot mono (#1001) 2025-10-02 19:35:12 -07:00
Bastiaan Olij
082cb16072 Add XR demo for binding modifier logic (#1137) 2025-10-02 18:35:37 -07:00
Aaron Franke
3088473167 Simplify list of branches in the README (#1255) 2025-10-02 15:08:21 -07:00
Mikael Hermansson
d7b6f86b0b Switch back to Jolt Physics in Voxel demo (#1257) 2025-10-02 14:35:34 -07:00
dependabot[bot]
7d5f9269ca Bump actions/checkout from 4 to 5 (#1256)
Bumps [actions/checkout](https://github.com/actions/checkout) from 4 to 5.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-10-02 13:18:15 -07:00
Aaron Franke
94d3d40d70 Make Voxel demo player responsive without using unrealistic gravity (#1253) 2025-10-02 11:00:01 -07:00
Shahriar Labib
84ac7b40a6 Add touch screen support for 3d/platformer (#1128)
Update touch_screen_ui.gd
2025-10-02 10:47:00 -07:00
Hugo Locurcio
af2b9b1f30 Add a 3D sky shaders demo (#809)
This uses https://github.com/Rytelier/godot-sky-and-volumetric-clouds
as a base, with several changes made:

- Spheres are now used to represent radiance map reflections of varying
  roughness and metallic values.
- A day/night cycle is now featured.
- Mipmaps are enabled on the weather texture as an optimization.
- The default radiance map settings are more conservative to account
  for the real-time sky shader.
  - This makes reflections lower quality, but it's not too noticeable
    in most real world scenes (especially if using GI techniques for reflections).
- Debanding is now applied in the project settings, rather than on the sky shader.
  This is significantly faster (over 0.1 ms saved on a RX 6900 XT in 3840×2160).
  It also has the benefit of working on materials, which can exhibit banding
  if not textured.
  - The sky shader has debanding commented out in case it's needed.
    This debanding also applies to the lower half of the sky as well in this case,
    as it was required to get rid of noticeable banding on the lower half.
- Cloud coverage and density uniform hints now allow values as low as 0.001.

Co-authored-by: Rytelier <45795134+Rytelier@users.noreply.github.com>
Co-authored-by: Clay John <claynjohn@gmail.com>
2025-10-02 10:44:01 -07:00
Hugo Locurcio
6424e02ebf Add fallbacks and mention non-working features when using Compatibility or the Web platform (#1132)
- Make 3D lights with shadows darker when using Compatibility to better
  match the appearance of Forward+/Mobile, due to the use of sRGB blending
  for those lights.
- Silence some warnings when running projects with the Compatibility
  rendering method, such as the one about 2D MSAA not being supported.
- Rebake lightmaps in Global Illumination to improve quality and reduce
  light leaking with improvements from 4.3.
  - Increase probe density for dynamic objects, and mark the moving box
    as a dynamic object for GI purposes.

This is done to improve the experience with the web-based demos,
which always run with the Compatibility rendering method.
2025-10-02 10:31:42 -07:00
Hugo Locurcio
a5bce2f144 Fix bright streaks in tunnel in Platformer 3D demo (#1254)
This adjusts reflection probes following the blend distance changes
in 4.4.
2025-10-02 10:15:15 -07:00
Hugo Locurcio
a0f59648f2 GitHub Actions: Check URLs using lychee (#1169)
This makes it possible to be aware of dead links and replace
them with other resources (such as archived versions) as
soon as possible.
2025-10-02 00:33:27 -07:00
Hugo Locurcio
57daa67c23 Fix look_at_from_position() usage in Squash the Creeps (3D) (#1165)
The mob's orientation was previously shifted according to the player's
height, which could lead to collision and movement issues that were
difficult to diagnose.
2025-10-02 00:14:08 -07:00
Bastiaan Olij
711822a319 Modify shader example to show using built-in includes (#1086) 2025-10-02 00:04:11 -07:00
Markus Sauermann
10eb2807b8 Add Split Screen Demo showing input handling (#1023)
* Add Split Screen Demo showing input handling

* Style fixes, layout improvements, update to Godot 4.5

---------

Co-authored-by: Aaron Franke <arnfranke@yahoo.com>
2025-10-01 22:56:48 -07:00
Allyson Chan
0cff177d59 Updated Multiplayer Pong C# to Godot 4.2 (#1045) 2025-10-01 22:12:04 -07:00
Hugo Locurcio
05aeb11de9 Add a 3D visibility ranges (HLOD) demo (#860) 2025-10-01 21:47:36 -07:00
Yaxian
1d8fa9c44d Add player_state dictionary to manage player state names for FSM demo (#1143)
* Add player_state dictionary to manage player state names for FSM demo

* Use a constant typed Dictionary of StringNames and update to Godot 4.5

---------

Co-authored-by: Aaron Franke <arnfranke@yahoo.com>
2025-10-01 21:33:27 -07:00
MJacred
69b317692e Fix content_scale_* updates: properties are in Window not (Sub-)Viewport (#1184)
While the demo seems to work, the editor won't allow the user to jump to the docs when using Ctrl+LMB
2025-10-01 21:09:48 -07:00
Hugo Locurcio
649360f17e Fix FPS-dependent movement in Navigation AStar demo (#1227)
Previously, the way in which the spaceship steered depended
on the rendered framerate.

This moves ship movement to the physics step to avoid this, and
enables physics interpolation for smooth motion.
2025-10-01 19:55:07 -07:00
Hugo Locurcio
a5f9289d13 Fix tickrate-dependent physics in Voxel demo (#1224)
Fix mouse sensitivity being dependent on window size by using `InputEventMouseMotion.screen_relative`.
2025-10-01 19:44:48 -07:00
Hugo Locurcio
5f4a9e409f Use InputEventMouseMotion.screen_relative where relevant in all demos (#1232)
This provides mouse sensitivity that is independent of the viewport
size, without needing to query for project settings.

This also inverts the mouse motion direction in the 3D navigation demo
to better match expectations, and increases mouse sensitivity in the
Window Management demo to be closer to other demos.
2025-10-01 18:54:19 -07:00
bruvzg
bdc33d1568 Add basic accessibility features demo. (#1238) 2025-10-01 18:41:42 -07:00
Hugo Locurcio
dc4abff7d0 Use GodotPhysics3D in Voxel demo to work around performance issue (#1252)
This avoids stuttering during world generation due to mutating
compound shapes being slow in Jolt Physics.

This is especially noticeable in the Flat Grass world due to
the higher number of voxels being generated.
2025-10-01 16:01:17 -07:00
Hugo Locurcio
a64cebdf7a Fix physics joint warning in Truck Town when using tow truck (#1251)
Following the switch to Jolt Physics, 3 warnings were printed every
time you selected the tow truck in Truck Town, as custom joint bias is not supported.

This reverts 3 of the joints to use the default bias, which appears to
have no negative impact on behavior on either Jolt Physics or GodotPhysics3D.
2025-10-01 11:02:59 -07:00
Hugo Locurcio
efb56dcee4 Add a 3D ragdoll physics demo (#1234) 2025-09-30 13:05:04 -07:00
Hugo Locurcio
0540894062 Add a 3D soft body physics demo (#1228) 2025-09-30 11:16:47 -07:00
Aaron Franke
49718c4b16 Merge pull request #1223 from Calinou/add-3d-physics-interpolation-demo
Add 3D physics interpolation demo
2025-09-30 09:37:52 -07:00
lawnjelly
c70741bac0 Add 3D physics interpolation demo
Demonstrate first person shooter and third person shooter cameras.
2025-09-30 18:14:22 +02:00
Lukas Tenbrink
78c04bbd28 Migrate contributing guidelines to the contributing docs (#1246) 2025-09-30 08:43:17 -07:00
Hugo Locurcio
9fb7d5d211 Add a custom logging demo (#1242)
This demo showcases a custom logger implementation, which runs in parallel
to the built-in logging facilities (including file logging). The custom logger
displays all messages printed by the engine in an in-game console.
2025-09-26 23:11:38 +02:00
Hugo Locurcio
84eabb3cf7 Add .clang-format and use it to format shader files (#1249) 2025-09-22 16:15:54 +02:00
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
0x1hue
b45ef5497b Fix uniform sets in Compute Texture demo (#1247)
- Move texture references into separate vars for clarity.

This fixes compatibility with 4.5 while preserving compatibility with 4.4.1.
2025-09-14 01:35:59 +02:00
Aaron Franke
2fc0497915 Merge pull request #1237 from godotengine/dependabot/github_actions/actions/checkout-5
Bump actions/checkout from 4 to 5
2025-08-11 21:51:41 -07:00
dependabot[bot]
d588eb58ce Bump actions/checkout from 4 to 5
Bumps [actions/checkout](https://github.com/actions/checkout) from 4 to 5.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-08-12 02:09:28 +00:00
Christen Lofland
bf4d1038d6 Minor spelling fixes in strings, comments and non-code files. (#1236)
Co-authored-by: A Thousand Ships <96648715+AThousandShips@users.noreply.github.com>
2025-08-04 17:19:57 -07:00
Wilson Enrique Alvarez Torres
48aaefbf12 Simplify mesh custom drawing demo (#1231)
Co-authored-by: Hugo Locurcio <hugo.locurcio@hugo.pro>
2025-07-22 02:52:01 +02:00
Switchbreak
ba8718ed09 Fix "Parse message failed" error in WebRTC Signaling Demo Project (#1209) 2025-07-18 16:36:02 +02:00
Matthew
219eeacced Merge pull request #1218 from BastiaanOlij/openxr_render_models_demo
Added an OpenXR render models demo
2025-07-14 15:59:26 -04:00
Matthew
28e2fc1f15 Merge pull request #1229 from Calinou/control-gallery-add-foldablecontainer
Add FoldableContainer to the Control Gallery demo
2025-07-13 08:32:49 -04:00
Bastiaan Olij
d438fcc8d6 Added an OpenXR render models demo 2025-07-11 12:57:44 +10:00
Hugo Locurcio
7d525f4c9b Add FoldableContainer to the Control Gallery demo
This bumps the demo requirement to Godot 4.5, as FoldableContainer
is only present in 4.5 and later.
2025-07-08 01:04:55 +02:00
Simon Ruderich
89b2660d69 Migrate Navigation AStar demo to TileMapLayer and perform various cleanups (#1208)
* 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.
2025-06-30 18:09:02 +02:00
smix8
9acb5528b6 Update NavigationChunk demos (#1221)
Updates NavigationChunk demos for `NavigationMeshSourceGeometryData2D.get_bounds()`
function and new NavigationAgent no post-processing option.
2025-06-25 19:21:12 +02:00
Sebastian Javier D'Alessandro Szymanowski
1280ef63e7 Fix project main scene path in Pong demos (#1217)
Signed-off-by: Sebastian Javier D'Alessandro Szymanowski <sdalessandro@fi.uba.ar>
2025-06-25 19:09:48 +02:00
Aaron Franke
0d6b7722c0 Merge pull request #1098 from BastiaanOlij/openxr_hand_tracking_demo_settings
Updated hand tracking demo based on Godot changes in PR 95153
2025-06-24 03:29:37 -05:00
Bastiaan Olij
dbe9f48dcc Updated OpenXR hand tracking demo based on Godot changes in PR 95153 2025-06-24 11:45:33 +10:00
Rémi Verschelde
8be477ce38 Merge pull request #1212 from BastiaanOlij/mobile_vr_interface_demo
Simple demo for Mobile VR Interface
2025-06-21 11:43:49 +02:00
Bastiaan Olij
16f4b10bc6 Simple demo for Mobile VR Interface 2025-06-19 15:01:40 +10:00
Rémi Verschelde
1cd5f27f8e Merge pull request #1211 from Calinou/move-compute-shader-heightmap-demo
Move Compute Shader Heightmap demo to the `compute/` folder
2025-06-09 16:55:12 +02:00
Hugo Locurcio
da2f21baac Move Compute Shader Heightmap demo to the compute/ folder
- Use GitHub admonition syntax in its README.
2025-06-09 16:31:35 +02:00
Hugo Locurcio
c97a648356 Improve Run-time File Saving and Loading demo (#1196)
- Add runtime MP3 and WAV loading with example files.
- Add runtime FBX loading (but no example files, due to known issues with
  the current FBX runtime loading implementation).
- Use supersampling for the 3D preview to further improve quality.
- Shorten file path to example glTF scene.
- Mention audio duration in the UI when loading an audio file.
2025-05-30 20:13:31 +02:00
Hugo Locurcio
f78efc69ee Add a custom drawing in 2D demo (#1185) 2025-05-30 17:29:06 +02:00
Hugo Locurcio
dc3670e25a Add a 3D tonemapping and color correction demo (#857)
This showcases various tonemapping operators and their interaction
with several color correction textures (1D and 3D).

A script generating neutral 3D LUT textures is also included.

Co-authored-by: Allen Pestaluky <allenpestaluky@gmail.com>
2025-05-30 16:08:51 +02:00
Varga
a445398c60 Add an audio effects demo (#1201)
Co-authored-by: dkleitsas <86194775+dkleitsas@users.noreply.github.com>
Co-authored-by: Hugo Locurcio <hugo.locurcio@hugo.pro>
2025-05-29 02:43:03 +02:00
K. S. Ernest (iFire) Lee
3ced51c91c Merge pull request #1183 from BastiaanOlij/openxr_hand_fallback_modifier
OpenXR: Added a fallback modifier implementation
2025-05-27 22:33:28 -07:00
K. S. Ernest (iFire) Lee
1f58baa94c Merge pull request #1197 from PizzaLovers007/rhythm-game
Add a simple rhythm game demo
2025-05-22 14:15:54 -07:00
Alex
6a2de9c3ee Disable GitHub Actions export_web workflow in forks (#1205) 2025-05-19 01:44:35 +02:00
PizzaLovers007
be7a046c1e Add a simple rhythm game demo 2025-05-17 16:55:21 -05:00
Varga
ba2755359d Fix nonexistent function error in Multiplayer Bomber demo (#1202) 2025-05-08 00:19:16 +02:00
Hugo Locurcio
2d64c95990 Update 3D Sprites screenshot to match the recent bugfix 2025-04-28 16:05:47 +02:00
Tianle
9456158841 Fix the bug of shader effect (#1198)
The normal was not calculated correctly

Remove extra parenthesis
2025-04-24 10:06:53 -07:00
Tianle
90f309174d Add Sprite3D and AnimatedSprite3D demo (#1191) 2025-04-24 17:45:14 +02:00
Hugo Locurcio
a531235db3 Use Jolt Physics in all 3D demos that use physics, improve physics tests demos (#1195)
- 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.
2025-04-21 21:59:31 +02:00
Bastiaan Olij
debdec8469 OpenXR: Added a fallback modifier implementation to the hand tracking demo, if hand tracking is not available 2025-04-21 13:17:21 +10:00
Hugo Locurcio
819d201cc4 Enable physics interpolation in all 3D demos (#1074)
This makes use of the new built-in 3D physics interpolation
added in Godot 4.4.
2025-04-15 16:54:41 +02:00
Hugo Locurcio
a88ca219b8 Add block placement preview to Voxel demo, improve debug display (#1190)
- Allow placing/breaking blocks when further away (up to 5 blocks instead of 4).
- Add a background to the debug display to improve readability on bright backgrounds.
- Simplify coordinate display using the `%v` placeholder available in 4.3 onwards.
2025-04-15 16:53:12 +02:00
Hugo Locurcio
c05d05009b Improve flat terrain generation in the Voxel demo (#1189)
This adds 2 layers of dirt below the grass layer and a layer of indestructible
bedrock below it so you can't fall off the world.
2025-04-15 15:03:12 +02:00
Hugo Locurcio
b06917acaa Fix incorrect class_name declaration in 2D physics tests demo (#1188) 2025-04-14 22:51:18 +02:00
Mikael Hermansson
9db52662cb Change physics joint tests to freeze bodies as kinematic in the Physics tests demos (#1177) 2025-04-14 18:58:55 +02:00
Hugo Locurcio
7befd7c718 Enable physics interpolation in all 2D demos (#1070)
This makes uses of the new built-in 2D physics interpolation
added in 4.3.

For 3D demos, a separate PR requiring `master` will be made later.
2025-04-14 18:58:38 +02:00
Hugo Locurcio
90617ba1e8 Fix camera colliding with the player in 3D platformer demo (#1187)
This was most common at low physics tick rates like 20 TPS.

This also fixes an issue with the RigidBody character demo having
movement speed depending on the physics tick rate.
2025-04-14 17:05:50 +02:00
Aaron Franke
f7a1433739 Fix pick block in Voxel demo 2025-04-13 04:57:12 -07:00
J.M. de Jong
d21c03d09c Remove broken int type check in WebRTC Signaling demo (#1186)
JSON.parse_string() parses all numbers as floats, even if there are no decimals.
`str(JSON.parse_string('{"type": 3}').asdf)` would result in `"3.0"`, which is not a valid int.
Because of this, the demo is not working.
2025-04-06 23:15:48 +02:00
Aaron Franke
d169ec17e2 Fix block face checks and explicitly define normals in voxel demo (#1182) 2025-04-02 08:41:10 -07:00
Aaron Franke
fad2469531 Merge pull request #1179 from Calinou/update-for-4.4
Update demos for Godot 4.4
2025-03-20 20:43:57 -05:00
Hugo Locurcio
4d49bbd1b8 Update demos for Godot 4.4
- Resave all files with Godot 4.4 to make use of script/shader UIDs.
- Use AgX tonemapping in all demos that used a tonemapper other than Linear.
2025-03-21 02:00:41 +01:00
utsav132
5557b10cfa Fix mob playback animation being started before the animation is set in Dodge the Creeps (#1175)
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.
2025-03-07 19:43:58 +01:00
Hugo Locurcio
fdb2f50a20 Add a graphics tablet input demo (#1162) 2025-02-10 18:17:34 +01:00
Jason Yundt
0d46333c4e Update Platformer 2D to Godot 4.3 (#1145)
* 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>
2025-02-06 15:23:15 +01:00
Hugo Locurcio
c3b0331d8a Fix invalid icon reference in C# Android IAP demo (#1159) 2025-01-21 02:39:47 +01:00
Wayne Mwashuma
0e24c8eb2e Update to TileMapLayer in Multiplayer Bomber demo (#1155) 2025-01-10 22:39:38 +01:00
Mohamed Koubaa
be77353917 Move position setting code to be before direction in Dodge the Creeps (#1151) 2025-01-10 19:52:54 +01:00
Fabio Alessandrelli
d3c71ddb20 Fix typo in WebSocketServer class name (#1154) 2025-01-10 19:51:29 +01:00
David Briscoe
c49e134e13 Explain how to setup GUI in 3D (#1149)
Make it more obvious to newcomers how this demo works so they can
replicate it in their projects.

Change the text to point to how this is working.

Add Editor Descriptions to make it clearer how this is setup.

Co-authored-by: Aaron Franke <arnfranke@yahoo.com>
2024-12-23 18:55:20 +01:00
Jorrit Rouwe
81249b3f4a Increase Jolt Physics limit settings so performance tests run without errors (#1146) 2024-12-13 16:39:29 +01:00
Aaron Franke
51a7d389af Merge pull request #1138 from Calinou/truck-town-add-moods
Add moods (times of day) to Truck Town demo
2024-11-25 12:05:53 -08:00
Hugo Locurcio
5f0e0ce205 Improve GUI in 3D demo (#1140)
- Increase physics ticks per second to 120, so that UI interactions feel
  smoother and have lower input lag. This happens since input is governed
  by the physics tick due to the use of physics picking.
- Add a placeholder to the LineEdit and select a default option in the OptionButton.
2024-11-25 12:04:29 -08:00
Markus Sauermann
6f44371df1 Fix physics picking in Gui in 3D Demo (#1139)
Physics picking requires that the SubViewport has a consistent state
of the mouse-enter/exit notifications.

Godot V4.3 was changed in comparison to V4.2, so that it now requires
this additional step.

Co-authored-by: Hugo Locurcio <hugo.locurcio@hugo.pro>
Co-authored-by: Aaron Franke <arnfranke@yahoo.com>
2024-11-25 18:38:26 +01:00
Hugo Locurcio
15bcb941de Add moods (times of day) to Truck Town demo
Four moods are available: sunrise, day, sunset, night. Sunset and night
also feature artificial point lights placed in the town scene.

The mood can be set on the main menu before playing. It can also be cycled
during gameplay by pressing M or D-Pad Down.
2024-11-25 18:35:05 +01:00
Aaron Franke
5d9542113a Improve Truck Town model, fix issues, use OMI glTF Physics (#1110) 2024-11-25 06:56:02 -08:00
smix8
0fb1b4e09c Update 2D navigation demo NavigationPolygon for 4.3+ (#1135)
Updates NavigationPolygon with data that has compatibility with newer 2D navigation mesh baking.
2024-11-17 00:32:38 +01:00
Yaxian
1e02914267 Use TileMapLayer in Dynamic TileMap Layers (#1133)
TileMap is deprecated in 4.3 as TileMapLayer supersedes it.

Co-authored-by: Hugo Locurcio <hugo.locurcio@hugo.pro>
2024-11-15 19:04:15 +01:00
Bastiaan Olij
6db1062768 Fix recenter code in OpenXR Character Centric Movement (#1131)
Co-authored-by: Hugo Locurcio <hugo.locurcio@hugo.pro>
Co-authored-by: Aaron Franke <arnfranke@yahoo.com>
2024-11-15 19:03:19 +01:00
Hugo Locurcio
adf6d7e08d Disable non-functional XR demos in web exports (#1130)
These demos could work if they are redesigned to account for WebXR's
limitations when running on the web platform.
2024-11-08 11:33:19 +01:00
Danil Alexeev
c492e5fd73 Update some GDScript files for Godot 4.3 (#1129) 2024-11-04 12:00:59 +01:00
Hugo Locurcio
7ed5b1c116 Update web demo exports for Godot 4.3 (#1127)
This comes with other improvements:

- Demos now work on desktop and mobile browsers, as ETC2 import is now
  automatically enabled before exporting each demo.
- Progressive web app is available for each project.
  - Can be added to the home screen on a device for a closer-to-native experience.
  - Cross-origin isolation headers are automatically added, so that the export
    works with threads enabled despite being hosted on GitHub Pages
    (which doesn't send these headers).

Several demos will need further tweaks to look better when using
the Compatibility rendering method. Currently, many 3D demos appear
too bright due to lights with shadows enabled using sRGB blending.

Also, many demos will need to be modified to indicate which parts
of them are not supported when running on the web platform, or
when using the Compatibility rendering method.
2024-10-30 17:13:23 +01:00
Hugo Locurcio
53d3f9cdde Improve Operating System Testing demo (#1124)
- Display more return values of Engine/OS methods such as system fonts,
  memory information and security information.
- Add headless support (the generated report is also printed to stdout).
- Improve theming in the generated report.
- Hide video adapter type if this information can't be queried in the
  current rendering method.
- Update C# script for Godot 4.x platform names.
2024-10-23 23:09:23 +02:00
Hugo Locurcio
edccce8563 Fix normal map direction in 2D Lights and Shadows (#1123)
- Group Light2D nodes for easier dragging in the editor.
2024-10-18 23:30:07 +02:00
Raymond DiDonato
a87fded4cf Fix VRAM leak in compositor effect demo (#1115) 2024-09-17 01:36:20 +02:00
Montandalar
fdae025495 Add full license information for Voxel demo textures (#1113) 2024-09-15 15:04:34 +02:00
Tyler Breisacher
fa6061c623 Add static types in 2D Navigation AStar demo (#1008) 2024-08-31 03:48:17 +02:00
Ryhon
8ab921d5b4 Add FSR 2.2, exclusive fullscreen and ultra SSAO/SSIL to 3D Graphics Settings demo 2024-08-31 03:21:22 +02:00
shahriarlabib000
723331f814 updated README and Screenshots (#1111) 2024-08-28 18:09:22 -07:00
JavierStark
71630e80e4 Fix updated Android IAP project in c# (#1105)
* Update project to 4.3

Co-authored-by: Hugo Locurcio <hugo.locurcio@hugo.pro>
2024-08-28 16:58:41 -07:00
Aaron Franke
5646c6a7a8 Open and save 3D demos in Godot 4.3 stable (#1109) 2024-08-27 13:40:06 -07:00
Hugo Locurcio
582229e17c Improve Material Testers demo project (#1068)
- Add reflection probes for each test sphere, which can be toggled using
  a new dropdown with 3 options (no reflection probe, reflection only,
  reflection + ambient). The cull and reflection masks are configured
  on each reflection probe so that spheres don't self-reflect, but other
  spheres still appear in each sphere's reflections. Probe extents are made
  very large to prevent any visible fading, and the test beds don't
  receive the reflection probe's ambient or reflection.
- Improve ice material visuals by giving it some opacity.
- Use lossless compression on all textures, as their relatively low
  resolution and count by today's standards makes them not use much VRAM
  anyway.
2024-08-27 05:32:12 -07:00
Christen Lofland
7e2a55aa07 3D Inverse Kinematics Godot 4 Conversion (Partial) (#1036)
* These changes allow the project to start and run in Godot 4.2

I hit some of the files with my formatter, if whitespace updates are not wanted I can remove those.
The project doesn't entirely work yet, but it runs. I am still working on making it work properly fully, but at least it starts now instead of crashing.

* Center text to match Godot 3 example better.
2024-08-27 05:13:54 -07:00
shahriarlabib000
b05fb07d77 updated meshes to obj instead of res (#1107) 2024-08-27 05:06:22 -07:00
Mikael Hermansson
7e60538469 Change semi-truck in Truck Town demo to use 6DOF joint (#1102) 2024-08-27 04:31:10 -07:00
shahriarlabib000
9f59648c26 Update robot mesh for Godot 4 in 3D in 2D demo (#1106) 2024-08-26 00:07:36 +02:00
JavierStark
13b2787173 Update Android IAP in C# project to Godot 4.3 (#1104)
Co-authored-by: Hugo Locurcio <hugo.locurcio@hugo.pro>
2024-08-23 04:00:10 +02:00
Rémi Verschelde
6c635fe75a Merge pull request #1080 from BastiaanOlij/openxr_composition_layers
OpenXR composition layer example
2024-08-22 07:35:28 +02:00
Zi Fan
6d5ded3c7d Fix incorrect asset library link in 3D Lights and Shadows README (#1100) 2024-08-11 02:15:38 +02:00
smix8
cbb68060c6 Add navigation mesh chunks demos (#1099)
Adds 2D and 3D demo project for how to bake navigation meshes for large world chunk systems.
2024-08-08 17:22:47 +02:00
esainane
0fba875c72 Fix theme properties in various demos (#1097)
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}
2024-08-02 03:01:04 -07:00
Bastiaan Olij
98899881e7 OpenXR composition layer example 2024-07-31 15:44:50 +10:00
Fabio Alessandrelli
8fd41702c6 Fix typing errors in webrtc_signaling demo (#1096) 2024-07-28 01:35:33 +02:00
Russell Sanborn
34d174e315 Add JetBrains IDE files to .gitignore (#1094)
For reference, this exists in other godotengine repositories. Examples:

* https://github.com/godotengine/godot/blob/master/.gitignore#L157
* https://github.com/godotengine/godot-docs/blob/master/.gitignore#L52
2024-07-26 17:44:57 +02:00
Rémi Verschelde
3265d3fcd4 Merge pull request #1082 from Calinou/add-2d-polygons-lines-demo-4.x
Add a 2D polygons and lines demo
2024-07-25 13:31:10 +02:00
Russell Sanborn
7d42ae3c9a Rename Dodge The Creeps files to snake case (#1084)
This follows the style guide:

- https://docs.godotengine.org/en/stable/tutorials/best_practices/project_organization.html#style-guide

For reference, a documentation PR exists to update references to the
demo.
2024-07-15 00:36:11 +02:00
Matthew
e6fcf24f89 Merge pull request #973 from BastiaanOlij/openxr_hand_tracking_demo
Add OpenXR hand tracking demo
2024-07-13 15:04:58 -04:00
Hugo Locurcio
16d8ba09fb Replace instances of KinematicBody with CharacteBody in READMEs
KinematicBody was replaced by CharacterBody in Godot 4.0.

This also adds the 3D suffix to 3D physics classes.
2024-07-12 23:06:00 +02:00
Hugo Locurcio
7223aec001 Fix incorrect static typing in 2.5D demo 2024-07-03 17:18:29 +02:00
Hugo Locurcio
0ec2fff5bf Fix incorrect typed Array assignment in XR demo scripts (#1081) 2024-06-26 17:20:58 +02:00
Hugo Locurcio
78bbd99f0d Add a 2D polygons and lines demo 2024-06-25 18:09:34 +02:00
ShatteredReality
b4c73f4888 Fix README links to asset library (#1078)
This updates all links to point to the 4.2 demos instead of the 3.5 ones.

Co-authored-by: A Thousand Ships (she/her) <96648715+AThousandShips@users.noreply.github.com>
2024-06-24 19:29:58 +02:00
Bastiaan Olij
677dc46eeb Add OpenXR hand tracking demo 2024-06-15 14:04:49 +10:00
Hugo Locurcio
fbb7cb442c Fix ball speedup logic in Pong demo (#1073) 2024-06-13 12:31:10 +02:00
Bastiaan Olij
909331ac51 Add Compositor Effects (Post-Processing) demo (#1058)
Co-authored-by: Hugo Locurcio <hugo.locurcio@hugo.pro>
2024-06-07 22:19:25 +02:00
Hugo Locurcio
785e3213d5 Use higher shadow filtering quality settings in 3D demos (#1067)
The 3D demos aren't very demanding and Godot has been optimized
a bit since 4.0's release, so we can afford using higher quality
shadow settings for less noisy shadow filtering.

This also tweaks shadow bias to reduce shadow acne in the Voxel demo.

The time slider in the Physical Light and Camera units demo now
allows for more precise adjustments.
2024-06-06 22:11:18 +02:00
Hugo Locurcio
fad6cc2e1b Add turbulence example to 3D Particles demo (#1066)
- Make the attractor in the example dynamic to better showcase its functionality,
  and add a visual representation to it.
- Tweak the appearance of attracted particles.
- Fix force field particle display (it wasn't using Local Coords as intended).
- Lower the sun angle to make the background darker (and particles easier to see).
2024-06-06 22:07:00 +02:00
Hugo Locurcio
9a0c857131 Fix incorrect class_name declarations being swapped with extends
This was caused by an automatic text replacement issue.
2024-06-03 20:13:55 +02:00
Hugo Locurcio
bac1e69164 Use static typing in all demos (#1063)
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).
2024-06-01 12:12:18 +02:00
Sectonidse
8e9c180278 Use match case instead of if else in Audio Mic Record demo (#1053)
* Use match case instead of if else

This is my first pull request.

* Apply suggestions from code review

---------

Co-authored-by: Hugo Locurcio <hugo.locurcio@hugo.pro>
2024-05-13 19:57:04 +02:00
Christen Lofland
3859c66f0e Remove modulate/albedo mix changes from Distance Fade example in Decals (#1054) 2024-05-13 19:50:07 +02:00
Tarik Belabbas
9a5176e430 Fixed minor Godot 3 bit in "gui_in_3d" demo's billboard specific code (#1052) 2024-05-06 23:04:36 -07:00
谢天
95cfb076d1 Add missing tags to several demos (#1048) 2024-04-18 22:24:47 +02:00
Colter
9043224bb2 Fix upward movement key to be W in Multiplayer Bomber (#1049)
It was accidentally set to Z instead.
2024-04-18 22:23:59 +02:00
Lisandro Lorea
01db4a6f99 Fix joypad demo for Godot 4.x (#943) 2024-04-13 14:50:02 -07:00
Bastiaan Olij
035e905a3e XR demos: Add check for VRS/foveation in start vr script, and enable foveation in project settings (#1022)
Co-authored-by: Aaron Franke <arnfranke@yahoo.com>
2024-04-12 14:16:23 -07:00
Christen Lofland
b2ed2d6f6d Remove tiles outside of texture to elliminate these errors on loading the project: (#1035)
```
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)
```
2024-04-12 14:16:04 -07:00
captain-redbeard
fbef18f58b Updated Dodge the Creeps C# to Godot mono 4.2 (#1000)
Co-authored-by: Ivan Shakhov <van800@gmail.com>
Co-authored-by: Aaron Franke <arnfranke@yahoo.com>
2024-04-12 00:56:02 -07:00
Hugo Locurcio
4f866f2a9a Add doors as an example of dynamic occluders in the Occlusion culling demo (#807)
The occluders don't actually move, but are toggled when the door starts
opening and finishes closing to avoid unnecessary BVH rebuilds.
2024-04-11 21:07:55 -07:00
Muller-Castro
af93126e05 Fix missing baked_exposure (#1043) 2024-04-11 20:57:52 -07:00
Hugo Locurcio
5bda007763 Update GUI Translation demo for 4.0 (#930)
- Add PO support in addition to CSV.

Co-authored-by: SkyJJ <jjchai01@hotmail.com>
2024-04-11 20:55:49 -07:00
Christen Lofland
f70868ce22 Use @onready to init previous_position to prevent errors (#1042) 2024-04-11 20:36:15 -07:00
Aaron Franke
6e44341d67 Merge pull request #1041 from chrisl8/2.5d-editor-view-update
Update 2.5D GDScript demo to display the editor plugin in Godot 4.
2024-04-11 20:33:37 -07:00
Aaron Franke
3788da41cd Fix 2.5D editor viewport and gizmo for Godot 4.x 2024-04-11 20:30:58 -07:00
Aaron Franke
57c1cb9ffa More tweaks to the 2.5D demo for Godot 4.x 2024-04-11 13:50:34 -07:00
Christen Lofland
85b8f10778 Prefer using guard clauses as suggested by aaronfranke. 2024-04-10 16:33:46 -05:00
Christen Lofland
0a35055aa0 Undue some formatting changes that were in dispute. 2024-04-10 16:31:51 -05:00
Christen Lofland
3ef6a15741 Update 2.5D GDScript demo to display the editor plugin in Godot 4. 2024-04-10 11:52:08 -05:00
Christen Lofland
d190e73ad3 Only print MIDI device list if any are found in MIDI Piano (#1039)
This is a silly "fix", but it prevents an empty `[]` from being printed every time
this demo is run without a MIDI device plugged into the computer.

The MIDI devices list is printed if one is plugged into the computer, which I have tested.
2024-04-10 01:30:09 +02:00
Clay John
79d30931c3 Switch to single safe threaded model in TextureRD demo (#1038)
Multithreaded rendering is not safe in 4.2, so it should not be used
in our official demos for now.
2024-04-09 02:09:27 +02:00
iltenahmet
56f103953d Update dodge-the-creeps asset library link (#1034) 2024-04-03 15:32:10 -07:00
Christen Lofland
be7be4c1cc Disable 2D MSAA in Dynamic TileMap Layers to avoid warning on start (#1030)
The demo uses the Compatibility rendering method, which currently
doesn't support 2D MSAA.
2024-04-02 03:19:56 +02:00
Christen Lofland
5553ecfd88 Fix font code for Godot 4 in Finite State Machine (#1027)
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.
2024-04-02 01:52:04 +02:00
Christen Lofland
ab9ffb7558 Fix font setup in Dodge the Creeps (#1026) 2024-04-02 01:50:12 +02:00
谢天
c181965682 Fix incorrect toggle_mouse_capture key in Global Illumination (#1029) 2024-04-02 01:21:01 +02:00
Hugo Locurcio
31d1c0c112 Remove old and unused project settings, update various demos for 4.2 (#1024)
- 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.
2024-03-26 18:01:58 +01:00
A Thousand Ships
82913393a8 Improve code style (#1021)
* 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"...)`
2024-03-25 17:06:52 +01:00
behrooz bozorgchamy
523c7d34c0 Update Pong with C# to Godot 4.2.1 (#966) 2024-03-25 16:25:51 +01:00
Hugo Locurcio
71eea49eba Fix player and mob animations not looping in Squash the Creeps (#1020)
This was missed in the upgrade to 4.0, which reset loop mode properties
in Animation.
2024-03-06 23:08:05 +01:00
Hugo Locurcio
98e9176b73 Update README for new branches 2024-03-06 19:32:56 +01:00
Nazarwadim
b8a8670301 Fix hitboxes not matching physical appearance in Squash the Creeps (#1019) 2024-03-06 19:31:21 +01:00
Markus Sauermann
a69b2f7e21 Rewrite GUI in 3D demo to use Physics Picking for mouse events (#925)
Rework GUI in 3D Demo to handle mouse events via
Physics Picking instead of in _unhandled_input.

This brings several benefits:
- Correctly handle cases, where the 3D-GUI is located behind other
collision objects.
- Proper passive hovering support

This allows also to make simplifications in the code, because
3D-mouse position no longer needs to be calculated manually.
2024-02-24 18:06:19 +01:00
Ryan Roden-Corrent
722bd11689 Update viewport scaling demo to 4.x
The 3d_scaling demo was updated to use the built-in 3D scaling mechanisms
in the Forward+ and Mobile renderer (Compatibility in 4.3).

Co-authored-by: A Thousand Ships <96648715+AThousandShips@users.noreply.github.com>
2024-02-13 19:17:02 +01:00
Hugo Locurcio
4d01a2678f Port demos with remade art assets to Godot 4 (#922)
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>
2024-02-10 01:40:04 +01:00
Luis Henrique Rocha
8fc246a051 Fix vertical movement sprite in Dodge the Creeps (#1006)
Using rotation in the player node instead of flipping vertically, by doing so the trail is also rotated.
2024-02-07 23:16:03 +01:00
Fabio Alessandrelli
f954d78903 Fix missing parameter in webrtc_signaling "connected" handler (#995) 2024-02-07 23:05:53 +01:00
Hugo Locurcio
196df0c78b Add integer scaling to Multiple resolutions demo (#985)
This also adds pixel art reference images for comparing results
with various stretch settings.
2024-02-07 23:05:26 +01:00
Fabio Alessandrelli
ddf6d60ed4 Fix Web platform checks in WebRTC signaling demo (#1015)
The check to hide the "Listen" button on Web platforms was not updated
from the old 3.x name (HTML5).
2024-02-07 23:05:12 +01:00
Hugo Locurcio
c423f3bfc6 Improve volumetric fog demo (#1014)
- Add fog shader example courtesy of alghost
  (https://godotshaders.com/shader/moving-gradient-noise-fog-mist-for-godot-4/).
- Add textured floor to make volumetric fog easier to see.
- Add keys to adjust volumetric fog quality (higher values are sharper).
- Increase volumetric fog energy on one of the SpotLights to show
  the difference.
2024-02-01 17:30:35 +01:00
Hugo Locurcio
2a962929f3 Update demo files for Godot 4.2.1 (#1013)
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).
2024-02-01 17:30:08 +01:00
Rémi Verschelde
b74261ca04 Merge pull request #993 from Calinou/add-runtime-save-load-demo
Add a run-time saving/loading demo project
2024-01-19 10:00:24 +01:00
Rémi Verschelde
7176ff19dc Merge pull request #932 from Calinou/bidi-font-features-add-variable-fonts-system-fonts
Add variable fonts and system fonts to BiDi and Font Features demo
2024-01-19 09:58:28 +01:00
Rémi Verschelde
62db0c91de Merge pull request #994 from Calinou/3d-antialiasing-add-alpha-antialiasing
Add alpha antialiasing example to 3D Antialiasing demo
2024-01-19 09:58:18 +01:00
Rémi Verschelde
b36d6f0db2 Merge pull request #998 from Calinou/truck-town-mobile
Add mobile controls and optimized settings to Truck Town
2024-01-19 09:56:55 +01:00
Rémi Verschelde
81ea8edf47 Merge pull request #1010 from BastiaanOlij/fix_start_vr_script
Fixed typo in start vr script for selecting refresh rate
2024-01-15 10:54:39 +01:00
Bastiaan Olij
567931097e Fixed typo in start vr script for selecting refresh rate 2024-01-13 22:20:15 +11:00
Bastiaan Olij
4a4b46cbe1 Add OpenXR movement demos (#977) 2023-11-18 11:49:06 +01:00
Hugo Locurcio
cdbdbac1e7 Add mobile controls and optimized settings to Truck Town
On mobile platforms, the vehicle automatically accelerates.
Touch the left and right edges of the screen to steer.
Touch the middle of the screen to brake/reverse
(this also temporarily stops acceleration).

- Fix braking not working correctly (and make breaking stronger
  to make vehicles easier to control at high speeds).
- Allow using the D-Pad for steering and X/Square for braking.
- Tweak exhaust particles to be more subtle and fade more smoothly.
- Change spawn position to a location that's more straightforward
  to drive.
2023-11-17 20:11:31 +01:00
Bastiaan Olij
5eed925b7b Add compute texture demo (#938) 2023-11-17 12:55:09 +01:00
Hugo Locurcio
c76c4e8a5c Add alpha antialiasing example to 3D Antialiasing demo
- Add colored planes below some examples to make antialiasing
  differences easier to see.
- Change various textures to make antialiasing differences easier to see.
2023-11-15 20:17:01 +01:00
Hugo Locurcio
a2557fce51 Add a run-time saving/loading demo project
This is useful to load user-generated content without requiring users
to create a PCK file for it.
2023-11-03 16:12:14 +01:00
Nazarwadim
40ce32c5da Fix player trail appearance in Dodge The Creeps (#986) 2023-10-30 18:47:37 +01:00
Alex
7af99c55ef Update WebSocket Minimal demo for Godot 4.1 (#990) 2023-10-30 18:44:30 +01:00
Alex
232eb35acf Update Mobile Sensors demo for Godot 4.1 (#992) 2023-10-30 18:44:11 +01:00
David Briscoe
757cc4261c Update 2D Skeleton demo for Godot 4.1 (#976) 2023-10-25 04:42:32 +02:00
Alex
851862f8db Update Multitouch Cubes demo for Godot 4.1 (#989) 2023-10-25 01:51:22 +02:00
Alex
5689210c46 Fix player occasionally not being hit by bomb in Multiplayer Bomber (#987)
If the bomb and the player are at the same position, then `intersect_ray` returns no result.
`query.hit_from_inside = true` fixes the problem. The other changes were made automatically by Godot.
2023-10-23 00:09:54 +02:00
Aaron Franke
4d31672264 Merge pull request #982 from satoshidisciple/fix_bug/webrtc_signaling
Example of "webrtc_signaling" not working on the web
2023-10-20 19:34:29 -05:00
Alex
7e9d31bb04 Fix one-way collision script error in 2D Physics Tests (#962) 2023-10-18 03:24:59 +02:00
David Briscoe
1b61bc4bb0 Use NavigationAgent3D in 3D Navigation demo (#975)
Co-authored-by: Hugo Locurcio <hugo.locurcio@hugo.pro>
2023-10-18 03:23:57 +02:00
Tomek
84b7f9ea36 Add dynamic TileMap layer demo (#954) 2023-10-18 03:22:09 +02:00
S Manikanta Varshit
d880218056 Fix typo in Mobile sensors script comment (#947) 2023-10-18 03:19:05 +02:00
David Briscoe
3706e3e998 Map attack to gamepad X, revise text in Finite State Machine demo (#937) 2023-10-18 02:53:17 +02:00
Alex
e2abd0e7fb Update Matrix Transform demo to Godot 4.1 (#978)
Co-authored-by: Hugo Locurcio <hugo.locurcio@hugo.pro>
2023-10-18 02:38:00 +02:00
Alex
647002a75c Port Navigation Polygon 2D demo to Godot 4.1 (#955) 2023-10-18 01:58:34 +02:00
Alex
9484fbbace Fix errors in Physics-Based Platformer 2D demo (#958) 2023-10-18 01:40:43 +02:00
Alex
1c169add0d Add FPS counter, V-Sync and Limit FPS to 3D Anti-Aliasing demo (#968) 2023-10-18 01:36:39 +02:00
Alex
7e43dbf64b Make animations smoother in Audio Spectrum demo (#972) 2023-10-18 01:31:12 +02:00
Alex
ce4600350e Add Limit FPS option to the 3D Graphics Settings demo (#970) 2023-10-18 01:30:06 +02:00
Satoshi Disciple
db8ac0422d make websocket pool every time 2023-10-16 22:53:00 -03:00
Hugo Locurcio
fc7ff91882 Add glass material to Procedural materials demo (#980) 2023-10-11 22:35:23 +02:00
Alex
0dfb54ff7f Fix HSlider and test_collision_pairs in 3D Physics Tests (#971)
Co-authored-by: Hugo Locurcio <hugo.locurcio@hugo.pro>
2023-10-01 03:55:10 +02:00
Hugo Locurcio
65b34f8192 Update Voxel demo for Godot 4.1.1 (#965) 2023-09-24 23:41:35 +02:00
behrooz bozorg chami
ad2cdfebd4 Update Multitouch View demo for Godot 4.1 (#960) 2023-09-22 21:42:37 +02:00
Hugo Locurcio
1113bafac4 Merge pull request #945 from AThousandShips/fix_global
[Squash The Creeps] Use `Basis.looking_at` to control facing
2023-09-09 17:14:11 +02:00
A Thousand Ships
0938a48563 [Squash The Creeps] Use Basis.looking_at to control facing
Co-authored-by: Aaron Franke <arnfranke@yahoo.com>
2023-09-07 19:36:17 +02:00
Aaron Franke
68aefef5b9 Merge pull request #944 from godotengine/dependabot/github_actions/actions/checkout-4
Bump actions/checkout from 3 to 4
2023-09-04 16:05:28 -05:00
dependabot[bot]
e85494a57a Bump actions/checkout from 3 to 4
Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-04 19:33:06 +00:00
Hugo Locurcio
e9f0f75c5b Update "Grid-based Navigation with AStarGrid2D" demo for 4.1 (#914)
Update "Grid-based Navigation with AStarGrid2D" demo for 4.1
2023-08-07 14:00:14 +02:00
Rémi Verschelde
9c8dc6383e Merge pull request #928 from Calinou/bbcode-fix-typo
Fix typo in Rich Text Label with BBCode
2023-08-01 16:38:59 +02:00
Hugo Locurcio
f7e3ceb31e Add camera controls to the Physical Light and Camera units demo (#931) 2023-07-18 09:03:43 +02:00
Aaron Franke
c3f09a45dc Merge pull request #933 from Calinou/contributing-fix-typo
Fix typo in contribution guidelines
2023-07-09 12:56:25 -05:00
Hugo Locurcio
fbc7341439 Fix typo in contribution guidelines 2023-07-09 18:45:50 +02:00
Hugo Locurcio
179f94528b Add variable fonts and system fonts to BiDi and Font Features demo 2023-07-07 20:56:17 +02:00
Hugo Locurcio
beaefdc0c0 Fix typo in Rich Text Label with BBCode
- Allow toggling pause by pressing the Pause key,
  in addition to the existing button.
2023-07-05 15:23:31 +02:00
Seth Louis
ea37c101e0 Fix Z Index on platforms in 2D platformer demo (#927) 2023-07-05 15:15:38 +02:00
Aaron Franke
a5d736f624 Merge pull request #926 from Calinou/add-project-tags
Add tags to all demo projects
2023-06-28 15:58:40 -05:00
MotH
0a84347d11 Sorted tags 2023-06-28 21:27:10 +02:00
Aaron Franke
b032b75c07 Merge pull request #919 from Calinou/add-procedural-materials-demo
Add a 3D procedural materials demo
2023-06-27 22:18:57 -05:00
Aaron Franke
c27056da58 Merge pull request #884 from Calinou/add-squash-the-creeps-demo
Add Squash the Creeps (3D) demo
2023-06-27 22:18:19 -05:00
Aaron Franke
302e8727e1 Merge pull request #888 from Calinou/add-physical-light-camera-units-demo
Add a 3D physical light and camera units demo
2023-06-27 22:14:16 -05:00
Hugo Locurcio
18c76b6dae Add tags to all demo projects
This makes sorting them in the project manager easier, as you can
click tags in the project manager to filter to a specific tag.
2023-06-26 18:03:50 +02:00
Doug Noël
5867e5e931 Update Drag and Drop GUI demo to Godot 4.0 (#881)
Co-authored-by: Hugo Locurcio <hugo.locurcio@hugo.pro>
2023-06-26 11:47:40 +02:00
Aaron Franke
f4d146d0ec Merge pull request #894 from Calinou/add-large-world-coordinates-demo
Add a large world coordinates demo
2023-06-05 10:25:24 -05:00
Alex
548c4d5b26 Fix run error on multiplayer_pong project (#923) 2023-06-05 17:14:45 +02:00
Hugo Locurcio
6860a1e814 Add a 3D procedural materials demo 2023-05-26 17:42:00 +02:00
Max Hilbrunner
3a38ab4635 Merge pull request #902 from LinuxUserGD/patch-2 2023-05-17 14:11:27 +02:00
Fabio Alessandrelli
0e83ebc6af [WebSocket] Fix chat demo to updated TLS function. (#918) 2023-05-05 17:10:46 +02:00
Hugo Locurcio
b47178faac Use a different color for moving platforms in platformer demos (#907)
This highlights the fact that these platforms are intended to be moving,
as they can be paused for a few seconds when you reach them.
2023-05-05 15:47:17 +02:00
Hugo Locurcio
7cd99ae192 Fix particles in Platformer 3D demo, add coin glow (#908)
- Add a visible coin glow around coins to make them more noticeable
  at a distance.
- Enable Billboard Keep Scale material property on particle draw
  materials that required it.
- Use transparent additive shading as intended for the bullet trail.
- Tweak blob shadow texture and decal to be slightly more subtle.
2023-05-05 15:47:10 +02:00
Hugo Locurcio
81a16597b9 Remove unused texture from Material Testers demo (#869)
This also resaves resource files to use the new VRAM compression options
in 4.0.
2023-05-05 15:46:41 +02:00
Hugo Locurcio
79edc17b70 Add AMD FidelityFX Super Resolution 1.0 toggle to the 3D antialiasing demo (#871)
- Expose FSR Sharpness when FSR is enabled.
- Allow more granular controls for rendering scale factor.
- Add a FPS limit option when TAA is enabled, as TAA convergence quality depends
  on the rendered framerate.
- Display viewport resolution (taking 3D resolution scale into account)
  in the top-right corner.
- Decrease directional shadow bias to reduce peter-panning.
- Fix some particles not being scaled over a lifetime curve.
2023-05-05 15:46:27 +02:00
Hugo Locurcio
1eb4eccd55 Use Compatibility rendering method in Multiple Resolutions demo (#903)
This also fixes the missing window size override.
2023-05-05 15:46:12 +02:00
Hugo Locurcio
2aff1c69a3 Update 3D Graphics Settings demo for 4.0 (#883)
- Fix scripts for Godot 4.0.stable.
- Tweak Low preset (enable FXAA, disable MSAA to improve performance).
- Colorize FPS counter depending on framerate
  (red = bad, yellow = OK, green = good, cyan = great).
- Use first-class Signal syntax to reduce reliance on strings.
2023-05-05 15:46:00 +02:00
Hugo Locurcio
65c8d77cf4 Add demo submission guidelines (#912)
The pull request template was changed to match godotengine/godot's.
2023-05-05 15:45:22 +02:00
Danil Alexeev
502d410777 Update "Grid-based Navigation with AStarGrid2D" demo 2023-04-26 15:57:41 +03:00
Aaron Franke
0d02b2f90d Merge pull request #910 from Araraura/patch-1
Add missing return types in platformer's pause_menu.gd
2023-04-16 13:21:40 -05:00
Araraura
167e1d391b Add missing return types in platformer's pause_menu.gd 2023-04-16 15:23:58 +00:00
Hugo Locurcio
f6ac674864 Add icons for several projects (#886) 2023-04-13 16:51:05 +02:00
Linux User
83af3223df Change copyright year to "present" in LICENSE.md
Just like godotengine/godot#70885 did for the main Godot repository.
2023-04-04 16:08:03 +00:00
Hugo Locurcio
518eb6df52 Add a large world coordinates demo
This allows testing double-precision builds and see if they work as expected,
while providing an interactive demonstration.
2023-03-30 19:19:53 +02:00
Hugo Locurcio
199e4bed4c Add a variable rate shading demo (#852) 2023-03-30 19:13:50 +02:00
Hugo Locurcio
63d1cd9a60 Use 128×128 WebP icons for all demos (#885) 2023-03-29 18:59:57 +02:00
Tomek
4bbf04129a Add an optional extra RESET step in Tween demo (#892) 2023-03-29 18:35:26 +02:00
Hugo Locurcio
d4496aada8 Add a 3D physical light and camera units demo 2023-03-17 00:32:56 +01:00
Hugo Locurcio
71d29dcf3b Add Squash the Creeps (3D) demo
This is a 3D version of Dodge the Creeps, originally made by GDQuest
and updated to 4.0 by myself.

Some changes are included for more polish:

- Invisible walls were added so that you can't exit the playable area anymore.
- Pillars have a different color to be more visible.
- Physical keys are now used, so that you can use WASD movement
  on any keyboard layout.
- The right mouse button can now be used to jump.
- Visual settings were tweaked to match other 3D demos.
- Project icon was upscaled to 128×128 using Waifu2x, so that it
  looks better on hiDPI displays.
- `.blend` files were resaved with compression enabled.

Co-authored-by: Nathan Lovato <nathan@gdquest.com>
2023-03-13 23:50:10 +01:00
Aaron Franke
956875c306 Merge pull request #882 from Starkium/Update2.5dGDScript
Change Icon header ordering for 2.5d GD Script Demo
2023-03-12 21:36:31 -05:00
Aaron Benjamin
e375d5aa49 Change Icon header ordering
Just following the rules! Moved up the icon statements above the other includes. This got rid of errors preventing plugin from loading.

There's still a race condition when the plugin starts up. It's looking for an editor interface child that hasn't been loaded yet. May want to use _ready to define some behavior before _enter_tree is used.
2023-03-12 19:03:58 -04:00
Aaron Franke
8a4a0262e9 Merge pull request #880 from InfiniteProductions/audio/text_to_speech-demo-fixed-to-work-with-Godot-4-stable
audio/text_to_speech demo fixed to work with Godot 4 stable
2023-03-08 13:44:55 -06:00
InfiniteProductions
2b16927567 warnings fixed
-id shadowed by function parameter
-delta and new_text never used
2023-03-08 19:56:51 +01:00
InfiniteProductions
92c39e7f1c GUI/InputRemapMenu demo fixed to work with Godot 4 stable (#875)
File class object replaced by the new FileAccess class in order to fix the demo for Godot 4 release
2023-03-08 11:06:57 -06:00
Aaron Franke
185d0f4b05 Merge pull request #878 from InfiniteProductions/audio/device_changer-demo-fixed-to-work-with-Godot-4-stable
fix getter/setter usage of AudioServer object
2023-03-06 23:13:33 -06:00
Aaron Franke
82c9367044 Merge pull request #876 from InfiniteProductions/GUI/rich_text_bbcode_godot-4-stable_fix
disconnect unused signal connected to a removed method
2023-03-06 23:11:16 -06:00
Aaron Franke
4045f997c2 Merge pull request #877 from InfiniteProductions/loading/serialization-demo-fixed-to-work-with-Godot-4
loading/serialization demo fixed to work with Godot 4 stable
2023-03-06 23:05:50 -06:00
InfiniteProductions
934b02bd84 fix getter/setter usage of AudioServer object
update names to match new ones
2023-03-06 21:37:59 +01:00
InfiniteProductions
4e27134403 fix a warning on Stringify call
The function 'stringify()' is a static function but was called from an instance. Instead, it should be directly called from the type: 'JSON.stringify()'.<GDScript Error>STATIC_CALLED_ON_INSTANCE
<GDScript Source>save_load_json.gd:37
2023-03-06 10:46:53 +01:00
Aaron Franke
76ec36d805 Merge pull request #874 from dalexeev/gds-var-colon-style
Fix GDScript code style regarding colon (demos)
2023-03-05 23:49:35 -06:00
Danil Alexeev
285139fc4e Fix GDScript code style regarding colon (demos) 2023-03-06 08:44:13 +03:00
InfiniteProductions
a62a4c8534 disconnect unused signal connected to a removed method
Handler "_on_pause_pressed" has been removed but not the signal from the button.
2023-03-05 22:41:28 +01:00
Jonathan Nicholl
3696e43696 Fix 3D platformer (#872)
Also converted the PNG files to lossless WebP and removed an unused .import file while I was at it.
The rest of the changes were done automatically by the editor when I opened the files.
2023-03-03 22:56:03 +01:00
Rémi Verschelde
778baf07cc Merge pull request #867 from dalexeev/fix-rendering-back-end-setting
Fix renamed `vulkan/rendering/back_end=1` setting (Vulkan Mobile)
2023-03-01 15:13:42 +01:00
Rémi Verschelde
106e03c3b8 Merge pull request #866 from dalexeev/update-dodge-the-creeps
Update "Dodge the Creeps" demo
2023-03-01 15:13:19 +01:00
Rémi Verschelde
c34e3f33c6 Merge pull request #865 from jtnicholl/physics_platformer
Update 2D physics platformer for 4.0
2023-03-01 15:12:48 +01:00
Danil Alexeev
b4ab5b4e14 Fix renamed vulkan/rendering/back_end=1 setting (Vulkan Mobile) 2023-03-01 10:22:42 +03:00
Danil Alexeev
b4252c05bf Update "Dodge the Creeps" demo 2023-03-01 09:46:50 +03:00
Jonathan Nicholl
cbb297750f Update 2D physics platformer for 4.0 2023-02-28 13:50:54 -05:00
Rémi Verschelde
6cbfa30e8b CI: Disable HTML5 export workflow for now, not ported to 4.0 2023-02-28 18:43:23 +01:00
Rémi Verschelde
58c33d04db Update README for new branches, matches Godot upstream
(cherry picked from commit c0180d20d1)
2023-02-28 18:37:43 +01:00
Rémi Verschelde
e306a408dc Merge pull request #861 from dalexeev/astar-grid-2d
Rework "Grid-based Navigation with Astar" demo
2023-02-28 17:35:29 +01:00
Danil Alexeev
8ef5764b0d Rework "Grid-based Navigation with Astar" demo 2023-02-28 18:50:55 +03:00
Rémi Verschelde
b81ab55554 Merge pull request #859 from Calinou/improve-audio-spectrum-demo
Improve Audio Spectrum demo
2023-02-28 16:46:43 +01:00
Rémi Verschelde
6947ff4529 Merge pull request #858 from KMouratidis/patch-1
Fix "is mount_event" check in gui_in_3d to work with both 4 beta and 4 rc
2023-02-28 16:41:09 +01:00
Rémi Verschelde
20d2e6ed2f Merge pull request #851 from jtnicholl/2d_platformer
Update, clean up, and reorganize the 2D platformer
2023-02-28 16:40:12 +01:00
Rémi Verschelde
a3a6e72099 Merge pull request #863 from dalexeev/fix-screen-texture
Fix `SCREEN_TEXTURE` in "Screen Space Shaders" demo
2023-02-28 16:34:34 +01:00
Danil Alexeev
faee000550 Fix SCREEN_TEXTURE in "Screen Space Shaders" demo 2023-02-28 15:48:51 +03:00
Danil Alexeev
1cf4fff74a Remove unnecessary randomize() (#862)
Seed is now automatically randomized on startup in Godot 4.
2023-02-27 18:02:44 +01:00
Hugo Locurcio
6df3667072 Improve Audio Spectrum demo
- Draw fake reflections for spectrum bars.
- Increase the bars' height to better make use of the window space.
- Use Compatibility rendering method for greater performance
  and compatibility.
- Update screenshot and icon.
- Remove a stray `.import` file.
2023-02-26 18:25:37 +01:00
Kostas Mouratidis
d059806f20 Fix "is mount_event" check in gui_in_3d to work with both 4 beta and 4 rc 2023-02-26 13:10:46 +01:00
James Tucker
e03d6abbc8 Update finite state machine demo for 4.0.rc4 (#850)
Co-authored-by: Hugo Locurcio <hugo.locurcio@hugo.pro>
2023-02-24 18:32:34 +01:00
dev-gilbride
648befbf58 Check for obstacle before teleporting player in Grid-based Pathfinding with Astar (#771)
Co-authored-by: Hugo Locurcio <hugo.locurcio@hugo.pro>
2023-02-24 18:23:38 +01:00
bruvzg
78dffe0d04 Add a text-to-speech demo (#744)
Co-authored-by: Hugo Locurcio <hugo.locurcio@hugo.pro>
2023-02-24 18:11:55 +01:00
Hugo Locurcio
fa3c247bd5 Update Bidi and Font Features demo for 4.0.rc4 (#763) 2023-02-24 17:53:38 +01:00
James Tucker
73d96b7306 misc/window_management: Fix screen size and label order (#848) 2023-02-24 17:47:21 +01:00
Jonathan Nicholl
ffd600917d Update, clean up, and reorganize the 2D platformer 2023-02-23 21:10:01 -05:00
James Tucker
da6fffbc81 Update Operating System Testing demo for 4.0.rc2 (#847) 2023-02-18 18:22:04 +01:00
Simon Proctor
5e8f722c91 Change warning ignores to use a string identifier (#842)
Co-authored-by: Aaron Franke <arnfranke@yahoo.com>
Co-authored-by: Hugo Locurcio <hugo.locurcio@hugo.pro>
2023-02-16 20:14:51 +01:00
Hugo Locurcio
7e9078be51 Update Global Illumination demo for 4.0.rc1 (#839) 2023-02-08 22:45:22 +01:00
Justo Delgado
26d2f226a8 Fixed isometric demo rendering for Godot 4.0-rc1 (#840) 2023-02-08 18:25:55 +01:00
Rémi Verschelde
b89af52a73 Merge pull request #758 from Calinou/improve-global-illumination-demo
Improve 3D global illumination demo (4.0)
2023-02-08 15:45:24 +01:00
Rémi Verschelde
ac939fc8f8 Merge pull request #838 from Williangalvani/rpc
Add quotes to rpc flags
2023-02-08 15:18:35 +01:00
Willian Galvani
a00465dee8 Add quotes to rpc flags
see https://github.com/godotengine/godot/issues/72218
2023-02-08 15:16:39 +01:00
Rémi Verschelde
ecd12d2163 Merge pull request #835 from Calinou/improve-control-gallery
Improve and update Control Gallery for Godot 4.0
2023-02-08 15:13:03 +01:00
Hugo Locurcio
a0ad65d7df Improve and update Control Gallery for Godot 4.0
- Add a Tree example.
- Add more tabs to make tab scroll buttons visible.
- Use default project font, which is now a DynamicFont in Godot 4.0.
- Make splitters thinner but have a larger draggable area,
  thanks to the new Minimum Grab Thickness theme item.
- Tweak background color to be more visually pleasant.
- Use Compatibility backend to maximize performance and compatibility.
- Disable V-Sync to reduce input lag (while keeping low-processor mode).
2023-01-31 14:56:39 +01:00
Hugo Locurcio
8fcf95c120 Improve joypads demo (#830) 2023-01-31 14:46:09 +01:00
Aaron Franke
a78c51da26 Merge pull request #833 from moth-boi/fix-bomb-animation
Fix bomb animation
2023-01-24 18:20:39 -06:00
MotH
b91b30a854 Fix bomb explosion animation 2023-01-25 01:11:22 +01:00
Aaron Franke
fb9d637fb7 Merge pull request #832 from moth-boi/4.0-dev
Fix bomb collisions through walls on 4.0-dev
2023-01-24 17:53:22 -06:00
Aaron Franke
a467f5078b Merge pull request #834 from moth-boi/fix-ysort
Fix bomb spawning above player
2023-01-24 17:51:19 -06:00
MotH
6c521556a0 Fix bomb spawning above player 2023-01-25 00:07:22 +01:00
MotH
b22177e926 Fix bomb collisions through walls 2023-01-24 23:35:31 +01:00
Rémi Verschelde
19dd819072 Fix joypads demo button/axis mappings for 4.0 (#828) 2023-01-23 13:20:54 +01:00
Hugo Locurcio
c22732e4cc Improve 3D global illumination demo
- Readd LightmapGI example.
- Allow toggling between the Once and Always update modes for the
  ReflectionProbe.
- Add a Decal node to act as a blob shadow for dynamic objects.
- Halve SSAO intensity for a better apperance in the demo's flat,
  bright surfaces.
- Halve ambient light sky contribution when using the disabled
  or lightmap-based GI modes. This prevents the level's shaded areas
  from looking too bright and blue (with lightmaps, this change only
  affects dynamic objects.)
- Enable FXAA and debanding for a better appearance.
2023-01-18 07:35:31 +01:00
Zoee Silcock
24bd3745e3 Fix and update the Operating System Testing demo (#818)
Global menu support is now functional on macOS.
2023-01-18 01:17:54 +01:00
Rémi Verschelde
afc51649fe Merge pull request #805 from Calinou/add-csg-demo
Add a constructive solid geometry (CSG) demo
2023-01-17 22:49:07 +01:00
Rémi Verschelde
d9202081aa Merge pull request #761 from Calinou/add-3d-labels-and-texts-demo
Add a 3D labels and texts demo
2023-01-17 22:47:54 +01:00
Rémi Verschelde
40b8c76856 Merge pull request #826 from Calinou/add-3d-lights-and-shadows-demo
Add a 3D lights and shadows demo
2023-01-17 22:46:54 +01:00
Hugo Locurcio
cfeb6d6b75 Add a 3D particles demo (#757) 2023-01-17 21:42:38 +01:00
Hugo Locurcio
a667e74db5 Add a 3D decals demo (#756)
Co-authored-by: dzil123 <5725958+dzil123@users.noreply.github.com>
2023-01-17 21:41:53 +01:00
Hugo Locurcio
682b933dac Improve dynamic split screen demo (#815) 2023-01-17 21:41:02 +01:00
Hugo Locurcio
ee5862a782 Improve the Rich Text Label with BBCode demo (#816) 2023-01-17 21:39:40 +01:00
Hugo Locurcio
bf898dc717 Update and improve GUI Theming Override demo (#817) 2023-01-17 21:39:28 +01:00
Hugo Locurcio
55934859e3 Add camera selection to Truck Town (#820) 2023-01-17 21:39:18 +01:00
Hugo Locurcio
8a6a3a8eef Improve Regular Expressions (RegEx) demo (#821)
Co-authored-by: Cykyrios <cykyrios@gmail.com>
2023-01-17 21:38:33 +01:00
Hugo Locurcio
6bdf4cd06e Update and improve Material Testers for Godot 4.0 (#823)
Co-authored-by: Bastiaan Olij <mux213@gmail.com>
2023-01-17 21:38:15 +01:00
Hugo Locurcio
2c2c89e040 Improve 2D in 3D demo (#814) 2023-01-17 21:37:16 +01:00
Fabio Alessandrelli
490f178f62 Merge pull request #825 from Faless/fix/4.x_bomber_spawn_function
[Net] Fix Multiplayer Bomber custom spawner.
2023-01-16 21:27:34 +01:00
Hugo Locurcio
f2c66d1904 Add a 3D lights and shadows demo 2023-01-16 08:40:24 +01:00
Fabio Alessandrelli
c1461de661 [Net] Fix Multiplayer Bomber custom spawner.
Needed starting beta11 (Godot GH-71129).
2023-01-13 16:19:18 +01:00
Hugo Locurcio
905717d462 Add a 3D labels and texts demo 2023-01-12 18:17:23 +01:00
Hugo Locurcio
470464518b Fix canvas size having a 1-frame delay in Multiple resolutions (#819) 2023-01-12 03:35:48 +01:00
Zoee Silcock
b04aa38abb Fix method names in GD Paint that have changed in 4.0 (#813) 2023-01-07 23:20:12 +01:00
Zoee Silcock
3b06e40e72 Fix property name of viewport width/height settings in Multiple resolutions (#811)
Co-authored-by: Hugo Locurcio <hugo.locurcio@hugo.pro>
2023-01-06 23:08:54 +01:00
Hugo Locurcio
1d5184e235 Update most demos for Godot 4.0.beta10 (#782) 2023-01-05 16:50:17 +01:00
Hugo Locurcio
85ca2fb2a1 Add a compute shader demo (#810)
Co-authored-by: dzil123 <5725958+dzil123@users.noreply.github.com>
Co-authored-by: Hugo Locurcio <hugo.locurcio@hugo.pro>
Co-authored-by: MoltenCoffee <13321277+MoltenCoffee@users.noreply.github.com>
2023-01-03 00:16:59 +01:00
Hugo Locurcio
d3cc6be62c Add an occlusion culling and mesh LOD demo (#801) 2022-12-19 16:58:12 +01:00
Tomek
4eb852ac78 New Tween demo (#803) 2022-12-17 23:44:08 +01:00
Hugo Locurcio
139cb6b05e Add a constuctive solid geometry (CSG) demo 2022-12-16 23:02:17 +01:00
Jonathan Nicholl
35f9517ea8 Update 3D Platformer for 4.0 (#770) 2022-12-13 16:51:20 +01:00
Jonathan Nicholl
095beddcb9 Update loading demos for 4.0 (#776) 2022-12-13 16:51:04 +01:00
Rafael Correa
1b2ce74a39 Change to correct RPC syntax in Multiplayer bomber demo (#802) 2022-12-04 19:36:52 +01:00
Fabio Alessandrelli
fa0fce0eb6 Merge pull request #792 from expressobits/4.0-dev
Update multiplayer pong to godot 4 beta 5
2022-12-03 21:45:39 +01:00
Rafael Correa
1a9aea09ef Update multiplayer pong to godot 4 beta 5 2022-12-03 15:05:21 -03:00
Fabio Alessandrelli
0cfbbec3f9 Merge pull request #794 from Faless/ws/4.0_fix_list
[4.0] [WebSocket] Fix peers handling in multiplayer example.
2022-11-26 16:53:10 +01:00
Fabio Alessandrelli
f47f25180c [WebSocket] Fix peers handling in multiplayer example.
Disconnected peers were not properly removed from the local peers list.
2022-11-24 17:17:50 +01:00
Fabio Alessandrelli
c71e401b08 Merge pull request #789 from Faless/rtc/4.0-beta4
[WebRTC] Update demos to beta4.
2022-11-22 17:43:41 +01:00
Fabio Alessandrelli
364e8cbfb8 Update WebRTC signaling demo to Godot beta4.
The signaling server protocol has been rewritten to use JSON format to
be more readable.

Lobbies now support both mesh and client/server modes (selected during
creation).

The client/server mode uses the SceneMultiplayer relay mode as
implemented in beta4.

The demo now uses an RPC for pinging, and connects to the MultiplayerAPI
instead of using the raw MultiplayerPeer.
2022-11-21 17:59:40 +01:00
Fabio Alessandrelli
93509019a9 Update WebRTC minimal to 4.0-beta4. 2022-11-19 18:49:36 +01:00
Fabio Alessandrelli
6ca863ffb0 Merge pull request #784 from dsnopek/fix-bomber-demo
Update the multiplayer_bomber demo to work with Godot 4.0-beta3
2022-11-14 22:41:53 +01:00
David Snopek
a425dccaa5 Update the multiplayer_bomber demo to work with Godot 4.0-beta3 2022-10-17 15:21:50 -05:00
Rémi Verschelde
2eb14690fc Merge pull request #781 from Faless/update/ws 2022-10-14 13:41:01 +02:00
Fabio Alessandrelli
da12c09942 [Net] Update WebSocket multiplayer demo.
Updated to Godot 4.

Added combo (default) scene showing dedicated multiplayer branches
(i.e. running both server and clients in the same SceneTree).
2022-09-29 21:13:55 +02:00
Fabio Alessandrelli
dd2ba9a5ba [Net] Update & refactor WebSocket Chat demo.
Uses new unified StreamPeer, dropped the multiplayer part (in favor of
the dedicated WebSocket demo), add reference WebSocketClient and
WebSocketServer signal-based implementations that can be used as drop-in
nodes in any project. Might be worth maintaning it as a separate addon.
2022-09-29 19:16:41 +02:00
Aaron Franke
ea65d7f896 Merge pull request #778 from jtnicholl/remove-vs
Remove VisualScript demos from the 4.0 branch
2022-09-19 21:30:38 -05:00
Jonathan Nicholl
3d16659046 Remove VisualScript demos 2022-09-18 12:29:08 -04:00
Aaron Franke
8d726b52a9 Merge pull request #768 from aaronfranke/truck_town
[4.0] Reorganize Truck Town
2022-08-30 14:39:30 -05:00
Aaron Franke
6cf53c39bf Reorganize Truck Town 2022-08-30 12:52:58 -05:00
Aaron Franke
cd586acd33 Merge pull request #767 from jtnicholl/truck_town
[4.0] Clean up and fix Truck Town
2022-08-30 12:52:49 -05:00
Jonathan Nicholl
3d4947bcb5 Clean up and fix Truck Town 2022-08-30 13:21:30 -04:00
Aaron Franke
044afe7976 Merge pull request #743 from Calinou/add-3d-antialiasing-demo
Add a 3D antialiasing demo
2022-07-10 21:14:34 -05:00
Hugo Locurcio
9dbd05a8a8 Add a 3D antialiasing demo 2022-07-10 20:34:30 -05:00
Aaron Franke
5efee6741f Merge pull request #748 from jtnicholl/3d_navigation
Update 3D navigation demo for 4.0
2022-07-10 20:09:09 -05:00
Jonathan Nicholl
3d7c24ef1b Update 3D navigation demo 2022-07-10 21:03:55 -04:00
Aaron Franke
de27fa1d5a Merge pull request #747 from jtnicholl/loading_threads
Update loading in a thread demo for 4.0
2022-07-10 17:49:02 -05:00
Jonathan Nicholl
02c6a268c3 Update loading in a thread demo 2022-06-23 11:50:59 -04:00
Aaron Franke
ae57eb2080 Merge pull request #742 from aaronfranke/2d-to-control
Convert some 2D nodes to Control nodes in GDPaint and Pseudolocalization demos
2022-05-09 16:33:16 -05:00
Aaron Franke
4af38765af Merge pull request #740 from voylin/FixWindowManagement4.0
Fix window management demo for 4.0
2022-05-09 16:32:27 -05:00
Voylin
f3f0ac4827 Fix for Window Management script + UI for 4.0-dev
UI Fix + fixing script to display correct information

Adding padding to the UI
2022-05-10 06:30:15 +09:00
Aaron Franke
5f1776bdf4 Convert some 2D nodes to Control nodes in GDPaint and Pseudolocal demos 2022-05-08 17:16:45 -05:00
Aaron Franke
c9193d1035 Merge pull request #741 from voylin/FixGDPaintDemo
Fixing GD Paint Issues in 4.0-dev
2022-05-07 20:19:27 -05:00
Voylin
948db2893b Fixing GD Paint Issues
The clipping happened because the panel was see-through.
The saving is also fixed by changing some of the project settings.

Update 2d/gd_paint/paint_root.tscn

Co-authored-by: Aaron Franke <arnfranke@yahoo.com>
changeback to get_node
2022-05-08 09:09:36 +09:00
Aaron Franke
92e24ceb99 Merge pull request #733 from Calinou/multiple-resolutions-update-to-4.0
Update Multiple Resolutions demo for Godot 4.0
2022-05-07 18:48:06 -05:00
Hugo Locurcio
e591ceece9 Update Multiple Resolutions demo for Godot 4.0 2022-05-08 01:35:25 +02:00
Aaron Franke
7ef60c2874 Merge pull request #738 from voylin/GuiInputMappingPersistentKeyMapping4.0
[4.0-dev] GUI Input Mapping Demo Persistent Key Mapping- Fixes #629
2022-05-07 16:50:15 -05:00
Voylin
471243f38e Adding persistence InputMapping
Update gui/input_mapping/KeyPersistence.gd

Co-authored-by: Aaron Franke <arnfranke@yahoo.com>
2022-05-08 06:33:49 +09:00
Aaron Franke
bde67b4c5e Merge pull request #737 from voylin/WindowManagement4.0Update
Window Management Update 4.0
2022-05-07 15:56:15 -05:00
Aaron Franke
666d1cbf99 Merge pull request #736 from voylin/FixPseudolocalizationDemo4.0
Fixed some issues in Pseudo localization Demo 4.0-dev
2022-05-07 15:51:39 -05:00
Aaron Franke
2831e16798 Merge pull request #732 from voylin/DodgeTheCreeps4.0Update
Making Demo Dodge the Creeps ready for 4.0-dev
2022-05-07 15:48:07 -05:00
Aaron Franke
521fc2d755 Merge pull request #735 from voylin/2DScreenSpaceShaders4.0Update
Screen Space Shader Update to 4.0
2022-05-07 15:45:25 -05:00
Voylin
d103e7aec2 Making Demo Dodge the Creeps ready for 4.0-dev
Going through the demo's mentioned at: #697
to fix and prepare them for 4.0.
It was mentioned that there were minor bugs (errors printing in console), found non of that, only some logs about awaits not being needed (they were needed). Everything works again now and stretch_mode set to canvas_items.
change vulkan
2022-05-08 05:45:19 +09:00
Aaron Franke
7349ccc6a0 Merge pull request #734 from voylin/GDPaint4.0Update
GD Paint Demo Update to 4.0
2022-05-07 15:41:39 -05:00
Voylin
cd32f64f80 Window Management Update 4.0
Updated to 4.0 everything should work.
2022-05-05 06:39:00 +09:00
Voylin
983c1361dd Fixed some issues in Pseudo localization Demo 4.0-dev
There were some UI issues + pressed became button_pressed.
2022-05-04 19:30:06 +09:00
Voylin
3657f91c0c Screen Space Shader Update to 4.0
Everything okay.
Part of #697
2022-05-04 18:55:07 +09:00
Voylin
7edfc9b29e GD Paint update to 4.0
Part of #697
Demo is working now in 4.0.
There is only one slight issue, but that has to do with the engine viewport system I think. When saving the picture, the framing isn't always correct, really depends how you scaled the window. This could also be a me issue as I use i3 on linux (Tiling window manager).

But otherwise, it's working perfectly.
2022-05-03 08:09:39 +09:00
Aaron Franke
e77b85fba3 Merge pull request #730 from godotengine/master
Merge recent changes from master into the 4.0-dev branch
2022-05-02 09:19:08 -05:00
Aaron Franke
5c40412e34 Merge pull request #719 from Calinou/improve-3d-graphics-settings-demo
Improve the 3D graphics settings demo
2022-04-25 15:08:12 -04:00
Hugo Locurcio
48d2ec90fc Improve the 3D graphics settings demo
- New graphics settings:
  - Field of view.
  - Volumetric fog.
- Use Godot's built-in 3D viewport facilities instead of using a SubViewport.
  - This also allows for choosing AMD FidelityFX Super Resolution
    for resolution scaling, but it's not working yet due to a Godot bug.
  - Nearest-neighbor scaling is no longer available. It can be
    reimplemented in Godot core and then exposed in the future.
- Separate MSAA from FXAA settings, as both can be used at the same time.
- Add more quality settings for various effect settings.
- Rename sections and setting names to be more "player-oriented"
  (even if this results in the actual Godot terminology not being
  presented).
- Add performance hints to setting values.
- Add FPS counter and viewport resolution display
  (taking the resolution scale into account).
- Add more objects to the test scene and tweak environment settings.
  - ACES tonemapping is now used.
  - Debanding is now enabled, as this scene requires it to avoid visible
    banding.
  - Make the emissive box less bright to prevent MSAA and FXAA from
    being ineffective on it (due to Godot not supporting correct
    HDR antialiasing).
  - Remove unnecessary DirectionalLight3D, VoxelGI and ReflectionProbe.
2022-04-25 20:06:31 +02:00
Aaron Franke
06af3f0c2c Merge pull request #728 from Calinou/global-illumination-tweak-camera-script
Revert accidental change in camera script in Global illumination demo
2022-04-25 12:44:31 -04:00
Hugo Locurcio
2c244014df Revert accidental change in camera script in Global illumination demo
This also tweaks the font shadow appearance for better visibility.
2022-04-25 18:40:49 +02:00
Aaron Franke
5766a55115 Merge pull request #727 from RedstoneMCPC/kinematic-character-2d
Updated Kinematic Character 2D Demo to Godot 4
2022-04-25 01:35:50 -04:00
RedstoneMCPC / MCPCStudios
ce2bd76d80 Updated Kinematic Character 2D Demo to Godot 4 2022-04-25 15:27:26 +10:00
Aaron Franke
b0c27f044e Merge pull request #726 from RedstoneMCPC/dodge-the-creeps-4.0
Update Dodge the Creeps to 4.0
2022-04-25 00:42:32 -04:00
RedstoneMCPC / MCPCStudios
0d3be3e10f Update Dodge the Creeps to 4.0 2022-04-25 14:39:16 +10:00
Aaron Franke
560ea5a6ce Merge pull request #718 from Calinou/add-global-illumination-demo-2-4.0
Add a global illumination demo (4.0-dev)
2022-04-25 00:04:18 -04:00
Aaron Franke
60457b4d99 Merge pull request #724 from voylin/IconUpdate
New Icons for some of the 4.0-dev demos
2022-04-20 11:10:06 -05:00
Voylin
86be54ae49 New Icons for 4.0-dev demos:
Fixes some of the icons mentioned in #722.
Not sure if they are good enough or not, I'm not an artist in any way.

Changed Icons:
- 2D physics;
- 3D physics;
- Audio device changer;
- Audio mic record;
- GUI Control gallery;
- GUI Pseudo-localization.
Update
2022-04-20 10:31:44 +09:00
Hugo Locurcio
31b962adba Add a global illumination demo
Port of the 3.x global illumination demo, with SDFGI support added
and screen-space lighting effect options added (SSAO, SSIL, or both).

Lightmap options were removed as I couldn't get both indirect-only
and fully baked lightmaps to work for now. They can be readded in the
future.
2022-04-06 17:44:56 +02:00
Aaron Franke
aeba3a05aa Merge pull request #713 from voylin/Add_3D_Settings_Demo
Add a 3D settings demo (Graphical settings) for 4.0-dev
2022-04-05 21:57:04 -05:00
Voylin
9737f8eaa7 Add a 3D settings demo (Graphical settings) for 4.0-dev
Could possible fix #600.
This demo has some of the basic graphical settings that game devs would want. I tried to keep it minimal because it's just a demo. I hope this is sufficient and that there are enough comments explaining everything. Everything works without any bugs or errors.
Small fix

Small script format fix
Small fix


Small fix


Changed readme


Update 3d/3d_settings_menu/project.godot

Co-authored-by: Aaron Franke <arnfranke@yahoo.com>
Fixing many mistakes

Changed folder name
Deleted git files
changed the default size with the project settings variant
Removed some debug info


Added extra features

Changed the layout into sections,
Added some extra settings and features.
Waiting for Calinou to see what he would like to change/add.
Small fixes

Getting the start viewport in ready
2022-04-06 10:49:24 +09:00
Aaron Franke
a0a5b0e7b0 Merge pull request #717 from Faless/mp/4.x_bomber
Port Multiplayer bomber to replication system.
2022-04-05 18:58:48 -05:00
Fabio Alessandrelli
8902903099 Port Multiplayer bomber to replication system. 2022-04-04 11:13:12 +02:00
Aaron Franke
353dc4d2d6 Merge pull request #716 from voylin/Added_run-time_translation_example_to_Translation_Demo
Added run-time translation example for Translation Demo 4.0-dev
2022-04-04 00:12:32 -05:00
Voylin
a8d797cd46 Added run-time translation example
Fixes #647
I added an example of how you can handle translations on runtime.
Small fix
2022-04-03 19:08:44 +09:00
Aaron Franke
3d158cc902 Merge pull request #715 from aaronfranke/pause-4
Pause demo: Showcase new pause features in Godot 4.0
2022-04-03 04:58:00 -05:00
Aaron Franke
9f8a625c8e Pause demo: Showcase new pause features in Godot 4.0 2022-04-03 04:41:45 -05:00
Aaron Franke
3eda0c7fe1 Merge pull request #714 from aaronfranke/gui-in-3d-pause
GUI in 3D: Always process GUI even when the scene tree is paused
2022-04-03 04:16:53 -05:00
Aaron Franke
81fef6072b GUI in 3D: Always process GUI even when the scene tree is paused 2022-04-03 04:14:28 -05:00
Aaron Franke
8fea00cfac Merge pull request #712 from voylin/Update_Bullet_Shower_4.0-dev
Update for Bullet Shower to 4.0-dev
2022-04-03 04:04:06 -05:00
Voylin
960ade79ca Update for Bullet Shower to 4.0-dev
Fixed some issues of things which changed in Godot 4 and I also tried replicating this issue #599 but I guess that is not longer an issue in Godot 4.0? Tested and fixed everything on Godot 4.0alpha5.

Small fix
2022-04-03 18:01:51 +09:00
Aaron Franke
6ac2aeea60 Merge pull request #708 from voylin/Fix_GUI_Input_Mapping_Demo_4.0-dev
Fixed Script Errors for GUI Input Mapping Demo - 4.0-dev
2022-04-03 03:46:34 -05:00
Aaron Franke
e5ceb2d8a5 Merge pull request #706 from voylin/Fix_Scene_Instancing_Demo_4.0-dev
Tested and fixed Scene Instancing Demo for 4.0-dev
2022-04-03 03:41:45 -05:00
Aaron Franke
713dfd064d Merge pull request #711 from voylin/PR_Request_Mic_Record_Demo
Adding settings for mix_rate, stereo and format for Mic Record Demo 4.0-dev
2022-04-03 03:40:45 -05:00
Aaron Franke
188cfda940 Merge pull request #704 from voylin/Fix_Translation_Demo_4.0-dev
Fixed Translation Demo not working in 4.0-dev
2022-04-03 03:39:07 -05:00
Aaron Franke
3eb81eb6a2 Merge pull request #702 from voylin/Fix_Autoload_Demo_4.0-dev
Prepared Autoload(Singletons) demo for Godot 4
2022-04-03 03:36:24 -05:00
Aaron Franke
be59edcb97 Merge pull request #701 from voylin/Fix_Pause_Demo_4.0-dev
Fixing Pause Demo - Object not rotating + 4.0 changes
2022-04-03 03:35:46 -05:00
Aaron Franke
bf4425babb Merge pull request #707 from voylin/Fix_Pong_With_GDScript_4.0-dev
Tested and Fixed Pong with GDScript Demo for 4.0-dev
2022-04-03 03:34:54 -05:00
Voylin
85e7aeec99 Fixed GUI Input Mapping Demo Script Errors for 4.0-dev
Edited the project settings to match the new Godot 4 standard and fixed
the script errors which were making it impossible to run this demo.

Now everything works properly for the 4.0-dev version.

Changed to Vulkan Mobile + Changed argument name

Followed the suggestions of aaronfranke
Changed viewport size
2022-04-03 14:21:54 +09:00
Voylin
8793b7117f Fixing Pause Demo - Object not rotating + 4.0 changes
Fixes #700

Update misc/pause/spinpause.tscn

Co-authored-by: Aaron Franke <arnfranke@yahoo.com>
Update misc/pause/spinpause.tscn

Co-authored-by: Aaron Franke <arnfranke@yahoo.com>
Small fixes
2022-04-03 14:16:28 +09:00
Voylin
7d7c08ad54 Fixing Autoload(Singletons) Demo for Godot 4
Not really any fixing were required, some data changed between versions
when opening and testing everything. Did some changes to the project
settings (2d to canvas_items). Everything works fine without problems.

Change to Vulkan Mobile
2022-04-03 14:11:55 +09:00
Voylin
d4c040b527 Fixed Translation Demo not working in 4.0-dev
Fixes #703

Small fixes

Changing the audio for Spanish.
Vulkan to Vulkan Mobile.
2022-04-03 14:09:25 +09:00
Voylin
5c532525cc Tested and fixed Scene Instancing Demo for 4.0-dev
Everything works! Project settings are updated to Godot 4 new standards.

Small fixes

Vulkan to Vulkan Mobile,
Screen width to 800
2022-04-03 14:05:28 +09:00
Voylin
1b1244d113 Adding settings for mix_rate, stereo and format for Mic Record Demo
small edit

Adding settings for mix_rate, stereo and format for Mic Record Demo

Adding settings for mix_rate, stereo and format for Mic Record Demo

small edit

Adding settings for mix_rate, stereo and format for Mic Record Demo

small edit

Adding settings for mix_rate, stereo and format for Mic Record Demo

small edit

Adding settings for mix_rate, stereo and format for Mic Record Demo

small edit

Adding settings for mix_rate, stereo and format for Mic Record Demo

small edit

Adding settings for mix_rate, stereo and format for Mic Record Demo

Fixing project settings
Small fixes

Vulkan to Vulkan Mobile,
Changed window size.
2022-04-03 14:00:26 +09:00
Voylin
27af28d02c Tested and fixed Pong With GDScript for 4.0-dev
Made the usual changes to the project settings and tested to see if
everything works.

Everything works fine!

Small fixes

Changed to Vulkan Mobile.
Changed viewport size.
2022-04-03 13:56:21 +09:00
Aaron Franke
0fbb2b99b0 Merge pull request #705 from voylin/Fix_Control_Gallery_Demo_4.0-dev
Fixes layout, nodes and theming for Control Gallery Demo - 4.0 dev
2022-04-02 23:36:55 -05:00
Voylin
861638b9d0 Fixes Control Gallery Demo for 4.0-dev
A lot of nodes have changed which made this demo not work properly
anymore, nor display everything properly anymore. Everything is looking
like it did before and all buttons are working again.

There is however this slight bug in the engine right now which makes it
not possible to press menu buttons or option buttons if the window is
not the same as the content_scale_size of the main window. (By example
when you resize the window)
This is because the hitboxes for those buttons don't get notified of the
change in screen size which makes them stay in the same place where they
would be when resizing the window.

For the rest everything is working perfectly now, everything also has
the new Godot 4 default theme style.

Fixes Control Gallery Demo for 4.0-dev small edit

Forgot to center one of the labels + updated screenshot

Changing Vulkan to Vulkan Mobile
2022-04-03 13:29:20 +09:00
voylin
e6c19ff4a9 Fix scaling not working after resizing the window (#699) 2022-03-29 19:28:58 -05:00
Aaron Franke
2ff9d17f46 Merge pull request #696 from aaronfranke/gd4-3d
Update several 3D demos to Godot 4
2022-03-28 01:49:39 -05:00
Aaron Franke
5566c748c2 Update several 3D demos to Godot 4 2022-03-28 01:41:27 -05:00
Aaron Franke
730b2f30a0 Merge pull request #695 from aaronfranke/gd4-rigidbody-sname
Rename RigidBody -> RigidDynamicBody and use StringName literals
2022-03-28 01:31:38 -05:00
Aaron Franke
cb52878006 Use StringName literals with Input methods 2022-03-27 19:19:09 -05:00
Aaron Franke
ab0816a44e Rename RigidBody -> RigidDynamicBody 2022-03-27 19:06:05 -05:00
Aaron Franke
f2918178d7 Merge pull request #694 from aaronfranke/gd4-voxel
Update Voxel demo to Godot 4
2022-03-27 18:25:43 -05:00
Aaron Franke
b9ad7a4ac3 Merge pull request #693 from aaronfranke/gd4-audio
Update Audio demos to Godot 4
2022-03-27 18:25:22 -05:00
Aaron Franke
981359289c Merge pull request #692 from aaronfranke/gd4-viewport
Update Viewport demos to Godot 4
2022-03-27 18:24:43 -05:00
Aaron Franke
37e7ec0985 Update Voxel demo to Godot 4 2022-03-27 00:19:33 -05:00
Aaron Franke
0e2c5ad182 Update Audio demos to Godot 4 2022-03-26 20:48:33 -05:00
Aaron Franke
3e3a9e7b6e Update Viewport demos to Godot 4 2022-03-26 19:29:53 -05:00
Aaron Franke
27e4e36e03 Merge pull request #691 from aaronfranke/convert
Convert demos to Godot 4 using regular expressions in a script
2022-03-26 16:39:10 -05:00
Aaron Franke
bbe50fc9da Convert demos to Godot 4 using regular expressions in a script 2022-03-26 16:09:10 -05:00
Aaron Franke
410d783126 Merge pull request #690 from godotengine/master
Merge the `master` branch into the `4.0-dev` branch
2022-03-26 15:19:30 -05:00
Aaron Franke
f47d0909cc Merge pull request #658 from Calinou/add-volumetric-fog-demo
Add a volumetric fog demo
2022-03-26 15:12:05 -05:00
Aaron Franke
907b8a2f42 Make volumetric fog demo work with Godot master 2022-03-26 2022-03-26 15:05:58 -05:00
Aaron Franke
1923153f46 Merge pull request #670 from jonbonazza/update-websocket-minimal
feat: update websocket-minimal to gdscript2.0
2022-03-26 05:06:29 -05:00
Aaron Franke
5875f2a320 Merge pull request #637 from angad-k/pseudolocalization
Add pseudolocalization demo
2022-03-26 05:04:14 -05:00
Aaron Franke
895749024a Merge pull request #538 from bruvzg/ctl_demos
[Complex Text Layouts] Add BiDi and UI mirroring demos.
2022-03-26 05:03:08 -05:00
Jon Bonazza
d047c2de5b feat: update websocket-minimal to gdscript2.0
Update the networking/websocket-minimal project to use gdscript 2.0.
2021-12-07 10:28:40 -08:00
Camille Mohr-Daurat
f30f16b8ce Merge pull request #638 from nekomatata/physics-tests-4.0-conversion
Convert physics test projects to 4.0
2021-12-07 09:21:00 -07:00
PouleyKetchoupp
52f5b2e5d2 Convert physics test projects to 4.0 2021-12-07 09:19:28 -07:00
Hugo Locurcio
31cc886d07 Add a volumetric fog demo
This is an example of Godot's volumetric fog capabilities
with the Vulkan renderer.

Showcased features are:

- Positive/negative density volumes that affect albedo (incoming light)
  and emission.
- Box/ellipsoid shapes, height falloff, and density modulation using a
  3D texture.
- Temporal reprojection for greater stability and avoiding flickering.
  - The difference is demonstrated with a moving fog volume.
- Global density adjustment. With FogVolume nodes that have a
  positive density, it's possible to apply volumetric fog only in
  specific areas.
2021-10-31 22:02:48 +01:00
bruvzg
9a2889b35b [Complex Text Layouts] Add BiDi and font features demo. 2021-10-28 10:18:15 +03:00
bruvzg
44daa8ac89 [Complex Text Layouts] Add UI mirroring demo. 2021-10-28 10:18:15 +03:00
Angad Kambli
e44e3521b6 add pseudolocalization demo 2021-08-09 12:18:35 +05:30
3952 changed files with 133382 additions and 71334 deletions

21
.clang-format Normal file
View File

@@ -0,0 +1,21 @@
BasedOnStyle: LLVM
AlignAfterOpenBracket: DontAlign
AlignOperands: DontAlign
AlignTrailingComments:
Kind: Never
OverEmptyLines: 0
AllowAllParametersOfDeclarationOnNextLine: false
AllowShortFunctionsOnASingleLine: Inline
BreakConstructorInitializers: AfterColon
ColumnLimit: 0
ContinuationIndentWidth: 8
IndentCaseLabels: true
IndentWidth: 4
InsertBraces: true
KeepEmptyLinesAtTheStartOfBlocks: false
RemoveSemicolon: true
SpacesInLineCommentPrefix:
Minimum: 0 # We want a minimum of 1 for comments, but allow 0 for disabled code.
Maximum: -1
TabWidth: 4
UseTab: Always

View File

@@ -1,23 +1,7 @@
<!--
Only submit a pull request if all of the following conditions are met:
Please target the `master` branch in priority.
PRs can target `3.x` if the same change was done in `master`, or is not relevant there.
* It must work with the latest Godot version of the branch you're submitting to.
* It must follow all of the Godot style guides, including the GDScript
style guide and the C# style guide.
* The demo should not be overcomplicated. Simplicity is usually preferred.
* If you are submitting a new demo, please ensure that it includes a
README file similar to the other demos.
* If you are submitting a copy of a demo translated to C# etc:
* Please ensure that there is a good reason to have this demo translated.
We don't want to have multiple copies of every single project.
* Please ensure that the code mirrors the original closely.
* In the project.godot file and in the README, include "with C#" etc in
the title, and also include a link to the original in the README.
Relevant fixes are cherry-picked for stable branches as needed by maintainers.
You can mention in the description if the change is compatible with `3.x`.
-->

View File

@@ -1,23 +1,41 @@
[preset.0]
name="HTML5"
platform="HTML5"
name="Web"
platform="Web"
runnable=true
advanced_options=false
dedicated_server=false
custom_features=""
export_filter="all_resources"
include_filter="*.json"
include_filter=""
exclude_filter=""
export_path=""
script_export_mode=1
script_encryption_key=""
encryption_include_filters=""
encryption_exclude_filters=""
encrypt_pck=false
encrypt_directory=false
script_export_mode=2
[preset.0.options]
custom_template/debug=""
custom_template/release=""
variant/export_type=0
variant/extensions_support=false
variant/thread_support=true
vram_texture_compression/for_desktop=true
vram_texture_compression/for_mobile=false
vram_texture_compression/for_mobile=true
html/export_icon=true
html/custom_html_shell=""
html/head_include=""
html/full_window_size=true
html/canvas_resize_policy=2
html/focus_canvas_on_start=true
html/experimental_virtual_keyboard=true
progressive_web_app/enabled=true
progressive_web_app/ensure_cross_origin_isolation_headers=true
progressive_web_app/offline_page=""
progressive_web_app/display=0
progressive_web_app/orientation=1
progressive_web_app/icon_144x144=""
progressive_web_app/icon_180x180=""
progressive_web_app/icon_512x512=""
progressive_web_app/background_color=Color(0, 0, 0, 1)

View File

@@ -1,20 +1,38 @@
<!-- The list of demos will be inserted above by the CI process. -->
</ul>
<h2>Unavailable demos</h2>
<ul>
<li><code>2d/hdr/</code>: Not supported on HTML5 yet.</li>
<li><code>3d/global_illumination/</code>: Not supported on HTML5 yet (freezes the browser).</li>
<li><code>3d/voxel/</code>: Not supported on HTML5 yet.</li>
<li><code>audio/device_changer/</code>: Not supported on HTML5 due to browser limitations.</li>
<li><code>loading/background_load/</code>: Not supported on HTML5 yet.</li>
<li><code>loading/multiple_threads_loading/</code>: Not supported on HTML5 yet.</li>
<li><code>loading/threads/</code>: Not supported on HTML5 yet.</li>
<li><code>misc/matrix_transform/</code>: Results are only visible in the editor.</li>
<li><code>mobile/android_iap/</code>: Only relevant on native Android.</li>
<li><code>mobile/sensors/</code>: Not supported on HTML5 yet.</li>
<li><code>mono/*/</code>: Not available yet (requires Mono-enabled HTML5 build).</li>
<li><code>networking/*/</code>: Doesn't make sense to be hosted on a static host, as the server must be hosted on the same origin due to the browser's same-origin policy.</li>
<li><code>plugins/*/</code>: Only effective within the editor.</li>
<ul class="unsupported-demos">
<li><code>2d/glow</code>: Not supported on the Compatibility rendering method (which the web platform always uses).</li>
<li><code>2d/navigation_mesh_chunks</code>: Relies on debug-only drawing functionality which is not available in projects exported in release mode.</li>
<li><code>2d/physics_tests</code>: Relies on debug-only drawing functionality which is not available in projects exported in release mode.</li>
<li><code>3d/labels_and_texts</code>: Does not export in headless mode due to an engine bug (font importing infinite loop).</li>
<li><code>3d/decals</code>: Not supported on the Compatibility rendering method (which the web platform always uses).</li>
<li><code>3d/ik</code>: Demo is not fully ported to Godot 4 yet (even though the feature works on the web).</li>
<li><code>3d/navigation_mesh_chunks</code>: Relies on debug-only drawing functionality which is not available in projects exported in release mode.</li>
<li><code>3d/occlusion_culling_mesh_lod</code>: Occlusion culling is disabled by default in web builds to decrease binary size.</li>
<li><code>3d/particles</code>: Demo mostly showcases features that are not available in Compatibility (which the web platform always uses).</li>
<li><code>3d/physical_light_camera_units</code>: Demo is not tuned for the Compatibility rendering method (which the web platform always uses).</li>
<li><code>3d/physics_tests</code>: Relies on debug-only drawing functionality which is not available in projects exported in release mode.</li>
<li><code>3d/variable_rate_shading</code>: Not supported on the Compatibility rendering method (which the web platform always uses)</li>
<li><code>3d/volumetric_fog</code>: Not supported on the Compatibility rendering method (which the web platform always uses)</li>
<li><code>3d/voxel</code>: Freezes after a few seconds of gameplay due to web platform-specific threading issues.</li>
<li><code>audio/bpm_sync</code>: Not functional on the web platform due to differences in the audio playback implementation.</li>
<li><code>audio/device_changer</code>: Not relevant for the web platform, as the web browser always chooses the audio output device.</li>
<li><code>audio/midi_piano</code>: Not functional on the web platform due to differences in the audio playback implementation.</li>
<li><code>audio/spectrum</code>: Not functional on the web platform due to differences in the audio playback implementation.</li>
<li><code>compute/*</code>: Not supported on the Compatibility rendering method (which the web platform always uses).</li>
<li><code>gui/msdf_font</code>: Does not export in headless mode due to an engine bug (font importing crashes).</li>
<li><code>gui/translation</code>: Does not export in headless mode due to an engine bug (font importing crashes).</li>
<li><code>loading/runtime_save_load</code>: Native filesystem access is not available on the web platform.</li>
<li><code>misc/compute_shader_heightmap</code>: Not supported on the Compatibility rendering method (which the web platform always uses).</li>
<li><code>misc/large_world_coordinates</code>: Not supported on the Compatibility rendering method (which the web platform always uses).</li>
<li><code>misc/matrix_transform</code>: Results are only visible in the editor.</li>
<li><code>mobile/android_iap</code>: Only relevant on native Android.</li>
<li><code>mobile/sensors</code>: Not supported on the web platform.</li>
<li><code>mono/*</code>: Not available yet (requires Mono-enabled HTML5 build).</li>
<li><code>networking/*</code>: Doesn't make sense to be hosted on a static host, as the server must be hosted on the same origin due to the browser's same-origin policy.</li>
<li><code>plugins/*</code>: Only effective within the editor.</li>
<li><code>xr/openxr_*</code>: Not functional on the web platform, as these demos are not designed for WebXR.</li>
</ul>
</body>
</html>

View File

@@ -4,13 +4,15 @@
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Godot demos exported to HTML5</title>
<title>Official Godot demos exported to Web</title>
<style>
:root {
--background-color: #fff;
--text-color: #222;
--link-color: hsl(220, 100%, 45%);
--link-visited-color: hsl(270, 100%, 55%);
--link-underline-color: hsla(220, 100%, 45%, 0.3);
--link-underline-visited-color: hsla(270, 100%, 45%, 0.3);
}
@media (prefers-color-scheme: dark) {
@@ -18,7 +20,9 @@
--background-color: #222;
--text-color: #eee;
--link-color: hsl(200, 100%, 70%);
--link-visited-color: hsl(250, 100%, 80%);
--link-underline-color: hsla(200, 100%, 70%, 0.3);
--link-underline-visited-color: hsla(250, 100%, 70%, 0.3);
}
}
@@ -52,6 +56,11 @@
text-decoration-thickness: 0.125rem;
}
a:visited {
color: var(--link-visited-color);
text-decoration-color: var(--link-visited-color);
}
a:hover {
filter: brightness(117.5%);
}
@@ -88,6 +97,9 @@
margin: 20px 10px;
}
.unsupported-demos li {
margin-bottom: 1.5rem;
}
</style>
</head>
@@ -96,21 +108,21 @@
<p>
This page lists
<a href="https://github.com/godotengine/godot-demo-projects">official Godot demo projects</a>
exported to HTML5 for testing purposes. These projects are deployed automatically
exported to the web for testing purposes. These projects are deployed automatically
on every commit on the <code>master</code> branch of the repository.
</p>
<p>
The HTML5 exports on this page are provided for demonstration purposes only.
Some of these demos may not function or render correctly on HTML5,
The web exports on this page are provided for demonstration purposes only.
Some of these demos may not function or render correctly on the web platform,
especially on mobile devices.
For best performance, it's recommended to
<a href="https://godotengine.org/download">download</a> a native editor
<a href="https://godotengine.org/download/">download</a> a native editor
and run the demo project by importing its files in the project manager.
</p>
<p>
See the
<a href="https://docs.godotengine.org/en/stable/getting_started/workflow/export/exporting_for_web.html">Exporting for the Web</a>
documentation for information on exporting your own projects to HTML5.
<a href="https://docs.godotengine.org/en/stable/tutorials/export/exporting_for_web.html">Exporting for the Web</a>
documentation for information on exporting your own projects to the web.
</p>
<h2>List of demos</h2>

28
.github/workflows/check_urls.yml vendored Normal file
View File

@@ -0,0 +1,28 @@
name: 🌐 Check URLs
on: [push, pull_request]
jobs:
check-urls:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v6
- name: Restore lychee cache
uses: actions/cache@v4
with:
path: .lycheecache
key: cache-lychee-${{ github.sha }}
restore-keys: cache-lychee-
- name: Run lychee
uses: lycheeverse/lychee-action@v2
with:
args: >
--no-progress
--cache
--max-cache-age 1d
"**/*.md" "**/*.gd" "**/*.cs" "**/*.tscn" "**/*.tres" "**/*.html"
- name: Fail if there were link errors
run: exit ${{ steps.lc.outputs.exit_code }}

128
.github/workflows/export_web.yml vendored Normal file
View File

@@ -0,0 +1,128 @@
name: Export projects to Web and deploy to GitHub Pages
on:
push:
branches:
- master
env:
GODOT_VERSION: 4.5.1
jobs:
export-html5:
if: github.repository == 'godotengine/godot-demo-projects'
name: Export projects to Web and deploy to GitHub Pages
runs-on: ubuntu-24.04
container:
image: barichello/godot-ci:4.5.1
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup
run: |
mkdir -p ~/.local/share/godot/export_templates/
mv /root/.local/share/godot/export_templates/$GODOT_VERSION.stable ~/.local/share/godot/export_templates/$GODOT_VERSION.stable
- name: Export projects to Web
run: |
apt-get update -qq && apt-get install -qqq imagemagick
# Don't export Mono demos (not supported yet), demos that can't be run in Web
# since they're platform-specific or demos that are currently broken in Web.
# Remember to update `.github/dist/footer.html` when updating the list of excluded demos.
rm -rf \
2d/glow/ \
2d/navigation_mesh_chunks/ \
2d/physics_tests/ \
3d/labels_and_texts/ \
3d/decals/ \
3d/ik/ \
3d/navigation_mesh_chunks/ \
3d/occlusion_culling_mesh_lod/ \
3d/particles/ \
3d/physical_light_camera_units/ \
3d/physics_tests/ \
3d/variable_rate_shading/ \
3d/volumetric_fog/ \
3d/voxel/ \
audio/bpm_sync/ \
audio/device_changer/ \
audio/midi_piano/ \
audio/spectrum/ \
compute/ \
gui/msdf_font/ \
gui/translation/ \
loading/runtime_save_load \
misc/compute_shader_heightmap \
misc/large_world_coordinates/ \
misc/matrix_transform/ \
mobile/android_iap/ \
mobile/sensors/ \
mono/ \
networking/ \
plugins/ \
xr/openxr_character_centric_movement \
xr/openxr_composition_layers \
xr/openxr_hand_tracking_demo \
xr/openxr_origin_centric_movement
for panorama in 3d/material_testers/backgrounds/*.hdr; do
# Decrease the resolution to get below the 100 MB PCK size limit.
# Otherwise, the website can't be deployed as files larger than 100 MB
# can't be pushed to GitHub.
mogrify -resize 66.667% "$panorama"
done
BASEDIR="$PWD"
# Use absolute paths so that we can `cd` without having to go back to the parent directory manually.
for demo in */*/; do
echo ""
echo ""
echo "================================================================================"
echo "Exporting demo $demo..."
echo "================================================================================"
mkdir -p "$BASEDIR/.github/dist/$demo"
cd "$BASEDIR/$demo"
# Copy an export template preset file configured for Web exporting.
# This way, we don't have to commit `export_presets.cfg` for each project.
cp "$BASEDIR/.github/dist/export_presets.cfg" .
# Enable ETC2 texture importing, which is disabled by default (but required for web exports to work on mobile platforms).
echo "[rendering]\n\ntextures/vram_compression/import_etc2_astc=true" >> project.godot
# Enable WebXR Polyfill and WebXR Layers Polyfill for the WebXR demo.
if [ "$demo" == "xr/webxr/" ]; then
sed -i 's~^html/head_include=""$~html/head_include="<script src=\\"https://cdn.jsdelivr.net/npm/webxr-polyfill@latest/build/webxr-polyfill.min.js\\"></script>\n<script>\nvar polyfill = new WebXRPolyfill();\n</script>\n<script src=\\"https://cdn.jsdelivr.net/npm/webxr-layers-polyfill@latest/build/webxr-layers-polyfill.min.js\\"></script>\n<script>\nvar layersPolyfill = new WebXRLayersPolyfill();\n</script>"~g' export_presets.cfg
fi
godot --verbose --headless --export-release "Web" "$BASEDIR/.github/dist/$demo/index.html"
# Replace the WASM file with a symbolic link to avoid duplicating files in the pushed branch.
# (WASM files are identical across projects, but not PCK or HTML/JavaScript files.)
mv -f "$BASEDIR/.github/dist/$demo/index.wasm" "$BASEDIR/.github/dist/index.wasm"
# The symlink must be relative as it needs to point to a file within the pushed repository.
ln -s "../../index.wasm" "$BASEDIR/.github/dist/$demo/index.wasm"
# Append the demo to the list of demos for the website.
PROJECT_NAME=$(cat project.godot | grep "config/name" | cut -d '"' -f 2 | tr -d "\n")
echo "<li><a href='$demo'><img width="64" height="64" src="$demo/index.icon.png" alt=""><p>$PROJECT_NAME</p></a></li>" >> "$BASEDIR/.github/dist/demos.html"
done
cat "$BASEDIR/.github/dist/header.html" "$BASEDIR/.github/dist/demos.html" "$BASEDIR/.github/dist/footer.html" > "$BASEDIR/.github/dist/index.html"
# Clean up files that don't need to be deployed.
rm -f "$BASEDIR/.github/dist/header.html" "$BASEDIR/.github/dist/demos.html" "$BASEDIR/.github/dist/footer.html" "$BASEDIR/.github/dist/export_presets.cfg"
# Installing rsync is needed in order to deploy to GitHub Pages. Without it, the build will fail.
- name: Install rsync 📚
run: |
apt-get update -qq && apt-get install -qqq rsync
- name: Deploy to GitHub Pages 🚀
uses: JamesIves/github-pages-deploy-action@releases/v4
with:
# The folder the action should deploy.
folder: .github/dist
# Artifacts are large; don't keep the branch's history.
single-commit: true

View File

@@ -7,7 +7,7 @@ jobs:
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v5
uses: actions/checkout@v6
- name: Install dependencies
run: |

7
.gitignore vendored
View File

@@ -20,3 +20,10 @@ mono_crash.*.json
.directory
.DS_Store
*~
*.blend1
# Jetbrains IDE files
.idea/
# Ignore addon plugins
3d/sprite3d/addons

31
.lycheeignore Normal file
View File

@@ -0,0 +1,31 @@
# Don't read Godot's own URL schemes as web URLs.
user:\/\/.*
res:\/\/.*
uid:\/\/.*
# Don't read WebSockets or TCP URLs as web URLs.
ws(s?):\/\/.*
tcp:\/\/.*
# Security checks prevent checking the URLs of these websites automatically,
# typically returning 403 errors.
.*asecuritysite\.com.*
.*intel\.com.*
.*reddit\.com.*
# Don't check URLs from these websites due to frequent rate limits (error 429) or timeouts.
.*adobe\.com.*
.*gamedevartisan\.com.*
.*github\.com.*
.*gnu\.org.*
.*loopit\.dk.*
.*meta\.com.*
.*shadertoy\.com.*
.*sourceforge\.io.*
# Not a valid URL with the GET method, which lychee always sends.
# Mentioned in the class reference.
.*httpbin\.org\/post
# Class reference mentions `example.com/index.php` in an example, which is 404.
.*example\.com.*

View File

@@ -3,6 +3,6 @@
These demos are all 2D, but otherwise do not have a common theme.
Languages: Most have GDScript, some have
[GDSL](https://docs.godotengine.org/en/latest/tutorials/shaders/shader_reference/shading_language.html)
[Godot shader language](https://docs.godotengine.org/en/latest/tutorials/shaders/shader_reference/shading_language.html)
Renderers: 4 of them are GLES 3, but most are GLES 2
Renderers: Glow for 2D and Physics Platformer use Forward+, 2D Particles uses Mobile, and the rest use Compatibility

View File

@@ -9,9 +9,9 @@ in the documentation for more information.
Language: GDScript
Renderer: GLES 2
Renderer: Compatibility
Check out this demo on the asset library: https://godotengine.org/asset-library/asset/887
Check out this demo on the asset library: https://godotengine.org/asset-library/asset/2711
## Screenshots

View File

@@ -1,8 +1,9 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/bullet.png-ff1424653e10246c11e3724e402c519e.stex"
type="CompressedTexture2D"
uid="uid://b1yd0wl8kt2i7"
path="res://.godot/imported/bullet.png-ff1424653e10246c11e3724e402c519e.ctex"
metadata={
"vram_texture": false
}
@@ -10,26 +11,30 @@ metadata={
[deps]
source_file="res://bullet.png"
dest_files=[ "res://.import/bullet.png-ff1424653e10246c11e3724e402c519e.stex" ]
dest_files=["res://.godot/imported/bullet.png-ff1424653e10246c11e3724e402c519e.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/uastc_level=0
compress/rdo_quality_loss=0.0
compress/hdr_compression=1
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
process/normal_map_invert_y=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1

View File

@@ -1,5 +1,5 @@
extends Node2D
# This demo is an example of controling a high number of 2D objects with logic
# This demo is an example of controlling a high number of 2D objects with logic
# and collision without using nodes in the scene. This technique is a lot more
# efficient than using instancing and nodes, but requires more programming and
# is less visual. Bullets are managed together in the `bullets.gd` script.
@@ -8,86 +8,81 @@ const BULLET_COUNT = 500
const SPEED_MIN = 20
const SPEED_MAX = 80
const bullet_image = preload("res://bullet.png")
const bullet_image := preload("res://bullet.png")
var bullets = []
var shape
var bullets := []
var shape := RID()
class Bullet:
var position = Vector2()
var speed = 1.0
# The body is stored as a RID, which is an "opaque" way to access resources.
var position := Vector2()
var speed := 1.0
# The body is stored as an RID, which is an "opaque" way to access resources.
# With large amounts of objects (thousands or more), it can be significantly
# faster to use RIDs compared to a high-level approach.
var body = RID()
var body := RID()
func _ready():
randomize()
shape = Physics2DServer.circle_shape_create()
func _ready() -> void:
shape = PhysicsServer2D.circle_shape_create()
# Set the collision shape's radius for each bullet in pixels.
Physics2DServer.shape_set_data(shape, 8)
PhysicsServer2D.shape_set_data(shape, 8)
for _i in BULLET_COUNT:
var bullet = Bullet.new()
# Give each bullet its own speed.
bullet.speed = rand_range(SPEED_MIN, SPEED_MAX)
bullet.body = Physics2DServer.body_create()
var bullet := Bullet.new()
# Give each bullet its own random speed.
bullet.speed = randf_range(SPEED_MIN, SPEED_MAX)
bullet.body = PhysicsServer2D.body_create()
Physics2DServer.body_set_space(bullet.body, get_world_2d().get_space())
Physics2DServer.body_add_shape(bullet.body, shape)
PhysicsServer2D.body_set_space(bullet.body, get_world_2d().get_space())
PhysicsServer2D.body_add_shape(bullet.body, shape)
# Don't make bullets check collision with other bullets to improve performance.
# Their collision mask is still configured to the default value, which allows
# bullets to detect collisions with the player.
Physics2DServer.body_set_collision_layer(bullet.body, 0)
PhysicsServer2D.body_set_collision_mask(bullet.body, 0)
# Place bullets randomly on the viewport and move bullets outside the
# play area so that they fade in nicely.
bullet.position = Vector2(
rand_range(0, get_viewport_rect().size.x) + get_viewport_rect().size.x,
rand_range(0, get_viewport_rect().size.y)
)
var transform2d = Transform2D()
randf_range(0, get_viewport_rect().size.x) + get_viewport_rect().size.x,
randf_range(0, get_viewport_rect().size.y)
)
var transform2d := Transform2D()
transform2d.origin = bullet.position
Physics2DServer.body_set_state(bullet.body, Physics2DServer.BODY_STATE_TRANSFORM, transform2d)
PhysicsServer2D.body_set_state(bullet.body, PhysicsServer2D.BODY_STATE_TRANSFORM, transform2d)
bullets.push_back(bullet)
func _process(_delta):
func _process(_delta: float) -> void:
# Order the CanvasItem to update every frame.
update()
queue_redraw()
func _physics_process(delta):
var transform2d = Transform2D()
var offset = get_viewport_rect().size.x + 16
for bullet in bullets:
func _physics_process(delta: float) -> void:
var transform2d := Transform2D()
var offset := get_viewport_rect().size.x + 16
for bullet: Bullet in bullets:
bullet.position.x -= bullet.speed * delta
if bullet.position.x < -16:
# The bullet has left the screen; move it back to the right.
# Move the bullet back to the right when it left the screen.
bullet.position.x = offset
transform2d.origin = bullet.position
Physics2DServer.body_set_state(bullet.body, Physics2DServer.BODY_STATE_TRANSFORM, transform2d)
PhysicsServer2D.body_set_state(bullet.body, PhysicsServer2D.BODY_STATE_TRANSFORM, transform2d)
# Instead of drawing each bullet individually in a script attached to each bullet,
# we are drawing *all* the bullets at once here.
func _draw():
var offset = -bullet_image.get_size() * 0.5
for bullet in bullets:
func _draw() -> void:
var offset := -bullet_image.get_size() * 0.5
for bullet: Bullet in bullets:
draw_texture(bullet_image, bullet.position + offset)
# Perform cleanup operations (required to exit without error messages in the console).
func _exit_tree():
for bullet in bullets:
Physics2DServer.free_rid(bullet.body)
func _exit_tree() -> void:
for bullet: Bullet in bullets:
PhysicsServer2D.free_rid(bullet.body)
Physics2DServer.free_rid(shape)
PhysicsServer2D.free_rid(shape)
bullets.clear()

View File

@@ -0,0 +1 @@
uid://e3fsq0i746o1

View File

@@ -1,8 +1,9 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/face_happy.png-38d387d31ec13459f749c93ce3d75d80.stex"
type="CompressedTexture2D"
uid="uid://c33jd3nwdqtb4"
path="res://.godot/imported/face_happy.png-38d387d31ec13459f749c93ce3d75d80.ctex"
metadata={
"vram_texture": false
}
@@ -10,26 +11,30 @@ metadata={
[deps]
source_file="res://face_happy.png"
dest_files=[ "res://.import/face_happy.png-38d387d31ec13459f749c93ce3d75d80.stex" ]
dest_files=["res://.godot/imported/face_happy.png-38d387d31ec13459f749c93ce3d75d80.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/uastc_level=0
compress/rdo_quality_loss=0.0
compress/hdr_compression=1
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
process/normal_map_invert_y=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1

View File

@@ -1,8 +1,9 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/face_sad.png-0ac7165eab24f595aba17a746a66c550.stex"
type="CompressedTexture2D"
uid="uid://b63ok8dbyysfs"
path="res://.godot/imported/face_sad.png-0ac7165eab24f595aba17a746a66c550.ctex"
metadata={
"vram_texture": false
}
@@ -10,26 +11,30 @@ metadata={
[deps]
source_file="res://face_sad.png"
dest_files=[ "res://.import/face_sad.png-0ac7165eab24f595aba17a746a66c550.stex" ]
dest_files=["res://.godot/imported/face_sad.png-0ac7165eab24f595aba17a746a66c550.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/uastc_level=0
compress/rdo_quality_loss=0.0
compress/hdr_compression=1
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
process/normal_map_invert_y=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

View File

@@ -1,35 +0,0 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://icon.png"
dest_files=[ "res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
process/normal_map_invert_y=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0

BIN
2d/bullet_shower/icon.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.9 KiB

View File

@@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://44incao8gryo"
path="res://.godot/imported/icon.webp-e94f9a68b0f625a567a797079e4d325f.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://icon.webp"
dest_files=["res://.godot/imported/icon.webp-e94f9a68b0f625a567a797079e4d325f.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/uastc_level=0
compress/rdo_quality_loss=0.0
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1

View File

@@ -1,33 +1,37 @@
extends Node2D
# This demo is an example of controling a high number of 2D objects with logic
# This demo is an example of controlling a high number of 2D objects with logic
# and collision without using nodes in the scene. This technique is a lot more
# efficient than using instancing and nodes, but requires more programming and
# is less visual. Bullets are managed together in the `bullets.gd` script.
# The number of bullets currently touched by the player.
var touching = 0
## The number of bullets currently touched by the player.
var touching: int = 0
onready var sprite = $AnimatedSprite
@onready var sprite: AnimatedSprite2D = $AnimatedSprite2D
func _ready():
func _ready() -> void:
# The player follows the mouse cursor automatically, so there's no point
# in displaying the mouse cursor.
Input.set_mouse_mode(Input.MOUSE_MODE_HIDDEN)
func _input(event):
if event is InputEventMouseMotion:
position = event.position - Vector2(0, 16)
func _input(input_event: InputEvent) -> void:
# Getting the movement of the mouse so the sprite can follow its position.
if input_event is InputEventMouseMotion:
position = input_event.position - Vector2(0, 16)
func _on_body_shape_entered(_body_id, _body, _body_shape, _local_shape):
func _on_body_shape_entered(_body_id: RID, _body: Node2D, _body_shape_index: int, _local_shape_index: int) -> void:
# Player got touched by a bullet so sprite changes to sad face.
touching += 1
if touching >= 1:
sprite.frame = 1
func _on_body_shape_exited(_body_id, _body, _body_shape, _local_shape):
func _on_body_shape_exited(_body_id: RID, _body: Node2D, _body_shape_index: int, _local_shape_index: int) -> void:
touching -= 1
# When non of the bullets are touching the player,
# sprite changes to happy face.
if touching == 0:
sprite.frame = 0

View File

@@ -0,0 +1 @@
uid://eu1k1ulu68o2

View File

@@ -6,35 +6,31 @@
; [section] ; section goes between []
; param=value ; assign values to parameters
config_version=4
_global_script_classes=[ ]
_global_script_class_icons={
}
config_version=5
[application]
config/name="Bullet Shower"
config/description="Demonstrates how to manage large amounts of objects efficiently using low-level Servers."
config/tags=PackedStringArray("2d", "demo", "official", "performance")
run/main_scene="res://shower.tscn"
config/icon="res://icon.png"
config/features=PackedStringArray("4.5")
config/icon="res://icon.webp"
[debug]
gdscript/warnings/untyped_declaration=1
[display]
window/dpi/allow_hidpi=true
window/stretch/mode="2d"
window/stretch/mode="canvas_items"
window/stretch/aspect="expand"
[physics]
[layer_names]
common/enable_pause_aware_picking=true
2d/cell_size=64
2d_physics/layer_1="Player"
[rendering]
quality/driver/driver_name="GLES2"
quality/intended_usage/framebuffer_allocation=0
quality/intended_usage/framebuffer_allocation.mobile=0
vram_compression/import_etc=true
vram_compression/import_etc2=false
environment/default_clear_color=Color( 0.133333, 0.133333, 0.2, 1 )
renderer/rendering_method="gl_compatibility"
renderer/rendering_method.mobile="gl_compatibility"

View File

@@ -1,34 +1,40 @@
[gd_scene load_steps=7 format=2]
[gd_scene load_steps=7 format=3 uid="uid://dxq1b4cth265d"]
[ext_resource path="res://bullets.gd" type="Script" id=2]
[ext_resource path="res://face_happy.png" type="Texture" id=3]
[ext_resource path="res://face_sad.png" type="Texture" id=4]
[ext_resource path="res://player.gd" type="Script" id=5]
[ext_resource type="Script" uid="uid://e3fsq0i746o1" path="res://bullets.gd" id="2"]
[ext_resource type="Texture2D" uid="uid://c33jd3nwdqtb4" path="res://face_happy.png" id="3"]
[ext_resource type="Texture2D" uid="uid://b63ok8dbyysfs" path="res://face_sad.png" id="4"]
[ext_resource type="Script" uid="uid://eu1k1ulu68o2" path="res://player.gd" id="5"]
[sub_resource type="SpriteFrames" id=1]
animations = [ {
"frames": [ ExtResource( 3 ), ExtResource( 4 ) ],
[sub_resource type="SpriteFrames" id="1"]
animations = [{
"frames": [{
"duration": 1.0,
"texture": ExtResource("3")
}, {
"duration": 1.0,
"texture": ExtResource("4")
}],
"loop": true,
"name": "default",
"name": &"default",
"speed": 5.0
} ]
}]
[sub_resource type="CircleShape2D" id=2]
[sub_resource type="CircleShape2D" id="2"]
radius = 27.0
[node name="Shower" type="Node2D"]
[node name="Bullets" type="Node2D" parent="."]
script = ExtResource( 2 )
script = ExtResource("2")
[node name="Player" type="Area2D" parent="."]
script = ExtResource( 5 )
script = ExtResource("5")
[node name="AnimatedSprite" type="AnimatedSprite" parent="Player"]
frames = SubResource( 1 )
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="Player"]
sprite_frames = SubResource("1")
[node name="CollisionShape2D" type="CollisionShape2D" parent="Player"]
shape = SubResource( 2 )
shape = SubResource("2")
[connection signal="body_shape_entered" from="Player" to="Player" method="_on_body_shape_entered"]
[connection signal="body_shape_exited" from="Player" to="Player" method="_on_body_shape_exited"]

View File

@@ -0,0 +1,23 @@
# Custom drawing in 2D
A demo showing how to draw 2D elements in Godot without using nodes. This can be done
to create procedural graphics, perform debug drawing to help troubleshoot issues in
game logic, or to improve performance by not creating a node for every visible element.
Antialiasing can be performed using two approaches: either by enabling the `antialiasing`
parameter provided by some of the CanvasItem `draw_*` methods, or by enabling 2D MSAA
in the Project Settings. 2D MSAA is generally slower, but it works with any kind of line-based
or polygon-based 2D drawing, even for `draw_*` methods that don't support an `antialiasing`
parameter. Note that 2D MSAA is only available in the Forward+ and Mobile
renderers, not Compatibility.
See [Custom drawing in 2D](https://docs.godotengine.org/en/latest/tutorials/2d/custom_drawing_in_2d.html)
in the documentation for more information.
Language: GDScript
Renderer: Mobile
## Screenshots
![Screenshot](screenshots/custom_drawing.webp)

View File

@@ -0,0 +1,43 @@
# This is a `@tool` script so that the custom 2D drawing can be seen in the editor.
@tool
extends Panel
var use_antialiasing: bool = false
var time := 0.0
func _process(delta: float) -> void:
# Increment a counter variable that we use in `_draw()`.
time += delta
# Force redrawing on every processed frame, so that the animation can visibly progress.
# Only do this when the node is visible in tree, so that we don't force continuous redrawing
# when not needed (low-processor usage mode is enabled in this demo).
if is_visible_in_tree():
queue_redraw()
func _draw() -> void:
var margin := Vector2(240, 70)
var offset := Vector2()
# Line width of `-1.0` is only usable with draw antialiasing disabled,
# as it uses hardware line drawing as opposed to polygon-based line drawing.
# Automatically use polygon-based line drawing when needed to avoid runtime warnings.
# We also use a line width of `0.5` instead of `1.0` to better match the appearance
# of non-antialiased line drawing, as draw antialiasing tends to make lines look thicker.
var line_width_thin := 0.5 if use_antialiasing else -1.0
# Draw an animated arc to simulate a circular progress bar.
# The start angle is set so the arc starts from the top.
const POINT_COUNT = 48
var progress := wrapf(time, 0.0, 1.0)
draw_arc(
margin + offset,
50.0,
0.75 * TAU,
(0.75 + progress) * TAU,
POINT_COUNT,
Color.MEDIUM_AQUAMARINE,
line_width_thin,
use_antialiasing
)

View File

@@ -0,0 +1 @@
uid://m1872t0qa0i4

View File

@@ -0,0 +1,38 @@
extends Control
var use_antialiasing: bool = false
func _draw() -> void:
var margin := Vector2(240, 70)
var offset := Vector2(0, 150)
# This is an example of using draw commands to create animations.
# For "continuous" animations, you can use a timer within `_draw()` and call `queue_redraw()`
# in `_process()` to redraw every frame.
# Animation length in seconds. The animation will loop after the specified duration.
const ANIMATION_LENGTH = 2.0
# 5 frames per second.
const ANIMATION_FRAMES = 10
# Declare an animation frame with randomized rotation and color for each frame.
# `draw_animation_slice()` makes it so the following draw commands are only visible
# on screen when the current time is within the animation slice.
# NOTE: Pause does not affect animations drawn by `draw_animation_slice()`
# (they will keep playing).
for frame in ANIMATION_FRAMES:
# `remap()` is useful to determine the time slice in which a frame is visible.
# For example, on the 2nd frame, `slice_begin` is `0.2` and `slice_end` is `0.4`.
var slice_begin := remap(frame, 0, ANIMATION_FRAMES, 0, ANIMATION_LENGTH)
var slice_end := remap(frame + 1, 0, ANIMATION_FRAMES, 0, ANIMATION_LENGTH)
draw_animation_slice(ANIMATION_LENGTH, slice_begin, slice_end)
draw_set_transform(margin + offset, deg_to_rad(randf_range(-5.0, 5.0)))
draw_rect(
Rect2(Vector2(), Vector2(100, 50)),
Color.from_hsv(randf(), 0.4, 1.0),
true,
-1.0,
use_antialiasing
)
draw_end_animation()

View File

@@ -0,0 +1 @@
uid://dxbst4jd731sx

View File

@@ -0,0 +1,14 @@
extends Control
func _on_msaa_2d_item_selected(index: int) -> void:
get_viewport().msaa_2d = index as Viewport.MSAA
func _on_draw_antialiasing_toggled(toggled_on: bool) -> void:
var nodes: Array[Node] = %TabContainer.get_children()
nodes.push_back(%AnimationSlice)
for tab: Control in nodes:
tab.use_antialiasing = toggled_on
# Force all tabs to redraw so that the antialiasing updates.
tab.queue_redraw()

View File

@@ -0,0 +1 @@
uid://k86266poffsc

View File

@@ -0,0 +1,272 @@
[gd_scene load_steps=10 format=3 uid="uid://e3ko2k5vfsph"]
[ext_resource type="Script" uid="uid://k86266poffsc" path="res://custom_drawing.gd" id="1_rtndo"]
[ext_resource type="Script" uid="uid://bs2i4k2suatwx" path="res://lines.gd" id="2_exx0l"]
[ext_resource type="Script" uid="uid://kr0artw8tmec" path="res://rectangles.gd" id="3_yrx86"]
[ext_resource type="Script" uid="uid://bavbrayrl4aqv" path="res://polygons.gd" id="4_obj11"]
[ext_resource type="Script" uid="uid://dmgkvc33ohsn1" path="res://textures.gd" id="5_84cac"]
[ext_resource type="Script" uid="uid://cmgvk2l7icywj" path="res://meshes.gd" id="5_exx0l"]
[ext_resource type="Script" uid="uid://by5ufa6o3liw" path="res://text.gd" id="6_4w081"]
[ext_resource type="Script" uid="uid://m1872t0qa0i4" path="res://animation.gd" id="8_yrx86"]
[ext_resource type="Script" uid="uid://dxbst4jd731sx" path="res://animation_slice.gd" id="9_obj11"]
[node name="CustomDrawing" type="Control"]
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
script = ExtResource("1_rtndo")
[node name="TabContainer" type="TabContainer" parent="."]
unique_name_in_owner = true
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
current_tab = 0
[node name="Lines" type="Panel" parent="TabContainer"]
layout_mode = 2
script = ExtResource("2_exx0l")
metadata/_tab_index = 0
[node name="DrawLine" type="Label" parent="TabContainer/Lines"]
layout_mode = 0
offset_left = 24.0
offset_top = 48.0
offset_right = 172.0
offset_bottom = 97.0
theme_override_colors/font_color = Color(0.501961, 1, 0.501961, 1)
text = "draw_line()
draw_dashed_line()"
[node name="DrawCircle" type="Label" parent="TabContainer/Lines"]
layout_mode = 0
offset_left = 24.0
offset_top = 154.0
offset_right = 122.0
offset_bottom = 177.0
theme_override_colors/font_color = Color(0.501961, 1, 0.501961, 1)
text = "draw_circle()"
[node name="DrawArc" type="Label" parent="TabContainer/Lines"]
layout_mode = 0
offset_left = 24.0
offset_top = 264.0
offset_right = 109.0
offset_bottom = 287.0
theme_override_colors/font_color = Color(0.501961, 1, 0.501961, 1)
text = "draw_arc()"
[node name="Rectangles" type="Panel" parent="TabContainer"]
visible = false
layout_mode = 2
script = ExtResource("3_yrx86")
metadata/_tab_index = 1
[node name="DrawRect" type="Label" parent="TabContainer/Rectangles"]
layout_mode = 0
offset_left = 24.0
offset_top = 48.0
offset_right = 109.0
offset_bottom = 71.0
theme_override_colors/font_color = Color(0.501961, 1, 0.501961, 1)
text = "draw_rect()"
[node name="DrawStyleBox" type="Label" parent="TabContainer/Rectangles"]
layout_mode = 0
offset_left = 24.0
offset_top = 296.0
offset_right = 153.0
offset_bottom = 319.0
text = "draw_style_box()"
[node name="Polygons" type="Panel" parent="TabContainer"]
visible = false
layout_mode = 2
script = ExtResource("4_obj11")
metadata/_tab_index = 2
[node name="DrawPrimitive" type="Label" parent="TabContainer/Polygons"]
layout_mode = 0
offset_left = 24.0
offset_top = 48.0
offset_right = 207.0
offset_bottom = 97.0
text = "draw_primitive()"
[node name="DrawPolygon" type="Label" parent="TabContainer/Polygons"]
layout_mode = 0
offset_left = 24.0
offset_top = 168.0
offset_right = 207.0
offset_bottom = 217.0
text = "draw_polygon()
draw_colored_polygon()"
[node name="DrawPolyline" type="Label" parent="TabContainer/Polygons"]
layout_mode = 0
offset_left = 24.0
offset_top = 264.0
offset_right = 195.0
offset_bottom = 313.0
theme_override_colors/font_color = Color(0.501961, 1, 0.501961, 1)
text = "draw_polyline()
draw_polyline_colors()"
[node name="DrawMultiline" type="Label" parent="TabContainer/Polygons"]
layout_mode = 0
offset_left = 24.0
offset_top = 392.0
offset_right = 203.0
offset_bottom = 441.0
theme_override_colors/font_color = Color(0.501961, 1, 0.501961, 1)
text = "draw_multiline()
draw_multiline_colors()"
[node name="Meshes" type="Panel" parent="TabContainer"]
visible = false
layout_mode = 2
script = ExtResource("5_exx0l")
metadata/_tab_index = 3
[node name="DrawMesh" type="Label" parent="TabContainer/Meshes"]
layout_mode = 0
offset_left = 24.0
offset_top = 48.0
offset_right = 207.0
offset_bottom = 97.0
text = "draw_mesh()"
[node name="DrawMultiMesh" type="Label" parent="TabContainer/Meshes"]
layout_mode = 0
offset_left = 24.0
offset_top = 208.0
offset_right = 207.0
offset_bottom = 257.0
text = "draw_multimesh()"
[node name="Textures" type="Panel" parent="TabContainer"]
visible = false
texture_repeat = 2
layout_mode = 2
script = ExtResource("5_84cac")
metadata/_tab_index = 4
[node name="DrawTexture" type="Label" parent="TabContainer/Textures"]
layout_mode = 0
offset_left = 24.0
offset_top = 48.0
offset_right = 175.0
offset_bottom = 97.0
text = "draw_texture()
draw_texture_rect()"
[node name="DrawTextureRectRegion" type="Label" parent="TabContainer/Textures"]
layout_mode = 0
offset_left = 24.0
offset_top = 392.0
offset_right = 231.0
offset_bottom = 415.0
text = "draw_texture_rect_region()"
[node name="Text" type="Panel" parent="TabContainer"]
visible = false
layout_mode = 2
script = ExtResource("6_4w081")
metadata/_tab_index = 5
[node name="DrawChar" type="Label" parent="TabContainer/Text"]
layout_mode = 0
offset_left = 24.0
offset_top = 48.0
offset_right = 125.0
offset_bottom = 97.0
text = "draw_char()
draw_string()"
[node name="Animation" type="Panel" parent="TabContainer"]
visible = false
layout_mode = 2
script = ExtResource("8_yrx86")
metadata/_tab_index = 6
[node name="DrawArcTime" type="Label" parent="TabContainer/Animation"]
layout_mode = 0
offset_left = 24.0
offset_top = 48.0
offset_right = 125.0
offset_bottom = 97.0
theme_override_colors/font_color = Color(0.501961, 1, 0.501961, 1)
text = "draw_arc()
+ time variable"
[node name="DrawAnimationSlice" type="Label" parent="TabContainer/Animation"]
layout_mode = 0
offset_left = 24.0
offset_top = 216.0
offset_right = 201.0
offset_bottom = 265.0
text = "draw_animation_slice()"
[node name="AnimationSlice" type="Control" parent="TabContainer/Animation"]
unique_name_in_owner = true
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
script = ExtResource("9_obj11")
[node name="Options" type="HBoxContainer" parent="."]
layout_mode = 1
anchors_preset = 2
anchor_top = 1.0
anchor_bottom = 1.0
offset_left = 24.0
offset_top = -64.0
offset_right = 441.0
offset_bottom = -24.0
grow_vertical = 0
theme_override_constants/separation = 20
[node name="MSAA2DLabel" type="Label" parent="Options"]
layout_mode = 2
text = "MSAA 2D"
[node name="MSAA2DOptionButton" type="OptionButton" parent="Options"]
layout_mode = 2
selected = 0
item_count = 4
popup/item_0/text = "Disabled"
popup/item_0/id = 0
popup/item_1/text = "2×"
popup/item_1/id = 1
popup/item_2/text = "4×"
popup/item_2/id = 2
popup/item_3/text = "8×"
popup/item_3/id = 3
[node name="VSeparator" type="VSeparator" parent="Options"]
layout_mode = 2
[node name="DrawAntialiasing" type="CheckButton" parent="Options"]
layout_mode = 2
tooltip_text = "Performs antialiasing by adding a feathered outline
to lines that are drawn in 2D. This is generally faster to render
than 2D MSAA, but not all draw commands support it.
Commands that support draw antialiasing are
highlighted in green."
theme_override_colors/font_color = Color(0.501961, 1, 0.501961, 1)
theme_override_colors/font_focus_color = Color(0.501961, 1, 0.501961, 1)
theme_override_colors/font_pressed_color = Color(0.501961, 1, 0.501961, 1)
text = "Draw Antialiasing"
[connection signal="item_selected" from="Options/MSAA2DOptionButton" to="." method="_on_msaa_2d_item_selected"]
[connection signal="toggled" from="Options/DrawAntialiasing" to="." method="_on_draw_antialiasing_toggled"]

View File

@@ -0,0 +1 @@
<svg height="128" width="128" xmlns="http://www.w3.org/2000/svg"><path d="m15.999738 8a7.9997377 7.9997377 0 0 0 -7.999738 7.999738v67.99777c11.999607 3.999869 7.999738-7.999738 15.999475-7.999738v-51.998295h79.997375v17.599423a19.319367 19.319367 0 0 1 15.99948 3.999869v-29.599029a7.9997377 7.9997377 0 0 0 -7.99974-7.999738zm10.879643 81.43733c-2.263926 1.351955-4.127865 3.727878-5.159831 6.919773-3.327891 10.215667-19.3353659-7.519754-7.567752 16.071477 3.719878 7.44775 15.295499 9.61568 22.679257 5.78381a15.375496 15.375496 0 0 0 6.639782-20.439334c-4.623848-9.263696-11.59962-11.287629-16.591456-8.327726zm17.775417-5.599817 10.175666 19.959347 56.550146-28.815056a11.319629 11.319629 0 0 0 -10.07167-20.271336zm27.343104-43.838562v7.999737h-7.999738v7.999738h-15.999476v7.999738h-7.999737v7.999738h-7.999738v7.999737h1.999935l53.998229-27.783089v-4.215862h-7.999738v-7.999737z" fill="#808080" stroke-width=".999999"/></svg>

After

Width:  |  Height:  |  Size: 935 B

View File

@@ -0,0 +1,43 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://cfri1nx5avo7w"
path="res://.godot/imported/icon.svg-218a8f2b3041327d8a5756f3a245f83b.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://icon.svg"
dest_files=["res://.godot/imported/icon.svg-218a8f2b3041327d8a5756f3a245f83b.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/uastc_level=0
compress/rdo_quality_loss=0.0
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1
svg/scale=1.0
editor/scale_with_editor_scale=false
editor/convert_colors_with_editor_theme=false

View File

@@ -0,0 +1,89 @@
# This is a `@tool` script so that the custom 2D drawing can be seen in the editor.
@tool
extends Panel
var use_antialiasing: bool = false
func _draw() -> void:
var margin := Vector2(200, 50)
# Line width of `-1.0` is only usable with draw antialiasing disabled,
# as it uses hardware line drawing as opposed to polygon-based line drawing.
# Automatically use polygon-based line drawing when needed to avoid runtime warnings.
# We also use a line width of `0.5` instead of `1.0` to better match the appearance
# of non-antialiased line drawing, as draw antialiasing tends to make lines look thicker.
var line_width_thin := 0.5 if use_antialiasing else -1.0
# Make thick lines 1 pixel thinner when draw antialiasing is enabled,
# as draw antialiasing tends to make lines look thicker.
var antialiasing_width_offset := 1.0 if use_antialiasing else 0.0
var offset := Vector2()
var line_length := Vector2(140, 35)
draw_line(margin + offset, margin + offset + line_length, Color.GREEN, line_width_thin, use_antialiasing)
offset += Vector2(line_length.x + 15, 0)
draw_line(margin + offset, margin + offset + line_length, Color.GREEN, 2.0 - antialiasing_width_offset, use_antialiasing)
offset += Vector2(line_length.x + 15, 0)
draw_line(margin + offset, margin + offset + line_length, Color.GREEN, 6.0 - antialiasing_width_offset, use_antialiasing)
offset += Vector2(line_length.x + 15, 0)
draw_dashed_line(margin + offset, margin + offset + line_length, Color.CYAN, line_width_thin, 5.0, true, use_antialiasing)
offset += Vector2(line_length.x + 15, 0)
draw_dashed_line(margin + offset, margin + offset + line_length, Color.CYAN, 2.0 - antialiasing_width_offset, 10.0, true, use_antialiasing)
offset += Vector2(line_length.x + 15, 0)
draw_dashed_line(margin + offset, margin + offset + line_length, Color.CYAN, 6.0 - antialiasing_width_offset, 15.0, true, use_antialiasing)
offset = Vector2(40, 120)
draw_circle(margin + offset, 40, Color.ORANGE, false, line_width_thin, use_antialiasing)
offset += Vector2(100, 0)
draw_circle(margin + offset, 40, Color.ORANGE, false, 2.0 - antialiasing_width_offset, use_antialiasing)
offset += Vector2(100, 0)
draw_circle(margin + offset, 40, Color.ORANGE, false, 6.0 - antialiasing_width_offset, use_antialiasing)
# Draw a filled circle. The width parameter is ignored for filled circles (it's set to `-1.0` to avoid warnings).
# We also reduce the radius by half the antialiasing width offset.
# Otherwise, the circle becomes very slightly larger when draw antialiasing is enabled.
offset += Vector2(100, 0)
draw_circle(margin + offset, 40 - antialiasing_width_offset * 0.5, Color.ORANGE, true, -1.0, use_antialiasing)
# `draw_set_transform()` is a stateful command: it affects *all* `draw_` methods within this
# `_draw()` function after it. This can be used to translate, rotate, or scale `draw_` methods
# that don't offer dedicated parameters for this (such as `draw_primitive()` not having a position parameter).
# To reset back to the initial transform, call `draw_set_transform(Vector2())`.
#
# Draw a horizontally stretched circle.
offset += Vector2(200, 0)
draw_set_transform(margin + offset, 0.0, Vector2(3.0, 1.0))
draw_circle(Vector2(), 40, Color.ORANGE, false, line_width_thin, use_antialiasing)
draw_set_transform(Vector2())
# Draw a quarter circle (`TAU` represents a full turn in radians).
const POINT_COUNT_HIGH = 24
offset = Vector2(0, 200)
draw_arc(margin + offset, 60, 0, 0.25 * TAU, POINT_COUNT_HIGH, Color.YELLOW, line_width_thin, use_antialiasing)
offset += Vector2(100, 0)
draw_arc(margin + offset, 60, 0, 0.25 * TAU, POINT_COUNT_HIGH, Color.YELLOW, 2.0 - antialiasing_width_offset, use_antialiasing)
offset += Vector2(100, 0)
draw_arc(margin + offset, 60, 0, 0.25 * TAU, POINT_COUNT_HIGH, Color.YELLOW, 6.0 - antialiasing_width_offset, use_antialiasing)
# Draw a three quarters of a circle with a low point count, which gives it an angular look.
const POINT_COUNT_LOW = 7
offset += Vector2(125, 30)
draw_arc(margin + offset, 40, -0.25 * TAU, 0.5 * TAU, POINT_COUNT_LOW, Color.YELLOW, line_width_thin, use_antialiasing)
offset += Vector2(100, 0)
draw_arc(margin + offset, 40, -0.25 * TAU, 0.5 * TAU, POINT_COUNT_LOW, Color.YELLOW, 2.0 - antialiasing_width_offset, use_antialiasing)
offset += Vector2(100, 0)
draw_arc(margin + offset, 40, -0.25 * TAU, 0.5 * TAU, POINT_COUNT_LOW, Color.YELLOW, 6.0 - antialiasing_width_offset, use_antialiasing)
# Draw a horizontally stretched arc.
offset += Vector2(200, 0)
draw_set_transform(margin + offset, 0.0, Vector2(3.0, 1.0))
draw_arc(Vector2(), 40, -0.25 * TAU, 0.5 * TAU, POINT_COUNT_LOW, Color.YELLOW, line_width_thin, use_antialiasing)
draw_set_transform(Vector2())

View File

@@ -0,0 +1 @@
uid://bs2i4k2suatwx

View File

@@ -0,0 +1,63 @@
# This is a `@tool` script so that the custom 2D drawing can be seen in the editor.
@tool
extends Panel
# You must hold a reference to the Resources either as member variables or within an Array or Dictionary.
# Otherwise, they get freed automatically and the renderer won't be able to draw them.
var text_mesh := TextMesh.new()
var noise_texture := NoiseTexture2D.new()
var gradient_texture := GradientTexture2D.new()
var sphere_mesh := SphereMesh.new()
var multi_mesh := MultiMesh.new()
func _ready() -> void:
text_mesh.text = "TextMesh"
# In 2D, 1 unit equals 1 pixel, so the default size at which PrimitiveMeshes are displayed is tiny.
# Use much larger mesh size to compensate, or use `draw_set_transform()` before using `draw_mesh()`
# to scale the draw command.
text_mesh.pixel_size = 2.5
noise_texture.seamless = true
noise_texture.as_normal_map = true
noise_texture.noise = FastNoiseLite.new()
gradient_texture.gradient = Gradient.new()
sphere_mesh.height = 80.0
sphere_mesh.radius = 40.0
multi_mesh.use_colors = true
multi_mesh.instance_count = 5
multi_mesh.set_instance_transform_2d(0, Transform2D(0.0, Vector2(0, 0)))
multi_mesh.set_instance_color(0, Color(1, 0.7, 0.7))
multi_mesh.set_instance_transform_2d(1, Transform2D(0.0, Vector2(0, 100)))
multi_mesh.set_instance_color(1, Color(0.7, 1, 0.7))
multi_mesh.set_instance_transform_2d(2, Transform2D(0.0, Vector2(100, 100)))
multi_mesh.set_instance_color(2, Color(0.7, 0.7, 1))
multi_mesh.set_instance_transform_2d(3, Transform2D(0.0, Vector2(100, 0)))
multi_mesh.set_instance_color(3, Color(1, 1, 0.7))
multi_mesh.set_instance_transform_2d(4, Transform2D(0.0, Vector2(50, 50)))
multi_mesh.set_instance_color(4, Color(0.7, 1, 1))
multi_mesh.mesh = sphere_mesh
func _draw() -> void:
const margin := Vector2(300, 70)
var offset := Vector2()
# `draw_set_transform()` is a stateful command: it affects *all* `draw_` methods within this
# `_draw()` function after it. This can be used to translate, rotate, or scale `draw_` methods
# that don't offer dedicated parameters for this (such as `draw_primitive()` not having a position parameter).
# To reset back to the initial transform, call `draw_set_transform(Vector2())`.
#
# Flip drawing on the Y axis so the text appears upright.
draw_set_transform(margin + offset, 0.0, Vector2(1, -1))
draw_mesh(text_mesh, noise_texture)
offset += Vector2(150, 0)
draw_set_transform(margin + offset)
draw_mesh(sphere_mesh, noise_texture)
offset = Vector2(0, 120)
draw_set_transform(margin + offset)
draw_multimesh(multi_mesh, gradient_texture)

View File

@@ -0,0 +1 @@
uid://cmgvk2l7icywj

View File

@@ -0,0 +1,126 @@
# This is a `@tool` script so that the custom 2D drawing can be seen in the editor.
@tool
extends Panel
var use_antialiasing: bool = false
func _draw() -> void:
var margin := Vector2(240, 40)
# Line width of `-1.0` is only usable with draw antialiasing disabled,
# as it uses hardware line drawing as opposed to polygon-based line drawing.
# Automatically use polygon-based line drawing when needed to avoid runtime warnings.
# We also use a line width of `0.5` instead of `1.0` to better match the appearance
# of non-antialiased line drawing, as draw antialiasing tends to make lines look thicker.
var line_width_thin := 0.5 if use_antialiasing else -1.0
# Make thick lines 1 pixel thinner when draw antialiasing is enabled,
# as draw antialiasing tends to make lines look thicker.
var antialiasing_width_offset := 1.0 if use_antialiasing else 0.0
var points := PackedVector2Array([
Vector2(0, 0),
Vector2(0, 60),
Vector2(60, 90),
Vector2(60, 0),
Vector2(40, 25),
Vector2(10, 40),
])
var colors := PackedColorArray([
Color.WHITE,
Color.RED,
Color.GREEN,
Color.BLUE,
Color.MAGENTA,
Color.MAGENTA,
])
var offset := Vector2()
# `draw_set_transform()` is a stateful command: it affects *all* `draw_` methods within this
# `_draw()` function after it. This can be used to translate, rotate, or scale `draw_` methods
# that don't offer dedicated parameters for this (such as `draw_primitive()` not having a position parameter).
# To reset back to the initial transform, call `draw_set_transform(Vector2())`.
draw_set_transform(margin + offset)
draw_primitive(points.slice(0, 1), colors.slice(0, 1), PackedVector2Array())
offset += Vector2(90, 0)
draw_set_transform(margin + offset)
draw_primitive(points.slice(0, 2), colors.slice(0, 2), PackedVector2Array())
offset += Vector2(90, 0)
draw_set_transform(margin + offset)
draw_primitive(points.slice(0, 3), colors.slice(0, 3), PackedVector2Array())
offset += Vector2(90, 0)
draw_set_transform(margin + offset)
draw_primitive(points.slice(0, 4), colors.slice(0, 4), PackedVector2Array())
# Draw a polygon with multiple colors that are interpolated between each point.
# Colors are specified in the same order as the points' positions, but in a different array.
offset = Vector2(0, 120)
draw_set_transform(margin + offset)
draw_polygon(points, colors)
# Draw a polygon with a single color. Only a points array is needed in this case.
offset += Vector2(90, 0)
draw_set_transform(margin + offset)
draw_colored_polygon(points, Color.YELLOW)
# Draw a polygon-based line. Each segment is connected to the previous one, which means
# `draw_polyline()` always draws a contiguous line.
offset = Vector2(0, 240)
draw_set_transform(margin + offset)
draw_polyline(points, Color.SKY_BLUE, line_width_thin, use_antialiasing)
offset += Vector2(90, 0)
draw_set_transform(margin + offset)
draw_polyline(points, Color.SKY_BLUE, 2.0 - antialiasing_width_offset, use_antialiasing)
offset += Vector2(90, 0)
draw_set_transform(margin + offset)
draw_polyline(points, Color.SKY_BLUE, 6.0 - antialiasing_width_offset, use_antialiasing)
offset += Vector2(90, 0)
draw_set_transform(margin + offset)
draw_polyline_colors(points, colors, line_width_thin, use_antialiasing)
offset += Vector2(90, 0)
draw_set_transform(margin + offset)
draw_polyline_colors(points, colors, 2.0 - antialiasing_width_offset, use_antialiasing)
offset += Vector2(90, 0)
draw_set_transform(margin + offset)
draw_polyline_colors(points, colors, 6.0 - antialiasing_width_offset, use_antialiasing)
# Draw multiple lines in a single draw command. Unlike `draw_polyline()`,
# lines are not connected to the last segment.
# This is faster than calling `draw_line()` several times and should be preferred
# when drawing dozens of lines or more at once.
offset = Vector2(0, 360)
draw_set_transform(margin + offset)
draw_multiline(points, Color.SKY_BLUE, line_width_thin, use_antialiasing)
offset += Vector2(90, 0)
draw_set_transform(margin + offset)
draw_multiline(points, Color.SKY_BLUE, 2.0 - antialiasing_width_offset, use_antialiasing)
offset += Vector2(90, 0)
draw_set_transform(margin + offset)
draw_multiline(points, Color.SKY_BLUE, 6.0 - antialiasing_width_offset, use_antialiasing)
# `draw_multiline_colors()` makes it possible to draw lines of different colors in a single
# draw command, although gradients are not possible this way (unlike `draw_polygon()` and `draw_polyline()`).
# This means the number of supplied colors must be equal to the number of segments, which means
# we have to only pass a subset of the colors array in this example.
offset += Vector2(90, 0)
draw_set_transform(margin + offset)
draw_multiline_colors(points, colors.slice(0, 3), line_width_thin, use_antialiasing)
offset += Vector2(90, 0)
draw_set_transform(margin + offset)
draw_multiline_colors(points, colors.slice(0, 3), 2.0 - antialiasing_width_offset, use_antialiasing)
offset += Vector2(90, 0)
draw_set_transform(margin + offset)
draw_multiline_colors(points, colors.slice(0, 3), 6.0 - antialiasing_width_offset, use_antialiasing)

View File

@@ -0,0 +1 @@
uid://bavbrayrl4aqv

View File

@@ -0,0 +1,31 @@
; Engine configuration file.
; It's best edited using the editor UI and not directly,
; since the parameters that go here are not all obvious.
;
; Format:
; [section] ; section goes between []
; param=value ; assign values to parameters
config_version=5
[application]
config/name="Custom Drawing in 2D"
config/description="A demo showing how to draw 2D elements in Godot without using nodes."
run/main_scene="uid://btxwm0qudsn3t"
config/features=PackedStringArray("4.5", "Mobile")
run/low_processor_mode=true
config/icon="res://icon.svg"
[debug]
gdscript/warnings/untyped_declaration=1
[display]
window/stretch/mode="canvas_items"
window/stretch/aspect="expand"
[rendering]
renderer/rendering_method="mobile"

View File

@@ -0,0 +1,146 @@
# This is a `@tool` script so that the custom 2D drawing can be seen in the editor.
@tool
extends Panel
var use_antialiasing: bool = false
func _draw() -> void:
var margin := Vector2(200, 40)
# Line width of `-1.0` is only usable with draw antialiasing disabled,
# as it uses hardware line drawing as opposed to polygon-based line drawing.
# Automatically use polygon-based line drawing when needed to avoid runtime warnings.
# We also use a line width of `0.5` instead of `1.0` to better match the appearance
# of non-antialiased line drawing, as draw antialiasing tends to make lines look thicker.
var line_width_thin := 0.5 if use_antialiasing else -1.0
# Make thick lines 1 pixel thinner when draw antialiasing is enabled,
# as draw antialiasing tends to make lines look thicker.
var antialiasing_width_offset := 1.0 if use_antialiasing else 0.0
var offset := Vector2()
draw_rect(
Rect2(margin + offset, Vector2(100, 50)),
Color.PURPLE,
false,
line_width_thin,
use_antialiasing
)
offset += Vector2(120, 0)
draw_rect(
Rect2(margin + offset, Vector2(100, 50)),
Color.PURPLE,
false,
2.0 - antialiasing_width_offset,
use_antialiasing
)
offset += Vector2(120, 0)
draw_rect(
Rect2(margin + offset, Vector2(100, 50)),
Color.PURPLE,
false,
6.0 - antialiasing_width_offset,
use_antialiasing
)
# Draw a filled rectangle. The width parameter is ignored for filled rectangles (it's set to `-1.0` to avoid warnings).
# We also reduce the rectangle's size by half the antialiasing width offset.
# Otherwise, the rectangle becomes very slightly larger when draw antialiasing is enabled.
offset += Vector2(120, 0)
draw_rect(
Rect2(margin + offset, Vector2(100, 50)).grow(-antialiasing_width_offset * 0.5),
Color.PURPLE,
true,
-1.0,
use_antialiasing
)
# `draw_set_transform()` is a stateful command: it affects *all* `draw_` methods within this
# `_draw()` function after it. This can be used to translate, rotate, or scale `draw_` methods
# that don't offer dedicated parameters for this (such as `draw_rect()` not having a rotation parameter).
# To reset back to the initial transform, call `draw_set_transform(Vector2())`.
offset += Vector2(170, 0)
draw_set_transform(margin + offset, deg_to_rad(22.5))
draw_rect(
Rect2(Vector2(), Vector2(100, 50)),
Color.PURPLE,
false,
line_width_thin,
use_antialiasing
)
offset += Vector2(120, 0)
draw_set_transform(margin + offset, deg_to_rad(22.5))
draw_rect(
Rect2(Vector2(), Vector2(100, 50)),
Color.PURPLE,
false,
2.0 - antialiasing_width_offset,
use_antialiasing
)
offset += Vector2(120, 0)
draw_set_transform(margin + offset, deg_to_rad(22.5))
draw_rect(
Rect2(Vector2(), Vector2(100, 50)),
Color.PURPLE,
false,
6.0 - antialiasing_width_offset,
use_antialiasing
)
# `draw_set_transform_matrix()` is a more advanced counterpart of `draw_set_transform()`.
# It can be used to apply transforms that are not supported by `draw_set_transform()`, such as
# skewing.
offset = Vector2(20, 60)
var custom_transform := get_transform().translated(margin + offset)
# Perform horizontal skewing (the rectangle will appear "slanted").
custom_transform.y.x -= 0.5
draw_set_transform_matrix(custom_transform)
draw_rect(
Rect2(Vector2(), Vector2(100, 50)),
Color.PURPLE,
false,
6.0 - antialiasing_width_offset,
use_antialiasing
)
draw_set_transform(Vector2())
offset = Vector2(0, 250)
var style_box_flat := StyleBoxFlat.new()
style_box_flat.set_border_width_all(4)
style_box_flat.set_corner_radius_all(8)
style_box_flat.shadow_size = 1
style_box_flat.shadow_offset = Vector2(4, 4)
style_box_flat.shadow_color = Color.RED
style_box_flat.anti_aliasing = use_antialiasing
draw_style_box(style_box_flat, Rect2(margin + offset, Vector2(100, 50)))
offset += Vector2(130, 0)
var style_box_flat_2 := StyleBoxFlat.new()
style_box_flat_2.draw_center = false
style_box_flat_2.set_border_width_all(4)
style_box_flat_2.set_corner_radius_all(8)
style_box_flat_2.corner_detail = 1
style_box_flat_2.border_color = Color.GREEN
style_box_flat_2.anti_aliasing = use_antialiasing
draw_style_box(style_box_flat_2, Rect2(margin + offset, Vector2(100, 50)))
offset += Vector2(160, 0)
var style_box_flat_3 := StyleBoxFlat.new()
style_box_flat_3.draw_center = false
style_box_flat_3.set_border_width_all(4)
style_box_flat_3.set_corner_radius_all(8)
style_box_flat_3.border_color = Color.CYAN
style_box_flat_3.shadow_size = 40
style_box_flat_3.shadow_offset = Vector2()
style_box_flat_3.shadow_color = Color.CORNFLOWER_BLUE
style_box_flat_3.anti_aliasing = use_antialiasing
custom_transform = get_transform().translated(margin + offset)
# Perform vertical skewing (the rectangle will appear "slanted").
custom_transform.x.y -= 0.5
draw_set_transform_matrix(custom_transform)
draw_style_box(style_box_flat_3, Rect2(Vector2(), Vector2(100, 50)))
draw_set_transform(Vector2())

View File

@@ -0,0 +1 @@
uid://kr0artw8tmec

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

60
2d/custom_drawing/text.gd Normal file
View File

@@ -0,0 +1,60 @@
# This is a `@tool` script so that the custom 2D drawing can be seen in the editor.
@tool
extends Panel
var use_antialiasing: bool = false
func _draw() -> void:
var font := get_theme_default_font()
const FONT_SIZE = 24
const STRING = "Hello world!"
var margin := Vector2(240, 60)
var offset := Vector2()
var advance := Vector2()
for character in STRING:
# Draw each character with a random pastel color.
# Notice how the advance calculated on the loop's previous iteration is used as an offset here.
draw_char(font, margin + offset + advance, character, FONT_SIZE, Color.from_hsv(randf(), 0.4, 1.0))
# Get the glyph index of the character we've just drawn, so we can retrieve the glyph advance.
# This determines the spacing between glyphs so the next character is positioned correctly.
var glyph_idx := TextServerManager.get_primary_interface().font_get_glyph_index(
get_theme_default_font().get_rids()[0],
FONT_SIZE,
character.unicode_at(0),
0
)
advance.x += TextServerManager.get_primary_interface().font_get_glyph_advance(
get_theme_default_font().get_rids()[0],
FONT_SIZE,
glyph_idx
).x
offset += Vector2(0, 32)
# When drawing a font outline, it must be drawn *before* the main text.
# This way, the outline appears behind the main text.
draw_string_outline(
font,
margin + offset,
STRING,
HORIZONTAL_ALIGNMENT_LEFT,
-1,
FONT_SIZE,
12,
Color.ORANGE.darkened(0.6)
)
# NOTE: Use `draw_multiline_string()` to draw strings that contain line breaks (`\n`) or with
# automatic line wrapping based on the specified width.
# A width of `-1` is used here, which means "no limit". If width is limited, the end of the string
# will be cut off if it doesn't fit within the specified width.
draw_string(
font,
margin + offset,
STRING,
HORIZONTAL_ALIGNMENT_LEFT,
-1,
FONT_SIZE,
Color.YELLOW
)

View File

@@ -0,0 +1 @@
uid://by5ufa6o3liw

View File

@@ -0,0 +1,67 @@
# This is a `@tool` script so that the custom 2D drawing can be seen in the editor.
@tool
extends Panel
var use_antialiasing: bool = false
func _draw() -> void:
const ICON = preload("res://icon.svg")
var margin := Vector2(260, 40)
var offset := Vector2()
# Draw a texture.
draw_texture(ICON, margin + offset, Color.WHITE)
# `draw_set_transform()` is a stateful command: it affects *all* `draw_` methods within this
# `_draw()` function after it. This can be used to translate, rotate, or scale `draw_` methods
# that don't offer dedicated parameters for this (such as `draw_rect()` not having a rotation parameter).
# To reset back to the initial transform, call `draw_set_transform(Vector2())`.
#
# Draw a rotated texture at half the scale of its original pixel size.
offset += Vector2(200, 20)
draw_set_transform(margin + offset, deg_to_rad(45.0), Vector2(0.5, 0.5))
draw_texture(ICON, Vector2(), Color.WHITE)
draw_set_transform(Vector2())
# Draw a stretched texture. In this example, the icon is 128×128 so it will be drawn at 2× scale.
offset += Vector2(70, -20)
draw_texture_rect(
ICON,
Rect2(margin + offset, Vector2(256, 256)),
false,
Color.GREEN
)
# Draw a tiled texture. In this example, the icon is 128×128 so it will be drawn twice on each axis.
offset += Vector2(270, 0)
draw_texture_rect(
ICON,
Rect2(margin + offset, Vector2(256, 256)),
true,
Color.GREEN
)
offset = Vector2(0, 300)
draw_texture_rect_region(
ICON,
Rect2(margin + offset, Vector2(128, 128)),
Rect2(Vector2(32, 32), Vector2(64, 64)),
Color.VIOLET
)
# Draw a tiled texture from a region that is larger than the original texture size (128×128).
# Transposing is enabled, which will rotate the image by 90 degrees counter-clockwise.
# (For more advanced transforms, use `draw_set_transform()` before calling `draw_texture_rect_region()`.)
#
# For tiling to work with this approach, the CanvasItem in which this `_draw()` method is called
# must have its Repeat property set to Enabled in the inspector.
offset += Vector2(140, 0)
draw_texture_rect_region(
ICON,
Rect2(margin + offset, Vector2(128, 128)),
Rect2(Vector2(), Vector2(512, 512)),
Color.VIOLET,
true
)

View File

@@ -0,0 +1 @@
uid://dmgkvc33ohsn1

View File

@@ -1,31 +0,0 @@
extends CanvasLayer
signal start_game
func show_message(text):
$MessageLabel.text = text
$MessageLabel.show()
$MessageTimer.start()
func show_game_over():
show_message("Game Over")
yield($MessageTimer, "timeout")
$MessageLabel.text = "Dodge the\nCreeps"
$MessageLabel.show()
yield(get_tree().create_timer(1), "timeout")
$StartButton.show()
func update_score(score):
$ScoreLabel.text = str(score)
func _on_StartButton_pressed():
$StartButton.hide()
emit_signal("start_game")
func _on_MessageTimer_timeout():
$MessageLabel.hide()

View File

@@ -1,61 +0,0 @@
[gd_scene load_steps=7 format=2]
[ext_resource path="res://HUD.gd" type="Script" id=1]
[ext_resource path="res://fonts/Xolonium-Regular.ttf" type="DynamicFontData" id=2]
[sub_resource type="DynamicFont" id=1]
size = 64
font_data = ExtResource( 2 )
[sub_resource type="DynamicFont" id=2]
size = 64
font_data = ExtResource( 2 )
[sub_resource type="InputEventAction" id=3]
action = "start_game"
[sub_resource type="ShortCut" id=4]
shortcut = SubResource( 3 )
[node name="HUD" type="CanvasLayer"]
script = ExtResource( 1 )
[node name="ScoreLabel" type="Label" parent="."]
anchor_right = 1.0
margin_bottom = 78.0
custom_fonts/font = SubResource( 1 )
text = "0"
align = 1
[node name="MessageLabel" type="Label" parent="."]
anchor_top = 0.5
anchor_right = 1.0
anchor_bottom = 0.5
margin_top = -79.5
margin_bottom = 79.5
custom_fonts/font = SubResource( 1 )
text = "Dodge the
Creeps"
align = 1
[node name="StartButton" type="Button" parent="."]
anchor_left = 0.5
anchor_top = 1.0
anchor_right = 0.5
anchor_bottom = 1.0
margin_left = -90.0
margin_top = -200.0
margin_right = 90.0
margin_bottom = -100.0
custom_fonts/font = SubResource( 2 )
shortcut = SubResource( 4 )
text = "Start"
__meta__ = {
"_edit_use_anchors_": false
}
[node name="MessageTimer" type="Timer" parent="."]
one_shot = true
[connection signal="pressed" from="StartButton" to="." method="_on_StartButton_pressed"]
[connection signal="timeout" from="MessageTimer" to="." method="_on_MessageTimer_timeout"]

View File

@@ -1,62 +0,0 @@
extends Node
export(PackedScene) var mob_scene
var score
func _ready():
randomize()
func game_over():
$ScoreTimer.stop()
$MobTimer.stop()
$HUD.show_game_over()
$Music.stop()
$DeathSound.play()
func new_game():
get_tree().call_group("mobs", "queue_free")
score = 0
$Player.start($StartPosition.position)
$StartTimer.start()
$HUD.update_score(score)
$HUD.show_message("Get Ready")
$Music.play()
func _on_MobTimer_timeout():
# Create a new instance of the Mob scene.
var mob = mob_scene.instance()
# Choose a random location on Path2D.
var mob_spawn_location = get_node("MobPath/MobSpawnLocation")
mob_spawn_location.offset = randi()
# Set the mob's direction perpendicular to the path direction.
var direction = mob_spawn_location.rotation + PI / 2
# Set the mob's position to a random location.
mob.position = mob_spawn_location.position
# Add some randomness to the direction.
direction += rand_range(-PI / 4, PI / 4)
mob.rotation = direction
# Choose the velocity for the mob.
var velocity = Vector2(rand_range(150.0, 250.0), 0.0)
mob.linear_velocity = velocity.rotated(direction)
# Spawn the mob by adding it to the Main scene.
add_child(mob)
func _on_ScoreTimer_timeout():
score += 1
$HUD.update_score(score)
func _on_StartTimer_timeout():
$MobTimer.start()
$ScoreTimer.start()

View File

@@ -1,55 +0,0 @@
[gd_scene load_steps=8 format=2]
[ext_resource path="res://Main.gd" type="Script" id=1]
[ext_resource path="res://Mob.tscn" type="PackedScene" id=2]
[ext_resource path="res://Player.tscn" type="PackedScene" id=3]
[ext_resource path="res://HUD.tscn" type="PackedScene" id=4]
[ext_resource path="res://art/House In a Forest Loop.ogg" type="AudioStream" id=5]
[ext_resource path="res://art/gameover.wav" type="AudioStream" id=6]
[sub_resource type="Curve2D" id=1]
_data = {
"points": PoolVector2Array( 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 480, 0, 0, 0, 0, 0, 480, 720, 0, 0, 0, 0, 0, 720, 0, 0, 0, 0, 0, 0 )
}
[node name="Main" type="Node"]
script = ExtResource( 1 )
mob_scene = ExtResource( 2 )
[node name="ColorRect" type="ColorRect" parent="."]
anchor_right = 1.0
anchor_bottom = 1.0
color = Color( 0.219608, 0.372549, 0.380392, 1 )
[node name="Player" parent="." instance=ExtResource( 3 )]
[node name="MobTimer" type="Timer" parent="."]
wait_time = 0.5
[node name="ScoreTimer" type="Timer" parent="."]
[node name="StartTimer" type="Timer" parent="."]
wait_time = 2.0
one_shot = true
[node name="StartPosition" type="Position2D" parent="."]
position = Vector2( 240, 450 )
[node name="MobPath" type="Path2D" parent="."]
curve = SubResource( 1 )
[node name="MobSpawnLocation" type="PathFollow2D" parent="MobPath"]
[node name="HUD" parent="." instance=ExtResource( 4 )]
[node name="Music" type="AudioStreamPlayer" parent="."]
stream = ExtResource( 5 )
[node name="DeathSound" type="AudioStreamPlayer" parent="."]
stream = ExtResource( 6 )
[connection signal="hit" from="Player" to="." method="game_over"]
[connection signal="timeout" from="MobTimer" to="." method="_on_MobTimer_timeout"]
[connection signal="timeout" from="ScoreTimer" to="." method="_on_ScoreTimer_timeout"]
[connection signal="timeout" from="StartTimer" to="." method="_on_StartTimer_timeout"]
[connection signal="start_game" from="HUD" to="." method="new_game"]

View File

@@ -1,11 +0,0 @@
extends RigidBody2D
func _ready():
$AnimatedSprite.playing = true
var mob_types = $AnimatedSprite.frames.get_animation_names()
$AnimatedSprite.animation = mob_types[randi() % mob_types.size()]
func _on_VisibilityNotifier2D_screen_exited():
queue_free()

View File

@@ -1,52 +0,0 @@
[gd_scene load_steps=10 format=2]
[ext_resource path="res://Mob.gd" type="Script" id=1]
[ext_resource path="res://art/enemyFlyingAlt_1.png" type="Texture" id=2]
[ext_resource path="res://art/enemyFlyingAlt_2.png" type="Texture" id=3]
[ext_resource path="res://art/enemyWalking_1.png" type="Texture" id=4]
[ext_resource path="res://art/enemyWalking_2.png" type="Texture" id=5]
[ext_resource path="res://art/enemySwimming_1.png" type="Texture" id=6]
[ext_resource path="res://art/enemySwimming_2.png" type="Texture" id=7]
[sub_resource type="SpriteFrames" id=1]
animations = [ {
"frames": [ ExtResource( 2 ), ExtResource( 3 ) ],
"loop": true,
"name": "fly",
"speed": 3.0
}, {
"frames": [ ExtResource( 6 ), ExtResource( 7 ) ],
"loop": true,
"name": "swim",
"speed": 4.0
}, {
"frames": [ ExtResource( 4 ), ExtResource( 5 ) ],
"loop": true,
"name": "walk",
"speed": 4.0
} ]
[sub_resource type="CapsuleShape2D" id=2]
radius = 35.2706
height = 23.3281
[node name="Mob" type="RigidBody2D" groups=["mobs"]]
collision_mask = 0
gravity_scale = 0.0
script = ExtResource( 1 )
__meta__ = {
"_edit_group_": true
}
[node name="AnimatedSprite" type="AnimatedSprite" parent="."]
scale = Vector2( 0.75, 0.75 )
frames = SubResource( 1 )
animation = "walk"
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
rotation = 1.5708
shape = SubResource( 2 )
[node name="VisibilityNotifier2D" type="VisibilityNotifier2D" parent="."]
[connection signal="screen_exited" from="VisibilityNotifier2D" to="." method="_on_VisibilityNotifier2D_screen_exited"]

View File

@@ -1,54 +0,0 @@
extends Area2D
signal hit
export var speed = 400 # How fast the player will move (pixels/sec).
var screen_size # Size of the game window.
func _ready():
screen_size = get_viewport_rect().size
hide()
func _process(delta):
var velocity = Vector2.ZERO # The player's movement vector.
if Input.is_action_pressed("move_right"):
velocity.x += 1
if Input.is_action_pressed("move_left"):
velocity.x -= 1
if Input.is_action_pressed("move_down"):
velocity.y += 1
if Input.is_action_pressed("move_up"):
velocity.y -= 1
if velocity.length() > 0:
velocity = velocity.normalized() * speed
$AnimatedSprite.play()
else:
$AnimatedSprite.stop()
position += velocity * delta
position.x = clamp(position.x, 0, screen_size.x)
position.y = clamp(position.y, 0, screen_size.y)
if velocity.x != 0:
$AnimatedSprite.animation = "right"
$AnimatedSprite.flip_v = false
$AnimatedSprite.flip_h = velocity.x < 0
elif velocity.y != 0:
$AnimatedSprite.animation = "up"
$AnimatedSprite.flip_v = velocity.y > 0
func start(pos):
position = pos
show()
$CollisionShape2D.disabled = false
func _on_Player_body_entered(_body):
hide() # Player disappears after being hit.
emit_signal("hit")
# Must be deferred as we can't change physics properties on a physics callback.
$CollisionShape2D.set_deferred("disabled", true)

View File

@@ -1,71 +0,0 @@
[gd_scene load_steps=13 format=2]
[ext_resource path="res://Player.gd" type="Script" id=1]
[ext_resource path="res://art/playerGrey_walk1.png" type="Texture" id=2]
[ext_resource path="res://art/playerGrey_walk2.png" type="Texture" id=3]
[ext_resource path="res://art/playerGrey_up1.png" type="Texture" id=4]
[ext_resource path="res://art/playerGrey_up2.png" type="Texture" id=5]
[sub_resource type="SpriteFrames" id=1]
animations = [ {
"frames": [ ExtResource( 2 ), ExtResource( 3 ) ],
"loop": true,
"name": "right",
"speed": 5.0
}, {
"frames": [ ExtResource( 4 ), ExtResource( 5 ) ],
"loop": true,
"name": "up",
"speed": 5.0
} ]
[sub_resource type="CapsuleShape2D" id=2]
radius = 26.1701
height = 14.822
[sub_resource type="Gradient" id=3]
colors = PoolColorArray( 1, 1, 1, 0.501961, 1, 1, 1, 0 )
[sub_resource type="GradientTexture" id=4]
gradient = SubResource( 3 )
[sub_resource type="Curve" id=5]
_data = [ Vector2( 0.00501098, 0.5 ), 0.0, 0.0, 0, 0, Vector2( 0.994989, 0.324 ), 0.0, 0.0, 0, 0 ]
[sub_resource type="CurveTexture" id=6]
curve = SubResource( 5 )
[sub_resource type="ParticlesMaterial" id=7]
flag_disable_z = true
gravity = Vector3( 0, 0, 0 )
initial_velocity = 1.0
orbit_velocity = 0.0
orbit_velocity_random = 0.0
scale = 0.75
scale_curve = SubResource( 6 )
color_ramp = SubResource( 4 )
[node name="Player" type="Area2D"]
z_index = 10
script = ExtResource( 1 )
__meta__ = {
"_edit_group_": true
}
[node name="AnimatedSprite" type="AnimatedSprite" parent="."]
scale = Vector2( 0.5, 0.5 )
frames = SubResource( 1 )
animation = "right"
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
shape = SubResource( 2 )
[node name="Trail" type="Particles2D" parent="."]
z_index = -1
amount = 10
speed_scale = 2.0
local_coords = false
process_material = SubResource( 7 )
texture = ExtResource( 2 )
[connection signal="body_entered" from="." to="." method="_on_Player_body_entered"]

View File

@@ -10,13 +10,13 @@ consider following the tutorial in the documentation.
Language: GDScript
Renderer: GLES 3 (particles are not available in GLES 2)
Renderer: Compatibility
Note: There is a C# version available [here](https://github.com/godotengine/godot-demo-projects/tree/master/mono/dodge_the_creeps).
> [!NOTE]
>
> There is a C# version available [here](https://github.com/godotengine/godot-demo-projects/tree/master/mono/dodge_the_creeps).
Note: There is a GDNative C++ version available [here](https://github.com/godotengine/gdnative-demos/tree/master/cpp/dodge_the_creeps).
Check out this demo on the asset library: https://godotengine.org/asset-library/asset/515
Check out this demo on the asset library: https://godotengine.org/asset-library/asset/2712
## Screenshots
@@ -26,8 +26,8 @@ Check out this demo on the asset library: https://godotengine.org/asset-library/
## Copying
`art/House In a Forest Loop.ogg` Copyright &copy; 2012 [HorrorPen](https://opengameart.org/users/horrorpen), [CC-BY 3.0: Attribution](http://creativecommons.org/licenses/by/3.0/). Source: https://opengameart.org/content/loop-house-in-a-forest
`art/House In a Forest Loop.ogg` Copyright &copy; 2012 [HorrorPen](https://opengameart.org/users/horrorpen), [CC-BY 3.0: Attribution](https://creativecommons.org/licenses/by/3.0/). Source: https://opengameart.org/content/loop-house-in-a-forest
Images are from "Abstract Platformer". Created in 2016 by kenney.nl, [CC0 1.0 Universal](http://creativecommons.org/publicdomain/zero/1.0/). Source: https://www.kenney.nl/assets/abstract-platformer
Images are from "Abstract Platformer". Created in 2016 by kenney.nl, [CC0 1.0 Universal](https://creativecommons.org/publicdomain/zero/1.0/). Source: https://www.kenney.nl/assets/abstract-platformer
Font is "Xolonium". Copyright &copy; 2011-2016 Severin Meyer <sev.ch@web.de>, with Reserved Font Name Xolonium, SIL open font license version 1.1. Details are in `fonts/LICENSE.txt`.

View File

@@ -1,15 +1,19 @@
[remap]
importer="ogg_vorbis"
type="AudioStreamOGGVorbis"
path="res://.import/House In a Forest Loop.ogg-1a6a72ae843ad792b7039931227e8d50.oggstr"
importer="oggvorbisstr"
type="AudioStreamOggVorbis"
uid="uid://sgfduhhw4pno"
path="res://.godot/imported/House In a Forest Loop.ogg-1a6a72ae843ad792b7039931227e8d50.oggvorbisstr"
[deps]
source_file="res://art/House In a Forest Loop.ogg"
dest_files=[ "res://.import/House In a Forest Loop.ogg-1a6a72ae843ad792b7039931227e8d50.oggstr" ]
dest_files=["res://.godot/imported/House In a Forest Loop.ogg-1a6a72ae843ad792b7039931227e8d50.oggvorbisstr"]
[params]
loop=true
loop_offset=0
loop_offset=0.0
bpm=0.0
beat_count=0
bar_beats=4

View File

@@ -1,8 +1,9 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/enemyFlyingAlt_1.png-559f599b16c69b112c1b53f6332e9489.stex"
type="CompressedTexture2D"
uid="uid://dun74wipekpfq"
path="res://.godot/imported/enemyFlyingAlt_1.png-559f599b16c69b112c1b53f6332e9489.ctex"
metadata={
"vram_texture": false
}
@@ -10,26 +11,30 @@ metadata={
[deps]
source_file="res://art/enemyFlyingAlt_1.png"
dest_files=[ "res://.import/enemyFlyingAlt_1.png-559f599b16c69b112c1b53f6332e9489.stex" ]
dest_files=["res://.godot/imported/enemyFlyingAlt_1.png-559f599b16c69b112c1b53f6332e9489.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/uastc_level=0
compress/rdo_quality_loss=0.0
compress/hdr_compression=1
compress/normal_map=0
flags/repeat=0
flags/filter=false
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
process/normal_map_invert_y=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1

View File

@@ -1,8 +1,9 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/enemyFlyingAlt_2.png-31dc7310eda6e1b721224f3cd932c076.stex"
type="CompressedTexture2D"
uid="uid://vusf51hepduk"
path="res://.godot/imported/enemyFlyingAlt_2.png-31dc7310eda6e1b721224f3cd932c076.ctex"
metadata={
"vram_texture": false
}
@@ -10,26 +11,30 @@ metadata={
[deps]
source_file="res://art/enemyFlyingAlt_2.png"
dest_files=[ "res://.import/enemyFlyingAlt_2.png-31dc7310eda6e1b721224f3cd932c076.stex" ]
dest_files=["res://.godot/imported/enemyFlyingAlt_2.png-31dc7310eda6e1b721224f3cd932c076.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/uastc_level=0
compress/rdo_quality_loss=0.0
compress/hdr_compression=1
compress/normal_map=0
flags/repeat=0
flags/filter=false
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
process/normal_map_invert_y=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1

View File

@@ -1,8 +1,9 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/enemySwimming_1.png-dd0e11759dc3d624c8a704f6e98a3d80.stex"
type="CompressedTexture2D"
uid="uid://d182mv7y80xqy"
path="res://.godot/imported/enemySwimming_1.png-dd0e11759dc3d624c8a704f6e98a3d80.ctex"
metadata={
"vram_texture": false
}
@@ -10,26 +11,30 @@ metadata={
[deps]
source_file="res://art/enemySwimming_1.png"
dest_files=[ "res://.import/enemySwimming_1.png-dd0e11759dc3d624c8a704f6e98a3d80.stex" ]
dest_files=["res://.godot/imported/enemySwimming_1.png-dd0e11759dc3d624c8a704f6e98a3d80.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/uastc_level=0
compress/rdo_quality_loss=0.0
compress/hdr_compression=1
compress/normal_map=0
flags/repeat=0
flags/filter=false
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
process/normal_map_invert_y=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1

View File

@@ -1,8 +1,9 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/enemySwimming_2.png-4c0cbc0732264c4ea3290340bd4a0a62.stex"
type="CompressedTexture2D"
uid="uid://dmgglhdyowipd"
path="res://.godot/imported/enemySwimming_2.png-4c0cbc0732264c4ea3290340bd4a0a62.ctex"
metadata={
"vram_texture": false
}
@@ -10,26 +11,30 @@ metadata={
[deps]
source_file="res://art/enemySwimming_2.png"
dest_files=[ "res://.import/enemySwimming_2.png-4c0cbc0732264c4ea3290340bd4a0a62.stex" ]
dest_files=["res://.godot/imported/enemySwimming_2.png-4c0cbc0732264c4ea3290340bd4a0a62.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/uastc_level=0
compress/rdo_quality_loss=0.0
compress/hdr_compression=1
compress/normal_map=0
flags/repeat=0
flags/filter=false
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
process/normal_map_invert_y=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1

View File

@@ -1,8 +1,9 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/enemyWalking_1.png-5af6eedbe61b701677d490ffdc1e6471.stex"
type="CompressedTexture2D"
uid="uid://dgwhuvn7qb4iy"
path="res://.godot/imported/enemyWalking_1.png-5af6eedbe61b701677d490ffdc1e6471.ctex"
metadata={
"vram_texture": false
}
@@ -10,26 +11,30 @@ metadata={
[deps]
source_file="res://art/enemyWalking_1.png"
dest_files=[ "res://.import/enemyWalking_1.png-5af6eedbe61b701677d490ffdc1e6471.stex" ]
dest_files=["res://.godot/imported/enemyWalking_1.png-5af6eedbe61b701677d490ffdc1e6471.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/uastc_level=0
compress/rdo_quality_loss=0.0
compress/hdr_compression=1
compress/normal_map=0
flags/repeat=0
flags/filter=false
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
process/normal_map_invert_y=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1

View File

@@ -1,8 +1,9 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/enemyWalking_2.png-67c480ed60c35e95f5acb0436246b935.stex"
type="CompressedTexture2D"
uid="uid://dyw702efe6meu"
path="res://.godot/imported/enemyWalking_2.png-67c480ed60c35e95f5acb0436246b935.ctex"
metadata={
"vram_texture": false
}
@@ -10,26 +11,30 @@ metadata={
[deps]
source_file="res://art/enemyWalking_2.png"
dest_files=[ "res://.import/enemyWalking_2.png-67c480ed60c35e95f5acb0436246b935.stex" ]
dest_files=["res://.godot/imported/enemyWalking_2.png-67c480ed60c35e95f5acb0436246b935.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/uastc_level=0
compress/rdo_quality_loss=0.0
compress/hdr_compression=1
compress/normal_map=0
flags/repeat=0
flags/filter=false
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
process/normal_map_invert_y=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1

View File

@@ -1,13 +1,14 @@
[remap]
importer="wav"
type="AudioStreamSample"
path="res://.import/gameover.wav-98c95c744b35280048c2bd093cf8a356.sample"
type="AudioStreamWAV"
uid="uid://td2mgko63p61"
path="res://.godot/imported/gameover.wav-98c95c744b35280048c2bd093cf8a356.sample"
[deps]
source_file="res://art/gameover.wav"
dest_files=[ "res://.import/gameover.wav-98c95c744b35280048c2bd093cf8a356.sample" ]
dest_files=["res://.godot/imported/gameover.wav-98c95c744b35280048c2bd093cf8a356.sample"]
[params]
@@ -20,4 +21,4 @@ edit/normalize=true
edit/loop_mode=0
edit/loop_begin=0
edit/loop_end=-1
compress/mode=0
compress/mode=2

View File

@@ -1,8 +1,9 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/playerGrey_up1.png-6bd114d0a6beac91f48e3a7314d44564.stex"
type="CompressedTexture2D"
uid="uid://bcow5c46vixno"
path="res://.godot/imported/playerGrey_up1.png-6bd114d0a6beac91f48e3a7314d44564.ctex"
metadata={
"vram_texture": false
}
@@ -10,26 +11,30 @@ metadata={
[deps]
source_file="res://art/playerGrey_up1.png"
dest_files=[ "res://.import/playerGrey_up1.png-6bd114d0a6beac91f48e3a7314d44564.stex" ]
dest_files=["res://.godot/imported/playerGrey_up1.png-6bd114d0a6beac91f48e3a7314d44564.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/uastc_level=0
compress/rdo_quality_loss=0.0
compress/hdr_compression=1
compress/normal_map=0
flags/repeat=0
flags/filter=false
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
process/normal_map_invert_y=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1

View File

@@ -1,8 +1,9 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/playerGrey_up2.png-d6aba85f5f2675ebc7045efa7552ee79.stex"
type="CompressedTexture2D"
uid="uid://dw3lwgwhpbfx8"
path="res://.godot/imported/playerGrey_up2.png-d6aba85f5f2675ebc7045efa7552ee79.ctex"
metadata={
"vram_texture": false
}
@@ -10,26 +11,30 @@ metadata={
[deps]
source_file="res://art/playerGrey_up2.png"
dest_files=[ "res://.import/playerGrey_up2.png-d6aba85f5f2675ebc7045efa7552ee79.stex" ]
dest_files=["res://.godot/imported/playerGrey_up2.png-d6aba85f5f2675ebc7045efa7552ee79.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/uastc_level=0
compress/rdo_quality_loss=0.0
compress/hdr_compression=1
compress/normal_map=0
flags/repeat=0
flags/filter=false
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
process/normal_map_invert_y=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1

View File

@@ -1,8 +1,9 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/playerGrey_walk1.png-c4773fe7a7bf85d7ab732eb4458c2742.stex"
type="CompressedTexture2D"
uid="uid://b2aofu01vxvea"
path="res://.godot/imported/playerGrey_walk1.png-c4773fe7a7bf85d7ab732eb4458c2742.ctex"
metadata={
"vram_texture": false
}
@@ -10,26 +11,30 @@ metadata={
[deps]
source_file="res://art/playerGrey_walk1.png"
dest_files=[ "res://.import/playerGrey_walk1.png-c4773fe7a7bf85d7ab732eb4458c2742.stex" ]
dest_files=["res://.godot/imported/playerGrey_walk1.png-c4773fe7a7bf85d7ab732eb4458c2742.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/uastc_level=0
compress/rdo_quality_loss=0.0
compress/hdr_compression=1
compress/normal_map=0
flags/repeat=0
flags/filter=false
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
process/normal_map_invert_y=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1

View File

@@ -1,8 +1,9 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/playerGrey_walk2.png-34d2d916366100182d08037c51884043.stex"
type="CompressedTexture2D"
uid="uid://ddjou2q6gxlfr"
path="res://.godot/imported/playerGrey_walk2.png-34d2d916366100182d08037c51884043.ctex"
metadata={
"vram_texture": false
}
@@ -10,26 +11,30 @@ metadata={
[deps]
source_file="res://art/playerGrey_walk2.png"
dest_files=[ "res://.import/playerGrey_walk2.png-34d2d916366100182d08037c51884043.stex" ]
dest_files=["res://.godot/imported/playerGrey_walk2.png-34d2d916366100182d08037c51884043.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/uastc_level=0
compress/rdo_quality_loss=0.0
compress/hdr_compression=1
compress/normal_map=0
flags/repeat=0
flags/filter=false
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
process/normal_map_invert_y=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1

View File

@@ -0,0 +1,36 @@
[remap]
importer="font_data_dynamic"
type="FontFile"
uid="uid://bgv586r20ps8e"
path="res://.godot/imported/Xolonium-Regular.ttf-bc2981e3069cff4c34dd7c8e2bb73fba.fontdata"
[deps]
source_file="res://fonts/Xolonium-Regular.ttf"
dest_files=["res://.godot/imported/Xolonium-Regular.ttf-bc2981e3069cff4c34dd7c8e2bb73fba.fontdata"]
[params]
Rendering=null
antialiasing=1
generate_mipmaps=false
disable_embedded_bitmaps=true
multichannel_signed_distance_field=false
msdf_pixel_range=8
msdf_size=48
allow_system_fallback=true
force_autohinter=false
modulate_color_glyphs=false
hinting=1
subpixel_positioning=4
keep_rounding_remainders=true
oversampling=0.0
Fallbacks=null
fallbacks=[]
Compress=null
compress=true
preload=[]
language_support={}
script_support={}
opentype_features={}

View File

@@ -0,0 +1,30 @@
extends CanvasLayer
signal start_game
func show_message(text):
$MessageLabel.text = text
$MessageLabel.show()
$MessageTimer.start()
func show_game_over():
show_message("Game Over")
await $MessageTimer.timeout
$MessageLabel.text = "Dodge the\nCreeps"
$MessageLabel.show()
await get_tree().create_timer(1).timeout
$StartButton.show()
func update_score(score):
$ScoreLabel.text = str(score)
func _on_StartButton_pressed():
$StartButton.hide()
start_game.emit()
func _on_MessageTimer_timeout():
$MessageLabel.hide()

View File

@@ -0,0 +1 @@
uid://c1g57034r2c0

View File

@@ -0,0 +1,61 @@
[gd_scene load_steps=5 format=3 uid="uid://b0efehuavobda"]
[ext_resource type="Script" uid="uid://c1g57034r2c0" path="res://hud.gd" id="1"]
[ext_resource type="FontFile" uid="uid://bgv586r20ps8e" path="res://fonts/Xolonium-Regular.ttf" id="2_2jm3i"]
[sub_resource type="InputEventAction" id="InputEventAction_fopy7"]
action = &"start_game"
[sub_resource type="Shortcut" id="4"]
events = [SubResource("InputEventAction_fopy7")]
[node name="HUD" type="CanvasLayer"]
script = ExtResource("1")
[node name="ScoreLabel" type="Label" parent="."]
anchors_preset = 10
anchor_right = 1.0
offset_bottom = 78.0
grow_horizontal = 2
theme_override_fonts/font = ExtResource("2_2jm3i")
theme_override_font_sizes/font_size = 60
text = "0"
horizontal_alignment = 1
[node name="MessageLabel" type="Label" parent="."]
anchors_preset = 14
anchor_top = 0.5
anchor_right = 1.0
anchor_bottom = 0.5
offset_top = -79.5
offset_bottom = 79.5
grow_horizontal = 2
grow_vertical = 2
theme_override_fonts/font = ExtResource("2_2jm3i")
theme_override_font_sizes/font_size = 60
text = "Dodge the
Creeps"
horizontal_alignment = 1
[node name="StartButton" type="Button" parent="."]
anchors_preset = 7
anchor_left = 0.5
anchor_top = 1.0
anchor_right = 0.5
anchor_bottom = 1.0
offset_left = -90.0
offset_top = -200.0
offset_right = 90.0
offset_bottom = -100.0
grow_horizontal = 2
grow_vertical = 0
theme_override_fonts/font = ExtResource("2_2jm3i")
theme_override_font_sizes/font_size = 60
shortcut = SubResource("4")
text = "Start"
[node name="MessageTimer" type="Timer" parent="."]
one_shot = true
[connection signal="pressed" from="StartButton" to="." method="_on_StartButton_pressed"]
[connection signal="timeout" from="MessageTimer" to="." method="_on_MessageTimer_timeout"]

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

View File

@@ -1,35 +0,0 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://icon.png"
dest_files=[ "res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
process/normal_map_invert_y=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.9 KiB

View File

@@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://dfklrdtaun0xt"
path="res://.godot/imported/icon.webp-e94f9a68b0f625a567a797079e4d325f.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://icon.webp"
dest_files=["res://.godot/imported/icon.webp-e94f9a68b0f625a567a797079e4d325f.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/uastc_level=0
compress/rdo_quality_loss=0.0
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1

View File

@@ -0,0 +1,57 @@
extends Node
@export var mob_scene: PackedScene
var score
func game_over():
$ScoreTimer.stop()
$MobTimer.stop()
$HUD.show_game_over()
$Music.stop()
$DeathSound.play()
func new_game():
get_tree().call_group(&"mobs", &"queue_free")
score = 0
$Player.start($StartPosition.position)
$StartTimer.start()
$HUD.update_score(score)
$HUD.show_message("Get Ready")
$Music.play()
func _on_MobTimer_timeout():
# Create a new instance of the Mob scene.
var mob = mob_scene.instantiate()
# Choose a random location on Path2D.
var mob_spawn_location = get_node(^"MobPath/MobSpawnLocation")
mob_spawn_location.progress = randi()
# Set the mob's position to a random location.
mob.position = mob_spawn_location.position
# Set the mob's direction perpendicular to the path direction.
var direction = mob_spawn_location.rotation + PI / 2
# Add some randomness to the direction.
direction += randf_range(-PI / 4, PI / 4)
mob.rotation = direction
# Choose the velocity for the mob.
var velocity = Vector2(randf_range(150.0, 250.0), 0.0)
mob.linear_velocity = velocity.rotated(direction)
# Spawn the mob by adding it to the Main scene.
add_child(mob)
func _on_ScoreTimer_timeout():
score += 1
$HUD.update_score(score)
func _on_StartTimer_timeout():
$MobTimer.start()
$ScoreTimer.start()

View File

@@ -0,0 +1 @@
uid://c4wt6ace7hycd

View File

@@ -0,0 +1,59 @@
[gd_scene load_steps=8 format=3 uid="uid://bggkaprn62fwm"]
[ext_resource type="Script" uid="uid://c4wt6ace7hycd" path="res://main.gd" id="1_0r6n5"]
[ext_resource type="PackedScene" uid="uid://cao351pllxqpa" path="res://mob.tscn" id="2_50pww"]
[ext_resource type="PackedScene" uid="uid://bwhlkliwp13p4" path="res://player.tscn" id="3_veqnc"]
[ext_resource type="PackedScene" uid="uid://b0efehuavobda" path="res://hud.tscn" id="4_0qnje"]
[ext_resource type="AudioStream" uid="uid://sgfduhhw4pno" path="res://art/House In a Forest Loop.ogg" id="5_55d8h"]
[ext_resource type="AudioStream" uid="uid://td2mgko63p61" path="res://art/gameover.wav" id="6_hp1r0"]
[sub_resource type="Curve2D" id="1"]
_data = {
"points": PackedVector2Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 480, 0, 0, 0, 0, 0, 480, 720, 0, 0, 0, 0, 0, 720, 0, 0, 0, 0, 0, 0)
}
point_count = 5
[node name="Main" type="Node"]
script = ExtResource("1_0r6n5")
mob_scene = ExtResource("2_50pww")
[node name="ColorRect" type="ColorRect" parent="."]
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
color = Color(0.219608, 0.372549, 0.380392, 1)
[node name="Player" parent="." instance=ExtResource("3_veqnc")]
[node name="MobTimer" type="Timer" parent="."]
wait_time = 0.5
[node name="ScoreTimer" type="Timer" parent="."]
[node name="StartTimer" type="Timer" parent="."]
wait_time = 2.0
one_shot = true
[node name="StartPosition" type="Marker2D" parent="."]
position = Vector2(240, 450)
[node name="MobPath" type="Path2D" parent="."]
curve = SubResource("1")
[node name="MobSpawnLocation" type="PathFollow2D" parent="MobPath"]
[node name="HUD" parent="." instance=ExtResource("4_0qnje")]
[node name="Music" type="AudioStreamPlayer" parent="."]
stream = ExtResource("5_55d8h")
[node name="DeathSound" type="AudioStreamPlayer" parent="."]
stream = ExtResource("6_hp1r0")
[connection signal="hit" from="Player" to="." method="game_over"]
[connection signal="timeout" from="MobTimer" to="." method="_on_MobTimer_timeout"]
[connection signal="timeout" from="ScoreTimer" to="." method="_on_ScoreTimer_timeout"]
[connection signal="timeout" from="StartTimer" to="." method="_on_StartTimer_timeout"]
[connection signal="start_game" from="HUD" to="." method="new_game"]

View File

@@ -0,0 +1,10 @@
extends RigidBody2D
func _ready():
var mob_types = Array($AnimatedSprite2D.sprite_frames.get_animation_names())
$AnimatedSprite2D.animation = mob_types.pick_random()
$AnimatedSprite2D.play()
func _on_VisibilityNotifier2D_screen_exited():
queue_free()

View File

@@ -0,0 +1 @@
uid://cypxpb8arjrqt

View File

@@ -0,0 +1,67 @@
[gd_scene load_steps=10 format=3 uid="uid://cao351pllxqpa"]
[ext_resource type="Script" uid="uid://cypxpb8arjrqt" path="res://mob.gd" id="1"]
[ext_resource type="Texture2D" uid="uid://dun74wipekpfq" path="res://art/enemyFlyingAlt_1.png" id="2"]
[ext_resource type="Texture2D" uid="uid://vusf51hepduk" path="res://art/enemyFlyingAlt_2.png" id="3"]
[ext_resource type="Texture2D" uid="uid://dgwhuvn7qb4iy" path="res://art/enemyWalking_1.png" id="4"]
[ext_resource type="Texture2D" uid="uid://dyw702efe6meu" path="res://art/enemyWalking_2.png" id="5"]
[ext_resource type="Texture2D" uid="uid://d182mv7y80xqy" path="res://art/enemySwimming_1.png" id="6"]
[ext_resource type="Texture2D" uid="uid://dmgglhdyowipd" path="res://art/enemySwimming_2.png" id="7"]
[sub_resource type="SpriteFrames" id="1"]
animations = [{
"frames": [{
"duration": 1.0,
"texture": ExtResource("2")
}, {
"duration": 1.0,
"texture": ExtResource("3")
}],
"loop": true,
"name": &"fly",
"speed": 3.0
}, {
"frames": [{
"duration": 1.0,
"texture": ExtResource("6")
}, {
"duration": 1.0,
"texture": ExtResource("7")
}],
"loop": true,
"name": &"swim",
"speed": 4.0
}, {
"frames": [{
"duration": 1.0,
"texture": ExtResource("4")
}, {
"duration": 1.0,
"texture": ExtResource("5")
}],
"loop": true,
"name": &"walk",
"speed": 4.0
}]
[sub_resource type="CapsuleShape2D" id="2"]
radius = 37.0
height = 100.0
[node name="Mob" type="RigidBody2D" groups=["mobs"]]
collision_mask = 0
gravity_scale = 0.0
script = ExtResource("1")
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."]
scale = Vector2(0.75, 0.75)
sprite_frames = SubResource("1")
animation = &"walk"
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
rotation = 1.5708
shape = SubResource("2")
[node name="VisibleOnScreenNotifier2D" type="VisibleOnScreenNotifier2D" parent="."]
[connection signal="screen_exited" from="VisibleOnScreenNotifier2D" to="." method="_on_VisibilityNotifier2D_screen_exited"]

View File

@@ -0,0 +1,54 @@
extends Area2D
signal hit
@export var speed = 400 # How fast the player will move (pixels/sec).
var screen_size # Size of the game window.
func _ready():
screen_size = get_viewport_rect().size
hide()
func _process(delta):
var velocity = Vector2.ZERO # The player's movement vector.
if Input.is_action_pressed(&"move_right"):
velocity.x += 1
if Input.is_action_pressed(&"move_left"):
velocity.x -= 1
if Input.is_action_pressed(&"move_down"):
velocity.y += 1
if Input.is_action_pressed(&"move_up"):
velocity.y -= 1
if velocity.length() > 0:
velocity = velocity.normalized() * speed
$AnimatedSprite2D.play()
else:
$AnimatedSprite2D.stop()
position += velocity * delta
position = position.clamp(Vector2.ZERO, screen_size)
if velocity.x != 0:
$AnimatedSprite2D.animation = &"right"
$AnimatedSprite2D.flip_v = false
$Trail.rotation = 0
$AnimatedSprite2D.flip_h = velocity.x < 0
elif velocity.y != 0:
$AnimatedSprite2D.animation = &"up"
rotation = PI if velocity.y > 0 else 0
func start(pos):
position = pos
rotation = 0
show()
$CollisionShape2D.disabled = false
func _on_body_entered(_body):
hide() # Player disappears after being hit.
hit.emit()
# Must be deferred as we can't change physics properties on a physics callback.
$CollisionShape2D.set_deferred(&"disabled", true)

View File

@@ -0,0 +1 @@
uid://6s0lxctks3qn

View File

@@ -0,0 +1,75 @@
[gd_scene load_steps=13 format=3 uid="uid://bwhlkliwp13p4"]
[ext_resource type="Script" uid="uid://6s0lxctks3qn" path="res://player.gd" id="1"]
[ext_resource type="Texture2D" uid="uid://b2aofu01vxvea" path="res://art/playerGrey_walk1.png" id="2"]
[ext_resource type="Texture2D" uid="uid://ddjou2q6gxlfr" path="res://art/playerGrey_walk2.png" id="3"]
[ext_resource type="Texture2D" uid="uid://bcow5c46vixno" path="res://art/playerGrey_up1.png" id="4"]
[ext_resource type="Texture2D" uid="uid://dw3lwgwhpbfx8" path="res://art/playerGrey_up2.png" id="5"]
[sub_resource type="SpriteFrames" id="1"]
animations = [{
"frames": [{
"duration": 1.0,
"texture": ExtResource("2")
}, {
"duration": 1.0,
"texture": ExtResource("3")
}],
"loop": true,
"name": &"right",
"speed": 5.0
}, {
"frames": [{
"duration": 1.0,
"texture": ExtResource("4")
}, {
"duration": 1.0,
"texture": ExtResource("5")
}],
"loop": true,
"name": &"up",
"speed": 5.0
}]
[sub_resource type="CapsuleShape2D" id="2"]
radius = 27.0
height = 68.0
[sub_resource type="Gradient" id="3"]
colors = PackedColorArray(1, 1, 1, 0.501961, 1, 1, 1, 0)
[sub_resource type="GradientTexture1D" id="4"]
gradient = SubResource("3")
[sub_resource type="Curve" id="5"]
_data = [Vector2(0.00501098, 0.5), 0.0, 0.0, 0, 0, Vector2(0.994989, 0.324), 0.0, 0.0, 0, 0]
point_count = 2
[sub_resource type="CurveTexture" id="6"]
curve = SubResource("5")
[sub_resource type="ParticleProcessMaterial" id="7"]
gravity = Vector3(0, 0, 0)
scale_curve = SubResource("6")
color_ramp = SubResource("4")
[node name="Player" type="Area2D"]
z_index = 10
script = ExtResource("1")
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."]
scale = Vector2(0.5, 0.5)
sprite_frames = SubResource("1")
animation = &"right"
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
shape = SubResource("2")
[node name="Trail" type="GPUParticles2D" parent="."]
z_index = -1
amount = 10
texture = ExtResource("2")
speed_scale = 2.0
process_material = SubResource("7")
[connection signal="body_entered" from="." to="." method="_on_body_entered"]

View File

@@ -6,7 +6,7 @@
; [section] ; section goes between []
; param=value ; assign values to parameters
config_version=4
config_version=5
[application]
@@ -17,52 +17,61 @@ and avoid the enemies for as long as possible.
This is a finished version of the game featured in the 'Your first 2D game'
tutorial in the documentation. For more details, consider
following the tutorial in the documentation."
run/main_scene="res://Main.tscn"
config/icon="res://icon.png"
config/tags=PackedStringArray("2d", "demo", "official")
run/main_scene="res://main.tscn"
config/features=PackedStringArray("4.5")
config/icon="res://icon.webp"
[display]
window/size/width=480
window/size/height=720
window/stretch/mode="2d"
window/stretch/aspect="keep"
window/size/viewport_width=480
window/size/viewport_height=720
window/size/window_width_override=480
window/size/window_height_override=720
window/stretch/mode="canvas_items"
[input]
move_left={
"deadzone": 0.5,
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777231,"physical_scancode":0,"unicode":0,"echo":false,"script":null)
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":65,"physical_scancode":0,"unicode":0,"echo":false,"script":null)
"deadzone": 0.2,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":65,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194319,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":14,"pressure":0.0,"pressed":false,"script":null)
, Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":0,"axis":0,"axis_value":-1.0,"script":null)
]
]
}
move_right={
"deadzone": 0.5,
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777233,"physical_scancode":0,"unicode":0,"echo":false,"script":null)
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":68,"physical_scancode":0,"unicode":0,"echo":false,"script":null)
"deadzone": 0.2,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":68,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194321,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":15,"pressure":0.0,"pressed":false,"script":null)
, Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":0,"axis":0,"axis_value":1.0,"script":null)
]
]
}
move_up={
"deadzone": 0.5,
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777232,"physical_scancode":0,"unicode":0,"echo":false,"script":null)
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":87,"physical_scancode":0,"unicode":0,"echo":false,"script":null)
"deadzone": 0.2,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":87,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194320,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":12,"pressure":0.0,"pressed":false,"script":null)
, Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":0,"axis":1,"axis_value":-1.0,"script":null)
]
]
}
move_down={
"deadzone": 0.5,
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777234,"physical_scancode":0,"unicode":0,"echo":false,"script":null)
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":83,"physical_scancode":0,"unicode":0,"echo":false,"script":null)
"deadzone": 0.2,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":83,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194322,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":13,"pressure":0.0,"pressed":false,"script":null)
, Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":0,"axis":1,"axis_value":1.0,"script":null)
]
]
}
start_game={
"deadzone": 0.5,
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777221,"physical_scancode":0,"unicode":0,"echo":false,"script":null)
]
"deadzone": 0.2,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194309,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":32,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
]
}
[rendering]
renderer/rendering_method="gl_compatibility"
renderer/rendering_method.mobile="gl_compatibility"

View File

@@ -0,0 +1,20 @@
# Dynamic TileMap Layers
Example of how to make a fake wall using TileMap's
`_tile_data_runtime_update()` method. It shows how
to disable collisions per layer.
Language: GDScript
Renderer: Compatibility
Check out this demo on the asset library: https://godotengine.org/asset-library/asset/2713
## Note
The new TileMapLayer introduced in Godot 4.3 allows disabling collisions for a layer dynamically using a checkbox in the inspector.
For earlier Godot versions use the procedure described here.
## Screenshots
![Screenshot](screenshots/fake_wall.png)

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

View File

@@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://bu5nu8i7xk5ot"
path="res://.godot/imported/icon.png-487276ed1e3a0c39cad0279d744ee560.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://icon.png"
dest_files=["res://.godot/imported/icon.png-487276ed1e3a0c39cad0279d744ee560.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/uastc_level=0
compress/rdo_quality_loss=0.0
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

View File

@@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://ddtguaos7uvsy"
path="res://.godot/imported/obstacle.png-06287f6b2d26dd03335fd87ab78c2cc2.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://level/obstacle.png"
dest_files=["res://.godot/imported/obstacle.png-06287f6b2d26dd03335fd87ab78c2cc2.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/uastc_level=0
compress/rdo_quality_loss=0.0
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1

View File

@@ -0,0 +1,51 @@
extends TileMapLayer
# You can have multiple layers if you make this an array.
var player_in_secret: bool = false
var layer_alpha := 1.0
func _ready() -> void:
set_process(false)
func _process(delta: float) -> void:
if player_in_secret:
if layer_alpha > 0.3:
# Animate the layer transparency.
layer_alpha = move_toward(layer_alpha, 0.3, delta)
self_modulate = Color(1, 1, 1, layer_alpha)
else:
set_process(false)
else:
if layer_alpha < 1.0:
layer_alpha = move_toward(layer_alpha, 1.0, delta)
self_modulate = Color(1, 1, 1, layer_alpha)
else:
set_process(false)
func _use_tile_data_runtime_update(_coords: Vector2i) -> bool:
return true
func _tile_data_runtime_update(_coords: Vector2i, tile_data: TileData) -> void:
# Remove collision for secret layer.
tile_data.set_collision_polygons_count(0, 0)
func _on_secret_detector_body_entered(body: Node2D) -> void:
if body is not CharacterBody2D:
# Detect the player only.
return
player_in_secret = true
set_process(true)
func _on_secret_detector_body_exited(body: Node2D) -> void:
if body is not CharacterBody2D:
return
player_in_secret = false
set_process(true)

View File

@@ -0,0 +1 @@
uid://bu8761rfem0qo

View File

@@ -0,0 +1,32 @@
extends CharacterBody2D
const WALK_FORCE = 600
const WALK_MAX_SPEED = 200
const STOP_FORCE = 1300
const JUMP_SPEED = 200
@onready var gravity: float = ProjectSettings.get_setting("physics/2d/default_gravity")
func _physics_process(delta: float) -> void:
# Horizontal movement code. First, get the player's input.
var walk := WALK_FORCE * (Input.get_axis(&"move_left", &"move_right"))
# Slow down the player if they're not trying to move.
if abs(walk) < WALK_FORCE * 0.2:
# The velocity, slowed down a bit, and then reassigned.
velocity.x = move_toward(velocity.x, 0, STOP_FORCE * delta)
else:
velocity.x += walk * delta
# Clamp to the maximum horizontal movement speed.
velocity.x = clamp(velocity.x, -WALK_MAX_SPEED, WALK_MAX_SPEED)
# Vertical movement code. Apply gravity.
velocity.y += gravity * delta
# Move based on the velocity and snap to the ground.
# TODO: This information should be set to the CharacterBody properties instead of arguments: snap, Vector2.DOWN, Vector2.UP
# TODO: Rename velocity to linear_velocity in the rest of the script.
move_and_slide()
# Check for jumping. is_on_floor() must be called after movement code.
if is_on_floor() and Input.is_action_just_pressed(&"jump"):
velocity.y = -JUMP_SPEED

View File

@@ -0,0 +1 @@
uid://brtb2376s322w

View File

Before

Width:  |  Height:  |  Size: 502 B

After

Width:  |  Height:  |  Size: 502 B

View File

@@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://gewi7do50xix"
path="res://.godot/imported/player.png-1ad27fc2a62fa126eae918723933dd6f.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://player/player.png"
dest_files=["res://.godot/imported/player.png-1ad27fc2a62fa126eae918723933dd6f.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/uastc_level=0
compress/rdo_quality_loss=0.0
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1

Some files were not shown because too many files have changed in this diff Show More