Compare commits

..

624 Commits
3.0 ... 3.x

Author SHA1 Message Date
Benjamin Navarro
fe1ccaea77 [3.x] Add a 2D version of the dynamic split screen demo (#762)
* add a 2D version of the dynamic split screen demo

* refactor the dynamic split screen demo

 - both 2D and 3D scenes have the exact same hierarchy
 - a single camera_controller.gd script instead of one per mode
 - the third viewport for 2D mode has been removed
2025-10-02 17:03:12 -07:00
Aaron Franke
ec368a812b [3.x] Simplify list of branches in the README (#1255) 2025-10-02 15:41:09 -07:00
Aaron Franke
0a826508da [3.x] Delete HTML5 export workflow 2025-10-02 14:39:52 -07:00
Aaron Franke
a2d63288fa [3.x] Update file formatting CI checks to Ubuntu 24.04 2025-10-02 14:39:01 -07:00
Hugo Locurcio
aae565b34a [3.x] Enable physics interpolation in all demos that use physics (#1069)
This also improves visuals in the Voxel and Dynamic Split Screen demos,
and fixes splitscreen mode in the Platformer 2D demo.

Most demos (other than physics tests) have also had their physics FPS
increased to 120. This is done consistency with 4.x, but also for the
benefits it still provides when interpolation are enabled
(lower input lag, more stable simulation).
2024-11-22 16:57:10 +01:00
Hugo Locurcio
d52d430af7 Add a 2D polygons and lines demo (#855) 2024-06-06 00:15:33 +02:00
Hugo Locurcio
bfcd81aa85 Fix file format checks 2023-05-10 02:57:43 +02:00
valentinas
cdffdc025f Remake art assets of the 2D Isometric Game demo 2023-05-10 02:51:20 +02:00
valentinas
ed3e2a1635 Remake art assets of the 2D Role Playing Game demo 2023-05-10 02:43:34 +02:00
valentinas
e292b09d9e Remake art assets of the 2D Grid-based Navigation with Astar demo 2023-05-10 02:30:57 +02:00
valentinas
c17d803a1b Remake art assets of the 2D platformer demo 2023-05-10 02:21:05 +02:00
Rémi Verschelde
c0180d20d1 Update README for new branches, matches Godot upstream 2023-02-28 18:32:32 +01:00
Rémi Verschelde
edee4413e3 CI: Run HTML5 export workflow on 3.x branch only 2023-02-28 17:36:23 +01:00
Rémi Verschelde
3a23fdbe6a Merge pull request #795 from Faless/ws/3.x_fix_disconnect
[3.x] [WebSocket] Fix peer disconnection not closing the network layer.
2023-02-28 16:48:34 +01:00
smix8
c8bb3b874a Rework basic 2D navigation demo for Godot 3.5 and later (#765)
Co-authored-by: Hugo Locurcio <hugo.locurcio@hugo.pro>
2023-02-24 23:41:40 +01:00
dev-gilbride
c8f0706055 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:22:48 +01:00
David Briscoe
ccc4354331 Convert 3D navmesh demo to use NavigationAgents (#806)
Co-authored-by: smix8 <52464204+smix8@users.noreply.github.com>
2023-02-24 17:57:50 +01:00
pseidemann
1849640ff8 opensimplexnoise: Fix persistence, tweak documentation URL and layout (#791) 2023-02-22 19:31:51 +01:00
Aaron Franke
3ae7f01a23 Merge pull request #837 from Vilcrow/pong-screen-size-stable
Fixed that the paddles can cross the floor if you run the "Pong" game in the i3 window manager.
2023-01-30 19:49:42 -06:00
S.V.I. Vilcrow
690dd395fd Fixed that the paddles can cross the floor if you run the "Pong" game in the i3 window manager. 2023-01-31 04:24:20 +03:00
Aaron Franke
f85f8b2b4d Merge pull request #831 from moth-boi/master
Fix bomb collisions through walls on 3.5
2023-01-24 17:51:58 -06:00
MotH
7ddaf29f8d Fix bomb collisions through walls 2023-01-24 22:22:15 +01:00
Aaron Franke
b626d3e628 Merge pull request #829 from aaronfranke/readme-post-9e68af3
Update multiple resolutions README with an asset library link
2023-01-23 18:09:44 -06:00
Aaron Franke
a39928fc55 Update multiple resolutions README with an asset library link 2023-01-23 18:06:07 -06:00
M o t H
9e68af38d9 Update projects to Godot 3.5 (#827) 2023-01-23 18:24:56 +01:00
Hugo Locurcio
4357b5b620 Improve 3D global illumination demo (3.x) (#759) 2023-01-17 21:42:16 +01:00
Drikus Roor
24519e58a8 Fix misleading comment in WebRTC Signaling (#812) 2023-01-06 23:09:14 +01:00
Heus-Sueh
219e37b592 Update 4.0 status to beta in the README (#804) 2022-12-10 22:52:00 +01:00
Fabio Alessandrelli
fe6f646c9d [WebSocket] Fix peer disconnection not closing the network layer.
We were removing it from the MultiplayerAPI but not immediately
destroying it (to avoid tricky in-signal de-referencing).
We still need to properly close the connection in this case if we want
the remote peer to be notified immediately.
2022-11-24 17:45:11 +01:00
Rémi Verschelde
06bdeb97dc Clarify that master here tracks 3.x upstream (#764) 2022-08-05 11:42:08 +02:00
Aaron Franke
b1f9f2da48 Merge pull request #720 from Calinou/2d-sprite-shaders-improve-appearance
Improve visual appearance in the 2D Sprite Shaders demo
2022-07-10 18:52:23 -05:00
Hugo Locurcio
d7c7e4ede3 Improve visual appearance in the 2D Sprite Shaders demo
- Scale the sprites up so they take a larger portion of the window.
- Enable mipmaps on the sprite to avoid artifacts at low resolutions.
2022-07-10 18:48:33 -05:00
Aaron Franke
0550497e60 Merge pull request #754 from HaywardMorihara/2d-platformer-pause-comment-update
Docs: 2D Platformer - Update Pause Mode Comments
2022-07-10 17:14:48 -05:00
HaywardMorihara
5c13d21260 Docs: 2D Platformer - Update Pause Mode Comments
I believe this comment got out-of-date (based on the fact that the `Stage` scene seems like something that was in an older version of the demo: 81441c42b7/2d/platformer/Stage.tscn), so updated the commment to reflect the current state of the demo, along with some other information that I thought a developer might find helpful.
2022-07-10 14:34:36 -04:00
Aaron Franke
2f60828e6e Merge pull request #750 from bend-n/patch-2
Fix typos in `webrct_signalling/README.md`
2022-06-15 00:34:54 -04:00
bendn
61d9e0f1ab Fix typos in webrct_signalling/README.md
number 2, fix of #749
2022-06-15 09:48:06 +07:00
Aaron Franke
cd72b05a7d Merge pull request #739 from voylin/FixGuiInputMappingPersistenceKeyMaps3.x
[3.x] GUI Input Mapping Demo Persistent Key Mapping- Fixes #629
2022-05-07 17:04:57 -05:00
Voylin
69758f2523 Fixes #629
Update gui/input_mapping/KeyPersistence.gd

Co-authored-by: Aaron Franke <arnfranke@yahoo.com>
Update gui/input_mapping/KeyPersistence.gd

Co-authored-by: Aaron Franke <arnfranke@yahoo.com>
Update gui/input_mapping/KeyPersistence.gd

Co-authored-by: Aaron Franke <arnfranke@yahoo.com>
2022-05-08 06:55:30 +09:00
Aaron Franke
0f848370fe Merge pull request #729 from voylin/master
Including *.json files to fix #725
2022-05-01 19:13:15 -05:00
Voylin
4618c9b04e Including *.json files to fix #725
There is a problem with the automatically exported HTML5 demos. When they use json files for dialogue by example, as in the JRPG demo, the game gets errors as it can't load those specific *.json files.
Update export_presets.cfg
2022-05-02 09:07:14 +09:00
Aaron Franke
6ddead591a Merge pull request #721 from Calinou/add-multiple-resolutions-demo
Add a demo on supporting multiple resolutions and aspect ratios
2022-04-25 00:05:44 -04:00
Aaron Franke
6eec19b9af Merge pull request #723 from Calinou/multiplayer-pong-tweak-icon
Tweak Multiplayer Pong demo icons to be different from singleplayer
2022-04-19 19:11:56 -05:00
Hugo Locurcio
935e9bbc44 Tweak Multiplayer Pong demo icons to be different from singleplayer
This makes for easier visual grepping after importing all demos
in the project manager.
2022-04-20 00:52:58 +02:00
Hugo Locurcio
59d443e889 Add a demo on supporting multiple resolutions and aspect ratios
This demo intends to showcase what Godot can do in terms of supporting
multiple resolutions and aspect ratios.
2022-04-19 19:59:55 +02:00
Aaron Franke
2e40f67b1b Merge pull request #689 from aaronfranke/readme-post-b0d4a7c
Update README files after release 3.4-b0d4a7c
2022-03-26 04:52:20 -05:00
Aaron Franke
f1de905f87 Update README files after release 3.4-b0d4a7c 2022-03-26 04:42:06 -05:00
Aaron Franke
b0d4a7cb8a Fix incorrect title in README of RigidBody Character 3D 2022-03-26 03:41:48 -05:00
alan-man
fed698d0d2 Add a 3D Rigidbody character demo (#675) 2022-03-24 17:43:39 -05:00
ScorpionInc
db01a216fd Add axis label highlighting to the Joypads demo (#684)
Co-authored-by: Aaron Franke <arnfranke@yahoo.com>
Co-authored-by: Hugo Locurcio <hugo.locurcio@hugo.pro>
2022-03-23 19:50:43 +01:00
cubeface
b46a823342 2d platformer gun cooldown fix (#686)
Restart cooldown timer when gun has fired
2022-03-20 23:42:04 -05:00
Aaron Franke
2190128fd3 Merge pull request #687 from rburing/set_physics_params_before_spawn
Dodge the Creeps: Set the physics parameters of the mob before adding it to the scene tree
2022-03-13 15:09:50 -05:00
Ricardo Buring
9e096b1c89 Dodge the Creeps: Set the physics parameters of the mob before adding it to the scene tree
This follows the recommendation from https://github.com/godotengine/godot/issues/45638
2022-03-13 18:07:45 +01:00
Aaron Franke
14580c55ac Merge pull request #685 from godotengine/dependabot/github_actions/actions/checkout-3
Bump actions/checkout from 2 to 3
2022-03-01 13:10:07 -06:00
dependabot[bot]
076b0453c6 Bump actions/checkout from 2 to 3
Bumps [actions/checkout](https://github.com/actions/checkout) from 2 to 3.
- [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/v2...v3)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-01 19:05:17 +00:00
Aaron Franke
6b983c0542 Merge pull request #678 from ScorpionInc/master
Added Alpha effect to joystick indicators
2022-02-24 15:21:18 -06:00
ScorpionInc
07d6c311d7 Added alpha effect to joypad axis indicators
Added alpha effect to joypad demo's axis and analog trigger indicators via the CanvasItem's self modulate property.
2022-02-23 15:02:41 +01:00
Aaron Franke
58c337c33c Merge pull request #683 from rubynho/fix/broken_links
Fix broken links for the your first 2D game tutorial
2022-02-17 12:28:02 -06:00
rubynho
aeb2d7b8d5 Fix tutorial name in the Dodge the Creeps project description
The description was referencing the old tutorial by the name "Your first game",
but since then the name has changed to "Your first 2D game".
2022-02-16 21:08:44 -03:00
rubynho
b0fdd8cf76 Fix broken links for the your first 2D game tutorial
The link was sending to a not found page because the "Your first game" tutorial
was moved to the "Your first 2D game" one.
2022-02-16 21:05:17 -03:00
Aaron Franke
fbde23fbb0 Merge pull request #682 from aaronfranke/2022
Update copyright year to 2022
2022-02-14 01:54:44 -06:00
Aaron Franke
3f507c0363 Update copyright year to 2022 2022-02-14 01:51:20 -06:00
Aaron Franke
a2979d237b Merge pull request #681 from aaronfranke/global-no-web
Don't export global illumination demo to HTML5
2022-02-13 19:13:51 -06:00
Aaron Franke
9d67db049a Don't export global illumination demo to HTML5 2022-02-13 16:15:24 -06:00
Aaron Franke
851f486a48 Merge pull request #674 from aaronfranke/midi-piano
Add a MIDI Piano Demo
2022-02-13 15:38:38 -06:00
Aaron Franke
be43d1644b Add MIDI Piano Demo 2022-02-13 15:30:55 -06:00
Aaron Franke
75505ca79f Merge pull request #680 from aaronfranke/misc
Misc minor fixes
2022-02-13 15:30:25 -06:00
Aaron Franke
7c8b9962ca Misc minor fixes 2022-02-13 15:08:58 -06:00
Aaron Franke
149cfcb995 Merge pull request #656 from Calinou/switch-more-demos-to-gles2
Switch 2D Platformer and Multiplayer Bomber demos to GLES2
2022-02-13 13:43:44 -06:00
Aaron Franke
7611baf52e Merge pull request #659 from natetrost/master
Update Android IAP sample to work with v1.1 of PBL plugin
2022-02-13 13:07:10 -06:00
Aaron Franke
efd3a46331 Merge pull request #679 from Calinou/add-global-illumination-demo-2
Add a global illumination demo
2022-02-13 13:05:40 -06:00
Aaron Franke
4c0cb41a0e Merge pull request #672 from Calinou/3d-kinematic-character-remove-giprobe
Remove GIProbe from 3D Kinematic Character demo to improve performance
2022-02-13 12:58:30 -06:00
Hugo Locurcio
f6594e9923 Add a global illumination demo
This demonstrates the visual difference between GIProbe,
BakedLightmap and ReflectionProbe.
2022-01-25 18:18:47 +01:00
Hugo Locurcio
4a832ad714 Remove GIProbe from 3D Kinematic Character demo to improve performance
GIProbe is very demanding on integrated graphics and old/low-end GPUs,
which gave a poor first impression of Godot when running that demo.
2021-12-14 11:39:52 +01:00
Hugo Locurcio
0200ba6c95 Merge pull request #664 from seancwall/change-2d-creeps-start-button-shortcut 2021-12-13 21:22:33 +01:00
Sean Wall
0fc59325ab Change start button shortcut to ui_accept 2021-12-01 20:17:38 -05:00
Hugo Locurcio
eba852bbde Switch 2D Platformer and Multiplayer Bomber demos to GLES2
This allows those demos to run on a greater range of devices.

Particles2D nodes were converted to CPUParticles2D for compatibility
with GLES2.

Physics-Based 2D Platformer demo now uses the same stretch mode
as 2D Platformer for consistency.
2021-11-17 19:39:39 +01:00
Hugo Locurcio
f82dd94089 Merge pull request #662 from benjarmstrong/mic_record_freeze_fix 2021-11-11 16:08:07 +01:00
Benjamin Armstrong
3e9e2079a7 Fix stall when playing recorded audio 2021-11-12 01:24:55 +11:00
Aaron Franke
585455e67c Merge pull request #639 from aaronfranke/godot3.4
Upgrade demos to Godot 3.4
2021-11-05 13:01:54 -04:00
Aaron Franke
b7e0a470c7 Update demos to Godot 3.4 2021-11-05 11:48:47 -05:00
Aaron Franke
53ea602c07 Update README for the new 3.3 branch 2021-11-05 10:15:06 -05:00
Aaron Franke
874d3bcc33 Merge pull request #657 from Calinou/allow-fallback-gles2
Allow 3D demos to fallback to GLES2
2021-11-05 11:07:01 -04:00
Hugo Locurcio
cbb5c94c6f Allow 3D demos to fallback to GLES2
A GLES2-specific tweak is now documented for the GUI in 3D demo.

This also tweaks shadow quality and performance to find a better
balance and result in smoother shadows, including when using GLES2
(thanks to the use of PCF13 shadow filter mode).

In demos that allow falling back to GLES2, ETC1 texture import
is enabled to allow exporting to Android or HTML5 without having
to tweak anything.
2021-11-05 09:57:51 -05:00
Nate Trost
87cfcb7a4f Update Android IAP demo for v1.1 of PBL plugin
Minor update to reflect an API change in v1.1 of the
Google Play Billing Library plugin.

The queryPurchases function changed to be asyncronous,
added a query_purchases_response callback to process
the results.

This change is dependent on the contents of:
https://github.com/godotengine/godot-google-play-billing/pull/25
2021-11-02 15:53:54 -05:00
Aaron Franke
44aefaecb6 Merge pull request #655 from Calinou/bullet-shower-no-check-collision-with-other-bullets
Don't check bullet collision with other bullets in the Bullet shower demo
2021-10-26 10:33:38 -04:00
Hugo Locurcio
7a7af4cf4e Don't check bullet collision with other bullets in the Bullet shower demo
This improves performance by reducing the number of collision checks
that need to be done.
2021-10-25 23:16:29 +02:00
Rémi Verschelde
1916f87ac5 Merge pull request #654 from aaronfranke/circlepop-noready 2021-10-15 21:54:09 +02:00
Aaron Franke
36e8b45bd4 Remove useless "_ready" in the Circle Pop demo 2021-10-15 14:35:14 -05:00
Rémi Verschelde
89b64e33e2 CI: Ping actions/checkout@v2, no need to be more specific 2021-10-15 21:20:16 +02:00
Gunnar Ahlberg
2b10e6724e Fix leaked object - Label (#648)
This fixes a warning of leaked instances.
2021-09-13 00:05:26 -05:00
Hugo Locurcio
b9685cb369 Merge pull request #645 from Calinou/use-remotesync-keyword
Use `remotesync` instead of the deprecated `sync` in networking demos
2021-08-29 17:09:25 +02:00
Hugo Locurcio
d1f25ca4aa Use remotesync instead of the deprecated sync in networking demos
The `sync` keyword has been deprecated since Godot 3.1.
2021-08-29 12:22:37 +02:00
Aaron Franke
11a72411cc Merge pull request #644 from Calinou/ci-update-to-godot-3.3.3
GitHub Actions: Update to Godot 3.3.3 for HTML5 deployment
2021-08-22 14:55:44 -05:00
Hugo Locurcio
5057fcff50 GitHub Actions: Update to Godot 3.3.3 for HTML5 deployment 2021-08-22 11:56:01 +02:00
Aaron Franke
d791cd9bda Merge pull request #643 from shahediqbal13/mono-iap-signal-mismatch
Google play billing method signature mismatch in demo with Godot's android billing plugin method
2021-08-18 18:46:42 -04:00
Shahed Iqbal
7d7c728227 Fixes following issues:
1. Google play billing method(OnGodotGooglePlayBilling_sku_details_query_error) signature in GooglePlayBilling class doesn't match with Godot's android library exposed method
Check: https://github.com/godotengine/godot-google-play-billing/blob/master/godot-google-play-billing/src/main/java/org/godotengine/godot/plugin/googleplaybilling/GodotGooglePlayBilling.java
Line: 236.

2. "OnConnectError" method signature mismatch
2021-08-19 03:23:44 +06:00
Aaron Franke
5fb81434e7 Merge pull request #642 from nathanfranke/opensimplexnoise-improvements
Simplify and improve OpenSimplexNoise viewer
2021-08-18 00:05:26 -04:00
Nathan Franke
c3c4fdf4fa Simplify and improve OpenSimplexNoise viewer 2021-08-17 23:02:55 -05:00
Aaron Franke
9ea18370d3 Add link to the Godot Asset Library for Skeleton2D 2021-08-17 21:03:15 -05:00
Aaron Franke
f9333dce01 Merge pull request #640 from shahediqbal13/mono-iap-signal-mismatch
Mono IAP signal method definition mismatch.
2021-08-17 21:24:11 -04:00
Aaron Franke
84a87a5128 Merge pull request #641 from aaronfranke/desc
Ensure most demos have descriptions and screenshots
2021-08-17 20:49:22 -04:00
Aaron Franke
7d64830cfe Ensure most demos have descriptions and screenshots 2021-08-16 21:13:06 -05:00
Shahed Iqbal
f08916c90f Mono IAP signal method definition mismatch. Updated OnPurchaseConsumptionError() method to match with GooglePlayBilling's signal 2021-08-15 02:48:05 +06:00
Aaron Franke
89978a7421 Merge pull request #636 from Powerbyte7/patch-1
Fix jumps in scale and rotation when pinching
2021-07-18 11:19:48 -07:00
Powerbyte7
6ca2a45a21 Fix jumps in scale and rotation when pinching
When pressing with two fingers at once and pinching,  an old coordinate contained in the curr_state dictionary gets added to the base_state dictionary, which causes unintended jumps in both scale and rotation. By clearing base_state the script functions as intended.
2021-07-18 17:00:59 +02:00
Agnis "NeZvērs" Aldiņš
57f8628b50 Update impact, rigid groundcheck, moving platform (#634) 2021-07-17 13:00:51 -04:00
Aaron Franke
a4e8231f5a Merge pull request #635 from aaronfranke/tweaks
Minor tweaks to Pong and Dodge the Creeps
2021-07-12 13:15:01 -07:00
Aaron Franke
f71816ed31 Minor tweaks to Pong and Dodge the Creeps 2021-07-11 13:08:01 -04:00
Aaron Franke
ef069d49ae Merge pull request #632 from aaronfranke/fsm-bullets
Fix bullets in the Finite State Machine demo
2021-07-06 20:34:41 -04:00
Aaron Franke
742ea87708 Merge pull request #633 from starptr/master
Use the Jump sound already present in the Platformer 2D demo
2021-07-06 20:32:50 -04:00
Yuto Nishida
45f5417822 Add jump sound effect 2021-07-06 16:40:15 -07:00
Aaron Franke
f28a09ea0d Fix bullets in the Finite State Machine demo 2021-07-05 01:09:50 -04:00
Aaron Franke
85c1805d33 Merge pull request #631 from aaronfranke/not
Use "not" instead of the exclamation mark in GDScript files
2021-07-05 01:00:28 -04:00
Aaron Franke
7e129db12e Use "not" instead of the exclamation mark in GDScript files
Also add String casts
2021-07-04 03:46:21 -04:00
Aaron Franke
7bfc57d1ae Merge pull request #628 from aaronfranke/skeleton2d
Add a Skeleton2D demo
2021-06-25 19:19:26 -04:00
Aaron Franke
cd48c9a9cc Add a Skeleton2D demo 2021-06-25 19:12:53 -04:00
Rémi Verschelde
244b759787 Merge pull request #627 from aaronfranke/no-builtin-e
Replace built-in scripts and delete strange "e" scripts
2021-06-21 20:57:16 +02:00
Aaron Franke
6875a21545 Replace built-in scripts and delete strange "e" scripts 2021-06-21 12:33:42 -04:00
Aaron Franke
694ee7fa36 Merge pull request #626 from aaronfranke/jrpg-simplify
Vastly simplify the JRPG demo
2021-06-21 12:22:44 -04:00
Aaron Franke
6e3db7c64d Vastly simplify the JRPG demo 2021-06-20 22:47:24 -04:00
Agnis "NeZvērs" Aldiņš
2d4d23302a 3D physics tests - Moving platform (#623) 2021-06-09 20:57:49 -04:00
Aaron Franke
4456027f91 Merge pull request #625 from aaronfranke/3d2d-robot
Simplify 3D robot in the 3D in 2D demo
2021-06-07 09:40:49 -04:00
Aaron Franke
19312b2899 Simplify 3D robot in the 3D in 2D demo 2021-06-06 23:28:53 -04:00
Aaron Franke
ca17967de1 Merge pull request #622 from aaronfranke/waypoint-camera-current
Have waypoints check if the camera is current
2021-05-29 03:19:57 -04:00
Aaron Franke
491fb265b1 Have waypoints check if the camera is current
If not, get the current camera.
2021-05-29 03:16:07 -04:00
Agnis "NeZvērs" Aldiņš
08be1b7f03 Additional 3D physics tests - RigidBody impact and ground check (#619)
Co-authored-by: Camille Mohr-Daurat <pouleyKetchoup@gmail.com>
2021-05-29 02:58:01 -04:00
Aaron Franke
4ef90a836a Merge pull request #621 from nellodotca/master
Fixed project settings to match tutorial
2021-05-24 21:09:43 -04:00
nello
bfd903a933 Fixed project settings to match tutorial 2021-05-24 19:14:12 -03:00
Aaron Franke
e0db0b8f6d Merge pull request #615 from nekomatata/physics-tests-draw-shape-clean
Fix hack to draw shapes in 3D physics tests
2021-05-19 15:45:22 -04:00
PouleyKetchoupp
4d21951b71 Fix hack to draw shapes in 3D physics tests
Using Shape::get_debug_mesh instead of the previous hack to draw a mesh
instance based on a collision shape.
2021-05-05 13:41:51 -07:00
Aaron Franke
7656c08454 Merge pull request #614 from aaronfranke/gridmap-perf
Improve performance in GridMap demos by adjusting octant size
2021-05-04 15:22:10 -04:00
Aaron Franke
e894e4655a Improve performance in GridMap demos 2021-05-04 02:48:32 -04:00
Aaron Franke
2ce76ff4e5 Update web deploy CI to use Godot 3.3 2021-04-24 04:20:39 -04:00
Aaron Franke
e5d829eb8f Merge pull request #613 from nekomatata/physics-tests-contacts-update
Update contact tests in physics tests for 2D & 3D
2021-04-24 02:32:19 -05:00
PouleyKetchoupp
7f025e000e Update contact tests in physics tests for 2D & 3D
- Create bodies by duplicating the ones from the scene to allow custom
settings on them for testing purpose
- Rename 3D test with multiple groups of bodies "Contact Islands"
instead of "Contacts Extended" for clarity
- Added "Contact Islands" test for 2D
- Fixed log spamming with "Contact Islands" tests due to printing log
messages for each group of bodies
- Added parameter to randomize spawn positions in order to make
contact separation more balanced (avoids artifacts like a huge column
for circles in 2D test)
- Using smaller shapes and larger amount of objects by default to test
more extreme case
2021-04-21 18:25:35 -07:00
Aaron Franke
5132941a84 Merge pull request #612 from nekomatata/physics-tests-3.3
Physics Tests 3.3 update
2021-04-21 19:51:44 -05:00
PouleyKetchoupp
ef265cca0a Physics Tests 3.3 update
Fix custom collision shape drawing in physics tests:
CollisionShape debug draw has changed in 3.3 and now requires a body
to be rendered, so the trick to display custom physics shapes in the
physics tests had to be updated.

Cylinder support:
Now cylinders are supported in Godot Physics, so the exception to avoid
spamming errors when cylinders are used can be removed.

Rigid body picking:
Added mouse-picking to Test Shapes in both 2D and 3D.
2021-04-21 16:50:33 -07:00
Aaron Franke
31bb09233b Update the OS test demo for Godot 3.3 2021-04-21 19:30:53 -04:00
Aaron Franke
57f5e0835d Merge pull request #558 from aaronfranke/update-3.2.4
Update projects to Godot 3.3
2021-04-21 18:20:01 -05:00
Aaron Franke
814909538f Update projects to Godot 3.3 2021-04-21 19:17:12 -04:00
Rémi Verschelde
94ec2ea5d9 Merge pull request #607 from aaronfranke/3.2-readme
Update README for the new 3.2 branch
2021-04-21 09:57:08 +02:00
Aaron Franke
40aec7c068 Update README for the new 3.2 branch 2021-04-14 13:46:19 -04:00
Aaron Franke
ead2777f48 Merge pull request #606 from nekomatata/physics-tests-contacts-update
Updated 2d/3d physics contact performance tests
2021-04-14 12:34:24 -05:00
PouleyKetchoupp
0a0d44d4f1 Updated 2d/3d physics contact performance tests 2021-04-14 08:19:10 -07:00
Aaron Franke
4911866f3d Merge pull request #604 from waimus/os_midi_scan_fix
Fix MIDI devices scanning
2021-04-05 16:51:00 -04:00
waimus
d7e1052205 Fix MIDI devices scanning 2021-04-06 03:10:33 +07:00
Aaron Franke
8e2dbf3f55 Merge pull request #602 from aaronfranke/etc
Use ETC instead of ETC2 for all GLES2 demos
2021-03-30 02:31:43 -04:00
Aaron Franke
2ee9b47f6c Use ETC instead of ETC2 for all GLES2 demos 2021-03-29 18:30:14 -04:00
Aaron Franke
d8dc94c1ff Merge pull request #601 from aaronfranke/ternary-volume
Use fewer ternary operators and decrease volume of Platformer 2D
2021-03-29 18:29:28 -04:00
Aaron Franke
d989bf6209 Use fewer ternary operators and decrease volume of Platformer 2D 2021-03-28 22:03:03 -04:00
Aaron Franke
021070215c Merge pull request #595 from dalexeev/bullet-shower-improve
Small improvement for Bullet Shower Demo
2021-03-26 20:20:31 -07:00
Aaron Franke
ac61cba05b Merge pull request #597 from aaronfranke/joy-24
Handle up to 24 joypad buttons in the Joypads demo
2021-03-15 04:34:12 -04:00
Aaron Franke
21e829416f Handle up to 24 joypad buttons in the Joypads demo 2021-03-13 23:28:22 -04:00
Danil Alexeev
cf7e4b31f4 Small improvement for Bullet Shower Demo 2021-03-13 21:04:13 +03:00
Aaron Franke
dc5c1016ce Merge pull request #594 from aaronfranke/assetlib-5c154da
Add links to the Asset Library after release 3.2-5c154da
2021-03-11 21:56:54 -08:00
Aaron Franke
8a0824a948 Add links to the Asset Library after release 3.2-5c154da
Also expand the CODEOWNERS file
2021-03-12 00:32:11 -05:00
Aaron Franke
5c154dac25 Merge pull request #593 from nekomatata/physics-tests-cancel-fix
Physics test cases, cancel previous running test properly
2021-03-09 18:49:38 -05:00
PouleyKetchoupp
7f095a6092 Physics test cases, cancel previous running test properly
Allows canceling running test cases (including all tests cases) properly and without error.
2021-03-08 12:27:13 -07:00
Aaron Franke
35687c3ead Merge pull request #592 from aaronfranke/kine-char-3d-pos
Set the reset position from the initial start position in KC3D
2021-03-03 14:55:35 -05:00
Aaron Franke
f91fe01f3e Set the reset position from the initial start position in KC3D 2021-03-03 14:41:44 -05:00
Aaron Franke
43d29bfbbb Merge pull request #591 from aaronfranke/misc
Misc improvements and tweaks for 3.2.3
2021-03-03 14:19:31 -05:00
Aaron Franke
7dff4e748d Merge pull request #590 from aaronfranke/kine-char-3d
Improve the Kinematic Character 3D demo
2021-03-03 14:18:33 -05:00
Aaron Franke
4913cd868a Misc fixes and tweaks 2021-03-03 02:59:17 -05:00
Aaron Franke
973c12264c Improve the Kinematic Character 3D demo 2021-03-03 02:55:05 -05:00
Aaron Franke
fecbed5fb2 Merge pull request #586 from Calinou/improve-demo-configuration
Improve several demos' configuration
2021-03-02 18:25:05 -05:00
Aaron Franke
82e68e378b Merge pull request #589 from Calinou/improve-3d-platformer-demo
Improve the 3D platformer demo
2021-03-02 18:22:31 -05:00
Aaron Franke
bbf4cff5f7 Merge pull request #588 from Calinou/readd-bullet-shower-demo
Port the Bullet Shower demo from Godot 2.1
2021-03-02 18:22:23 -05:00
Hugo Locurcio
3d6ba65cfc Improve the 3D platformer demo
- Increase gravity, player speed and air acceleration for a less floaty
  feeling.
- Clean up the code to use constants when relevant and remove unused enums.
2021-03-02 19:36:25 +01:00
Hugo Locurcio
ca0f74ee44 Port the Bullet Shower demo from Godot 2.1
This demo showcases how to use low-level Servers to achieve better
CPU performance when drawing large amounts of objects.

The code has been updated for Godot 3.2, cleaned up and has received
additional comments.
2021-03-02 18:32:01 +01:00
Hugo Locurcio
aa65867e43 Improve several demos' configuration
- Enable anisotropic filtering in 3D demos, and set the quality to
  16× on desktop and 4× on mobile.
- Enable 4× MSAA on some 3D demos that didn't use it beforehand.
- On GLES3 demos, disable MSAA on mobile as these demos are often
  more demanding.
- Use more conservative framebuffer allocation settings for better
  performance.
- Use PCF13 shadow filtering in GLES2 demos on desktop to benefit
  from soft shadows in Godot 3.2.4 and later.
  In Godot 3.2.3, this will make shadows smoother but still "blocky".
- Use Lossless compression instead of VRAM compression for
  small textures such as the voxel demo texture atlas.
2021-02-28 22:28:44 +01:00
Aaron Franke
c2e7a30e42 Merge pull request #587 from aaronfranke/web-readme
Link to the web export in the README and format names nicer
2021-02-28 16:18:29 -05:00
Aaron Franke
4dbfd92e6f Link to the web export in the README and format names nicer 2021-02-28 15:50:59 -05:00
Aaron Franke
c0d9e483c2 Merge pull request #582 from Calinou/deploy-html5-demos
Deploy exported HTML5 demos to GitHub Pages
2021-02-27 23:16:36 -05:00
Hugo Locurcio
36db05c3b9 Deploy exported HTML5 demos to GitHub Pages
This makes it possible for users to test Godot's features without
having to download anything.
2021-02-28 05:12:06 +01:00
ThomasFederau
fc032119ca Added interpolation functionality to ik_look_at node (#585) 2021-02-26 22:29:47 -05:00
Aaron Franke
98ed996780 Merge pull request #584 from nekomatata/physics-tests-2d-character-update
Updated 2D character controller physics tests
2021-02-26 09:25:58 -05:00
PouleyKetchoupp
fa83ee0277 Updated 2D character controller physics tests
Added new test for 2D character controller:
Character - Pixels
Functional test for pixel art related issues around KinematicBody and
RigidBody character controllers.

Adjusted existing tests and added more test cases to cover most use
cases from recent fixed issues and regressions for KinematicBody.

Added a more automated way to run all tests with checks to see which
ones failed in character controller tests.

Also fixed some minor issues with the log scrollbar.
2021-02-22 20:09:43 -07:00
Aaron Franke
7c137510e7 Merge pull request #583 from aaronfranke/trucktown-force-spedometer
Use a higher engine force when slow and add a spedometer in Truck Town
2021-02-22 21:46:03 -05:00
Aaron Franke
10a7e3d301 Use a higher engine force when slow and add a spedometer in Truck Town
Co-authored-by: Hugo Locurcio <hugo.locurcio@hugo.pro>
2021-02-22 13:56:17 -05:00
Aaron Franke
feaf406fee Merge pull request #581 from Calinou/truck-town-improve-controls-camera
Improve controls and camera handling in the Truck Town demo
2021-02-22 13:46:05 -05:00
Hugo Locurcio
d90e401d2a Improve controls and camera handling in the Truck Town demo
- Increase movement and steering speed significantly.
- Increase gravity slightly for a less floaty feeling.
- Simplify camera code (height is now constant).
- Tweaked camera distance and height to fit each vehicle.
- Fix script error when pressing Escape in the main menu
  (the demo will now quit).
2021-02-21 20:00:04 +01:00
Aaron Franke
99ad90bd0d Merge pull request #580 from Calinou/simplify-3d-scaling-setup
Simplify the 3D scaling demo setup, enable filtering by default
2021-02-12 23:57:49 -05:00
Hugo Locurcio
4adaaa2eb2 Simplify the 3D scaling demo setup, enable filtering by default
It turns out using a TextureRect node isn't necessary :)

The typical ViewportContainer + Viewport setup can be used just
fine to enable filtering on the ViewportTexture returned by the
Viewport.

The performance of the new method is equivalent to the old one.
2021-02-13 02:56:51 +01:00
Aaron Franke
b946d20762 Merge pull request #575 from Faless/joy/remap_wizard
[Joypads] Add SDL config re-mapping tool.
2021-02-07 16:24:18 -05:00
Fabio Alessandrelli
2a13307276 [Joypads] Add SDL config re-mapping tool.
Most of the code is in the remap folder, but it depends on the gamepad
diagram scene.
It allows remapping of pads to values that godot can understand.
It also comes with some default mapping for the HTML5 platform.
2021-02-07 13:19:18 +01:00
Aaron Franke
0b3e046953 Merge pull request #577 from nekomatata/physics-test-controllers
Add physics tests for 2D character controller
2021-01-22 20:01:39 -05:00
Aaron Franke
68e095c4d6 Merge pull request #578 from nekomatata/physics-tests-key-bindings
Changed key bindings in physics tests 2D/3D
2021-01-22 19:55:28 -05:00
PouleyKetchoupp
fe54ebbb3a Changed key bindings in physics tests 2D/3D
Changed debug collision shortcut from 'D' to 'C' to keep WASD available
for other functions in some tests.

Unbound arrows from UI shortcuts for the same reason.
2021-01-22 17:33:48 -07:00
PouleyKetchoupp
cdf0ed3be9 Add physics tests for 2D character controller
Two tests for character controller, with options to use RigidBody2D,
KinematicBody2D or KinematicBody2D with RayShape2D.

Tilemap: Tests for moving and jumping within tilemap blocks, with a
specific one-way collision test case scenario based on Block Climb Test
from https://github.com/madmiraal/godot-gym.

Slopes: Tests for moving and jumping in slopes, with different cases
based on snap and stop-on-slope parameters for kinematic bodies.
2021-01-22 17:24:28 -07:00
Aaron Franke
da9e24dfa7 Merge pull request #576 from nekomatata/physics-tests-broadphase-update
Update broadphase performance test in physics tests
2021-01-21 05:08:05 -05:00
PouleyKetchoupp
1c1ad17b43 Update broadphase performance test in physics tests
Start logging physics tick one frame earlier for each operation
Disable debug collision to avoid rendering bottleneck
Fixes in adding/removing bodies to avoid bottlenecks outside of physics
2D: Increase message queue size to allow adding more objects at once
3D: Remove camera to disable rendering altogether
3D: Fix error with create_rigidbody_box missing default value
2021-01-20 10:04:50 -07:00
Aaron Franke
5618c2b45a Merge pull request #574 from nekomatata/physics-tests-pause
Support for pause in 2D/3D physics tests
2021-01-06 23:56:36 -05:00
PouleyKetchoupp
3878948300 Support for pause in 2D/3D physics tests
New controls for all tests:
P to toggle pause on/off

Affects the running tests but not menus.
2021-01-06 21:25:34 -07:00
Aaron Franke
ca4cde1c26 Merge pull request #573 from nekomatata/physics-test-one-way-collision
Add One Way Collision for 2D Physics tests
2021-01-06 23:00:43 -05:00
PouleyKetchoupp
6a738c1ede Add One Way Collision for 2D Physics tests 2021-01-06 20:25:27 -07:00
Aaron Franke
04e9afb4cf Merge pull request #570 from aaronfranke/mr-k-inspired
Update the Drag and Drop demo and the Tween demo
2021-01-06 21:45:53 -05:00
Aaron Franke
e73af12f49 Script updates and simplification 2021-01-06 01:32:12 -05:00
Aaron Franke
6bdbeafca2 Update Tween demo to use Containers 2021-01-03 03:01:52 -06:00
Aaron Franke
21cbaafb2f Use a GridContainer in the Drag and Drop demo 2021-01-02 19:07:31 -06:00
Aaron Franke
35426410d5 Merge pull request #567 from aaronfranke/add-3d-waypoints-demo
Add a 3D waypoints demo
2021-01-02 14:47:30 -06:00
Hugo Locurcio
54a8d37e6c Add a 3D waypoints demo
Co-authored-by: Aaron Franke <arnfranke@yahoo.com>
2021-01-02 14:45:05 -06:00
Aaron Franke
d5dae1cbb7 Merge pull request #569 from aaronfranke/add-control-gallery-demo
Add a control gallery demo
2021-01-02 14:38:05 -06:00
Hugo Locurcio
06dc40ba65 Add a control gallery demo
This project showcases what Godot's various Control nodes can do
(and what they look like, so that new users can figure them out).
2021-01-02 00:39:59 -06:00
Aaron Franke
7c604f336d Merge pull request #568 from aaronfranke/2021
Update copyright statements for 2021
2021-01-01 22:30:54 -06:00
Aaron Franke
e3a31afe40 Update copyright statements for 2021 2021-01-01 21:49:36 -06:00
Aaron Franke
289d658baa Merge pull request #566 from nekomatata/physics-test-joints
Add joints test to 2D/3D physics tests
2020-12-31 01:22:21 -06:00
PouleyKetchoupp
7a437d1d23 Add joints test to 2D/3D physics tests 2020-12-30 20:15:08 -07:00
Aaron Franke
08e3f1efd0 Merge pull request #565 from aaronfranke/save-load-loading
Move Saving and Loading demo to Loading category
2020-12-30 14:23:10 -06:00
Aaron Franke
0d9c0d15c6 Move Saving and Loading demo to Loading category 2020-12-28 14:00:04 -06:00
Aaron Franke
96baaa09e3 Merge pull request #563 from aaronfranke/mr-k-platformer
Add a coin counter and pause menu fading to Platformer 2D
2020-12-28 13:48:22 -06:00
Mr.K GameDev
e004d2564e 2D Platformer UI Update
Co-authored-by: Aaron Franke <arnfranke@yahoo.com>
2020-12-26 23:35:45 -06:00
Aaron Franke
651ef54920 Merge pull request #562 from nekomatata/physics-tests-owner
Add PouleyKetchoupp to owners for physics tests
2020-12-19 11:59:55 -06:00
Aaron Franke
4a60286512 Merge pull request #561 from nekomatata/physics-test-collision-pairs
Add collision pairs test to 2D/3D physics tests
2020-12-19 11:59:26 -06:00
PouleyKetchoupp
1148a6bda0 Add PouleyKetchoupp to owners for physics tests 2020-12-19 10:46:18 -07:00
PouleyKetchoupp
9ad473c633 Add collision pairs test to 2D/3D physics tests
Functional test used for checking/debugging different collision cases for all possible pairs of shape types.
2020-12-18 20:51:54 -07:00
Aaron Franke
e38be6dec0 Merge pull request #560 from nekomatata/physics-tests-2d
Add 2D Physics Tests
2020-12-16 23:11:54 -05:00
PouleyKetchoupp
8241be5817 Add demo: Physics Tests 2D
Similar to its 3D counterpart, with tests using 2D physics.
2020-12-16 09:11:35 -07:00
Aaron Franke
1c836ecde9 Merge pull request #559 from nekomatata/physics-tests-3d-update
Fixes and adjustments in 3D physics tests
2020-12-14 20:36:01 -05:00
PouleyKetchoupp
6dd09308fa Fixes and adjustments in 3D physics tests
Add Functional Test / Stack & Pyramid
For testing stack stability.

Add Functional Test / Raycasts
Visually test raycast on different shapes.

Add Performance Test / Broadphase
Add/move/remove lots of non-colliding objects and measure time.

Fix leaks on exit
Some Nodes are copied and removed from the scene to be used as templates,
they need to be freed manually on exit.

Fix Performance Test / Contacts
Positions adjusted, some shape types were not created at the center.
2020-12-14 17:25:26 -07:00
Aaron Franke
555e43c896 Merge pull request #517 from Calinou/add-save-load-demo
Add a saving/loading demo with various serialization formats
2020-12-12 18:27:32 -05:00
Hugo Locurcio
2bd5b1c8ee Add a saving/loading demo with various serialization formats
This demo showcases how to save a simple game with ConfigFile and JSON.
2020-12-13 00:21:47 +01:00
Aaron Franke
14f2f1a713 Merge pull request #557 from aaronfranke/3din2d
Simplify 3D in 2D demo
2020-12-08 18:50:27 -05:00
Aaron Franke
3d9bcc6d97 Simplify 3D in 2D demo 2020-12-06 22:00:51 -05:00
Aaron Franke
3147c6c5bd Merge pull request #554 from aaronfranke/assetlib-5bd2bbf
Add links to the Asset Library after release 3.2-5bd2bbf
2020-11-28 23:31:51 -05:00
Aaron Franke
20a515153f Add links to the Asset Library after release 3.2-5bd2bbf 2020-11-28 23:21:06 -05:00
Aaron Franke
5bd2bbfda9 Merge pull request #553 from aaronfranke/iap-readme
Fix README files, especially in Android IAP demos
2020-11-28 22:19:31 -05:00
Aaron Franke
fc54dd9c23 Fix README files, especially in Android IAP demos 2020-11-28 22:05:39 -05:00
Aaron Franke
d38d18006b Merge pull request #551 from Calinou/networking-add-port-forward-help
Add instructions for port forwarding in the high-level multiplayer demos
2020-11-16 04:10:53 -05:00
Hugo Locurcio
6fd3e4d525 Add instructions for port forwarding in the high-level multiplayer demos
The instructions will only show when the player is hosting a server.
This also includes a button to get your public IP address.

This partially addresses #535.
2020-11-13 16:17:14 +01:00
Aaron Franke
2503599bed Merge pull request #543 from aaronfranke/mat-test-no-dae
Replace Collada .dae file with a Blend file in Material Testers demo
2020-10-30 15:40:04 -04:00
Aaron Franke
1aaa8e1fc6 Replace Collada .dae file with a Blend file
Also set material import mode to tres for test_bed.glb
2020-10-30 15:37:33 -04:00
Aaron Franke
2a98499935 Merge pull request #544 from aaronfranke/enums
Add trailing commas to enums
2020-10-30 15:35:51 -04:00
Aaron Franke
159adfd421 Add trailing commas to enums 2020-10-30 03:24:51 -04:00
Aaron Franke
4bba07257a Merge pull request #536 from aaronfranke/dtc-public
Change Dodge the Creeps to be more consistent with the docs
2020-10-21 01:50:46 -04:00
Aaron Franke
ae02236e50 Merge pull request #541 from Duroxxigar/mono-mp
Created C# networked Pong
2020-10-20 23:40:21 -04:00
Duroxxigar
3f8567f920 Created C# networked Pong 2020-10-20 23:18:57 -04:00
Aaron Franke
c7610e9334 Merge pull request #540 from jak-sdk/master
Re-write the navigation path-following code to be easier to read + add comments
2020-10-16 14:57:42 -04:00
Jak
78c7a48422 Re-write the 3d/navmesh demo to be easier to follow
The previous code had no comments and had some unintuitive steps.
I've re-written and re-structured it, and added comments. Hopefully it
will be easier to follow for newcomers to Godot.

 * Re-write main methods
 * Various bugfixes (variable conflicts, edge cases)
 * Comment improvements
 * Whitespace fixes

Co-authored-by: Aaron Franke <arnfranke@yahoo.com>
2020-10-16 19:41:28 +01:00
Aaron Franke
31d54a3540 Merge pull request #539 from jlosito/dependabot-configs
Check for updates to GitHub Actions every weekday
2020-10-15 15:40:46 -04:00
John Losito
2259303ee7 Check for updates to GitHub Actions every weekday 2020-10-13 18:21:32 -04:00
Aaron Franke
76c1d850fb Merge pull request #537 from aaronfranke/csproj-323
Update C# project files in C# demos for Godot 3.2.3
2020-10-12 19:45:10 -04:00
Aaron Franke
ebc79dec04 Update C# project files in C# demos for Godot 3.2.3 2020-10-11 03:20:03 -04:00
Aaron Franke
4af7fd5562 Change Dodge the Creeps to be more consistent with the docs 2020-10-10 16:26:23 -04:00
Aaron Franke
1a19c5c4e1 Merge pull request #533 from van800/dodge
Improve Dodge the Creeps demo
2020-10-08 12:07:50 -04:00
Ivan Shakhov
f8317d20d5 restore RootNamespace, since default one contains spaces, restore net472 after discussion with @neikeq and more testing 2020-10-08 16:29:41 +02:00
Aaron Franke
766cc97855 Merge pull request #532 from akien-mga/dodge-unused
Dodge the Creeps: Remove unused asset
2020-10-06 16:10:30 -04:00
Rémi Verschelde
136db0b25b Dodge the Creeps: Remove unused asset 2020-10-06 21:48:11 +02:00
Aaron Franke
aba0372718 Merge pull request #531 from van800/master
Update dodge_the_creeps to Godot 3.2.3 format
2020-10-06 05:58:43 -04:00
Ivan Shakhov
dd11042d95 fix Dodge the Creeps 2020-10-06 11:36:37 +02:00
Aaron Franke
4d205325ad Merge pull request #528 from aaronfranke/panel
Remove Panel nodes that don't have panels
2020-10-02 03:28:18 -04:00
Aaron Franke
0d1f16d073 Remove panel nodes that don't have panels
Replace with Control nodes
2020-10-01 23:46:50 -04:00
Aaron Franke
2c0cbbaed0 Merge pull request #525 from aaronfranke/gitignore-attr
Update gitignore for 4.x, add gitattributes, and update file format
2020-10-01 15:15:06 -04:00
Aaron Franke
918a289ee2 Format files using updated file_format.sh 2020-10-01 14:23:54 -04:00
Aaron Franke
fe9fd7d7e4 Update gitignore for 4.x and add gitattributes 2020-10-01 14:22:45 -04:00
Aaron Franke
c8149a703f Merge pull request #526 from aaronfranke/csharp-3.2.3
Update C# demos for Godot 3.2.3
2020-10-01 14:19:13 -04:00
Aaron Franke
2979f85185 Update C# demos for Godot 3.2.3 2020-10-01 02:45:18 -04:00
Aaron Franke
bc10b69d65 Merge pull request #524 from Calinou/allow-hidpi
Allow hiDPI in all demos that support multiple resolutions
2020-10-01 02:44:54 -04:00
Aaron Franke
f5960b2a7f Merge pull request #522 from Calinou/particles-add-flipbook-animation
Add a flipbook animation example to the 2D particles demo
2020-10-01 02:43:51 -04:00
Hugo Locurcio
fe6103256a Allow hiDPI in all demos that support multiple resolutions
This is required to benefit from crisp display on hiDPI monitors.
This also fixes issues related to fullscreen and input handling
when using an hiDPI display on Windows.
2020-10-01 00:56:12 +02:00
Hugo Locurcio
768346a092 Add a flipbook animation example to the 2D particles demo 2020-09-17 22:43:04 +02:00
Aaron Franke
7a84acea76 Merge pull request #521 from dbrookman/spelling-fix
Fix small spelling error
2020-09-16 11:57:48 -04:00
Daniel Brookman
c343b2f4f5 Fix small spelling error 2020-09-16 11:22:44 -04:00
Aaron Franke
9184a36ec1 Merge pull request #519 from aaronfranke/assetlib-links
Link to the asset library from the README of each demo
2020-09-11 13:51:45 -04:00
Aaron Franke
d4bf89d364 Link to the asset library from the README of each demo 2020-09-10 15:37:10 -04:00
Aaron Franke
f74f7c52b6 Merge pull request #514 from Calinou/remove-community-health-files
Remove funding information to use the @godotengine default
2020-09-01 01:30:39 -04:00
Hugo Locurcio
76df39ab2e Remove funding information to use the @godotengine default
The community health files are now available in the godotengine/.github
repository, which makes them apply to all repositories in the
organization automatically.

See https://github.com/godotengine/godot/issues/40972.
2020-08-27 15:57:32 +02:00
Aaron Franke
e4f69c3de0 Merge pull request #513 from Faless/net/free_while_emitting
Avoid freeing network peer during signal emission.
2020-08-23 16:22:51 -04:00
Fabio Alessandrelli
4fe1930aab Avoid freeing network peer during signal emission.
Always keep a reference to the last used peer even when removing it
from tree.
2020-08-23 20:12:27 +02:00
Aaron Franke
a582304ee7 Merge pull request #511 from Calinou/lights-and-shadows-normal-maps
Add a normal map test in the 2D lights and shadows demo
2020-08-19 16:13:46 -05:00
Hugo Locurcio
97e00544a9 Add a normal map test in the 2D lights and shadows demo
This was requested by lawnjelly so we can test whether normal map
orientation behaves as expected.
2020-08-18 14:22:04 +02:00
Aaron Franke
bc40a8d61d Merge pull request #510 from aaronfranke/dtc-meta
Fix minor problems with Dodge the Creeps metadata
2020-08-17 00:28:48 -05:00
Aaron Franke
4aae4f657b Fix minor problems with Dodge the Creeps metadata 2020-08-16 23:49:00 -05:00
Aaron Franke
78fe523b3c Merge pull request #508 from Calinou/3d-demos-tweak-settings
Tweak settings in various 3D demos
2020-08-16 23:44:05 -05:00
Hugo Locurcio
c6163b3d20 Tweak settings in various 3D demos
- Enable 4× MSAA in all 3D demos.
- Enable filmic tonemapping with a whitepoint of 6 in GLES3 3D demos.
- Add subtle fog to the Truck Town demo.
- Use the `2d` stretch mode and `expand` stretch aspect to support
  multiple resolutions and aspect ratios.
2020-08-17 03:25:13 +02:00
Aaron Franke
e30571c1ad Merge pull request #509 from aaronfranke/icons-images
Improve icons and optimize PNG images using oxipng
2020-08-16 19:12:52 -05:00
Aaron Franke
fcc7d5c723 Optimize PNG images using oxipng 2020-08-16 17:48:38 -05:00
Aaron Franke
50fb2071a0 Improve icon.png for projects using default icon 2020-08-15 17:25:12 -05:00
Aaron Franke
4b9a809912 Merge pull request #506 from Calinou/add-gui-theming-override-demo
Add a GUI theming override demo
2020-08-12 19:26:23 -05:00
Aaron Franke
68a2204c07 Merge pull request #507 from ricardoalcantara/mono_android_iap
Rewriting Mono Android IAP to match with GDScript
2020-08-12 19:25:21 -05:00
Ricardo Alcantara
6e98353ce3 Rewriting Mono Android IAP to match with GDScript
Version.
2020-08-12 21:08:51 -03:00
Aaron Franke
b5d4b277f4 Merge pull request #504 from ricardoalcantara/mono_android_iap
Android IAP Response Code can now return null.
2020-08-08 13:59:08 -05:00
Hugo Locurcio
6a325fb3a5 Add a GUI theming override demo
Overriding theme items is a common point of confusion. This demo
should hopefully make it easier to understand.

In the future, we could extend this demo to include things like theme
switching as it's a common need in non-game applications.
2020-08-04 13:14:53 +02:00
Aaron Franke
913de13ec9 Merge pull request #505 from pkruszynski/mobile-multitouch-view-fix
Mobile multitouch view fix
2020-08-03 21:20:30 -05:00
pkruszynski
f9c93b0d28 Fix for multitouch_view 2020-08-04 03:13:19 +01:00
Ricardo Alcantara
bc8dc740b5 Android IAP Response Code can now return null. 2020-07-28 19:26:19 -03:00
Aaron Franke
ddffbd7599 Merge pull request #498 from ricardoalcantara/mono_android_iap
Mono Android IAP Demo Project
2020-07-27 14:02:09 -04:00
Ricardo Alcantara
b718574112 Mono Android IAP Demo Project 2020-07-27 00:07:15 -03:00
Aaron Franke
ae2a97976a Merge pull request #500 from aaronfranke/ci-update
Tweak CI to more closely match the main repo
2020-07-25 00:01:18 -04:00
Aaron Franke
2c138bd75f Tweak CI to more closely match the main repo 2020-07-24 23:50:50 -04:00
Aaron Franke
b7b3a75389 Merge pull request #499 from smix8/master
3D NavMesh Demo - fix for navmesh (re)baking issue
2020-07-24 21:59:00 -04:00
smix8
28ec746545 fix for navmesh (re)baking issue
fix for navmesh (re)baking issues in demo
- changed level mesh size/scale (was way to small to be useable)
- changed navmesh agent settings (default radius to large, slope values to small)
2020-07-25 02:19:19 +02:00
Aaron Franke
8d9d58f112 Merge pull request #497 from aaronfranke/voxel-memory
Add memory usage to the Voxel demo
2020-07-09 16:57:19 -04:00
Aaron Franke
bd05e88ce0 Add memory usage to the Voxel demo 2020-07-08 13:26:28 -04:00
Aaron Franke
2434876738 Merge pull request #496 from aaronfranke/demo-categories
Categorize demos and add README files
2020-07-04 13:48:50 -04:00
Aaron Franke
8dff86d370 Add README files to categories 2020-07-03 20:45:51 -04:00
Aaron Franke
6b11ca7302 Move around 2D and GUI demos 2020-07-03 20:04:59 -04:00
Aaron Franke
cee39035e3 Move mobile demos to their own folder 2020-07-03 19:45:04 -04:00
Aaron Franke
c33ce26a93 Merge pull request #483 from fire/extended-physics-tests
Add extended physics tests.
2020-07-03 01:51:46 -04:00
K. S. Ernest (iFire) Lee
3fd13c1a82 Add extended physics tests. 2020-07-02 21:39:11 -07:00
Aaron Franke
f74217c1dc Merge pull request #492 from aaronfranke/multitouch
Remove useless "_find_free_pointer_id" method in Multitouch View
2020-07-02 14:32:35 -04:00
Aaron Franke
5215bc00f8 Remove useless "_find_free_pointer_id" method in Multitouch View 2020-07-02 13:58:34 -04:00
Aaron Franke
1ae23b63aa Merge pull request #493 from Calinou/2d-platformer-font-disable-aa
Disable antialiasing on the font in the 2D platformer demo
2020-07-02 13:58:02 -04:00
Aaron Franke
b99cd953d2 Merge pull request #494 from Calinou/2d-platformer-progressive-jump-interrupt
Progressively interrupt the jump in the 2D platformer demo
2020-07-02 13:57:14 -04:00
Aaron Franke
8823628b02 Merge pull request #495 from TwistedTwigleg/IK_Demo_Godot_3_2_2_Fix
Godot 3.2 IK demo SkeletonIK error fix
2020-07-02 13:56:29 -04:00
TwistedTwigleg
1ad95a443f Fixed bug in the IK demo where the SkeletonIK scene would print an error. The issue is that the target nodes are initialized after the SkeletonIK node. Moving the nodes fixed the issue and now no more errors are printed 2020-07-02 10:10:33 -04:00
Hugo Locurcio
79ad34dc0f Progressively interrupt the jump in the 2D platformer demo
This feels more smooth while still giving a sense of control to
the player.
2020-07-02 15:32:17 +02:00
Hugo Locurcio
aa390d1b30 Disable antialiasing on the font in the 2D platformer demo
Pixel fonts look best when antialiasing is disabled.
2020-07-02 15:21:39 +02:00
Aaron Franke
ba44700ebe Merge pull request #491 from aaronfranke/cthulhu
Many tweaks thanks to IAmActuallyCthulhu and some other misc tweaks
2020-06-28 13:37:38 -04:00
Aaron Franke
006309bd6f Many tweaks thanks to IAmActuallyCthulhu
Also change apostrophes to double quotes and update C# projects
2020-06-28 13:19:13 -04:00
Aaron Franke
866f826124 Merge pull request #489 from aaronfranke/3dplat
Tweak the 3D platformer demo
2020-06-28 02:31:00 -04:00
Aaron Franke
c5c5fedec8 Update 3D platformer 2020-06-28 02:23:30 -04:00
Aaron Franke
f34e61eaca Merge pull request #490 from aaronfranke/misc-tweaks-3.2.2
Misc fixes and tweaks to many demos for 3.2.2
2020-06-28 02:23:18 -04:00
Aaron Franke
189d6ac9b4 Misc fixes and tweaks to many demos 2020-06-27 21:07:49 -04:00
Aaron Franke
343669ca06 Merge pull request #488 from aaronfranke/no-default-env
Clean up unused and outdated environment files
2020-06-27 21:07:26 -04:00
Aaron Franke
c13e56662f Clean up unused and outdated environment files 2020-06-27 20:58:19 -04:00
Aaron Franke
dc6efcd429 Merge pull request #487 from aaronfranke/ik-again
Many style fixes and other tweaks for the IK demo
2020-06-27 20:58:01 -04:00
Aaron Franke
aaf3483618 Move Godot Battle Bot model and materials to a subfolder
Also minify textures by making them really low resolution
2020-06-27 15:40:51 -04:00
Aaron Franke
e30b9d4c7d Change environment to 3.1/3.2 environment 2020-06-27 15:14:16 -04:00
Aaron Franke
2ae60f3ac7 Many style fixes for the IK demo 2020-06-27 15:14:16 -04:00
Aaron Franke
87f6a4e3fd Merge pull request #486 from aaronfranke/os-test
Add Mono C# preprocessor defines, README, and screenshots to OS testing demo
2020-06-24 03:14:28 -04:00
Aaron Franke
eac96a9148 Add a README and screenshots to the OS test demo 2020-06-24 02:17:46 -04:00
Aaron Franke
f0a07c43a8 Add Mono C# preprocessor testing to OS test demo 2020-06-24 02:17:46 -04:00
Aaron Franke
7b465152dc Merge pull request #484 from Calinou/add-os-testing-demo
Add an operating system testing demo
2020-06-23 13:51:54 -04:00
Hugo Locurcio
4bafb96fcb Add an operating system testing demo
This demo showcases various OS-specific features in Godot.
It can be used to test Godot while porting it to a new platform
or to check for regressions.

This closes #8.
2020-06-23 09:39:22 +02:00
Rémi Verschelde
d4a2a57834 Merge pull request #482 from timoschwarzer/android-iap-3.2.2-godotgoogleplaybilling
Update Android IAP demo to reflect recent changes
2020-06-22 11:28:55 +02:00
Aaron Franke
d29fc74ae8 Merge pull request #481 from Calinou/switch-to-github-actions
Switch continuous integration from Travis CI to GitHub Actions
2020-06-22 04:29:39 -04:00
Aaron Franke
033a5338d5 Merge pull request #480 from aaronfranke/trail-space-format
Remove trailing space characters in the formatting script
2020-06-21 23:23:50 -04:00
Aaron Franke
35d44b5d85 Remove trailing space characters in the formatting script 2020-06-21 23:00:13 -04:00
Timo Schwarzer
9a3a831a34 Update Android IAP demo to reflect recent changes 2020-06-20 00:26:45 +02:00
Aaron Franke
d3317cc91d Merge pull request #473 from nekomatata/physics-tests
Add Physics Tests project
2020-06-19 15:25:26 -04:00
PouleyKetchoupp
afd99e5aed Add Physics Tests project 2020-06-19 10:27:53 +02:00
Hugo Locurcio
b6c0283c22 Switch continuous integration from Travis CI to GitHub Actions 2020-06-18 09:26:09 +02:00
Aaron Franke
3ea2246466 Merge pull request #479 from timoschwarzer/android-iap-3.2.2-fix
Fix small mistakes with new Android IAP API
2020-06-15 02:24:56 -04:00
Timo Schwarzer
ea01309d56 Fix small mistakes with new Android IAP API 2020-06-15 07:27:18 +02:00
Aaron Franke
9600d93a33 Merge pull request #478 from timoschwarzer/android-iap-3.2.2
Update Android IAP demo for 3.2.2
2020-06-14 14:59:08 -04:00
Timo Schwarzer
74924dd073 Update Android IAP demo for 3.2.2 2020-06-14 20:04:23 +02:00
Aaron Franke
5363f8a75a Merge pull request #477 from aaronfranke/unhandled-input
Replace _input with _unhandled_input in most places
2020-06-09 11:48:25 -04:00
Aaron Franke
5f1905e0d6 Replace _input with _unhandled_input 2020-06-08 22:43:19 -04:00
Aaron Franke
d1ed6dbd82 Merge pull request #476 from Jayman2000/dodge-the-creeps-cc0
Correct Dodge the Creeps' copyright info
2020-06-08 12:13:20 -04:00
Jason Yundt
20c10dcb06 Correct Dodge the Creeps' copyright info
It originally said that "Abstract Platformer" was copyright kenny.nl.
This is not true. "Abstract Platformer" was dedicated to the public
domain using CC0. "When CC0 is applied to a work, copyright no longer
applies to the work in most jurisdictions around the world." (Source:
https://creativecommons.org/faq/#how-do-cc-licenses-operate)

It also said that "Abstract Platformer" was created in the years
2010-2020. While the "Abstract Platformer" webpage
(https://www.kenney.nl/assets/abstract-platformer) does say "Copyright ©
2010 - 2020", I believe that that's a copyright notice for the website
itself, not the asset pack. I'm not sure when Kenney started working on
"Abstract Platformer", but I'm confident that it was published in 2016
because:

 * All of the files in the ZIP archive are dated 2016.
 * "Abstract Platformer" was published to OpenGameArt.org in 2016. See:
   https://opengameart.org/content/abstract-platformer

I didn't think that it made sense to call that section of the README
"Licenses" anymore because "[...]CC0 is not a license; it is a public
domain dedication." (Source:
https://creativecommons.org/faq/#how-do-cc-licenses-operate)
2020-06-08 11:13:09 -04:00
Aaron Franke
48eb973127 Merge pull request #469 from aaronfranke/voxel
Add a Voxel demo project
2020-05-26 10:07:21 -04:00
Aaron Franke
050fda3a4c Add a Voxel demo project 2020-05-26 06:46:02 -04:00
Aaron Franke
ac5013f9ec Merge pull request #468 from aaronfranke/2d-shader-gles3
Convert the Screen Space Shaders demo back to GLES 3
2020-05-12 14:12:01 -04:00
Aaron Franke
ed2348080c Convert the Screen Space Shaders demo back to GLES 3 2020-05-12 13:56:03 -04:00
Aaron Franke
a9c63035da Merge pull request #465 from aaronfranke/gitignore-translation
Add translation ignore
2020-05-08 01:34:12 -04:00
Aaron Franke
7a5c0872d5 Add translation ignore
Now synced with GitHub's Godot.gitignore plus some extra lines
2020-05-08 01:30:34 -04:00
Aaron Franke
0eeaf0ecd8 Add credits for the music used in the 2D platformer demos (#461)
* Add credits for the music used in the 2D platformer demos

* Update 2d/platformer/README.md

Co-Authored-By: Hugo Locurcio <hugo.locurcio@hugo.pro>

* Update 2d/physics_platformer/README.md

Co-Authored-By: Hugo Locurcio <hugo.locurcio@hugo.pro>

Co-authored-by: Hugo Locurcio <hugo.locurcio@hugo.pro>
2020-04-07 13:59:36 -04:00
Aaron Franke
7939f8e348 Merge pull request #459 from EludeQ/updated-dodge-the-creeps
Updated the dodge_the_creeps demo to include the "Removing the creeps" part in the tutorial.
2020-04-04 07:16:21 -04:00
Amara M. Angel
ee388dd5df Updated the dodge_the_creeps demo to include the "removing the creeps" part 2020-04-04 13:11:10 +02:00
Aaron Franke
b548a848b1 Merge pull request #460 from EludeQ/viewports-frame_post_draw
Update Viewports tutorial to use "frame_post_draw"
2020-04-03 16:52:26 -04:00
Amara M. Angel
7a9b45f156 Update Viewports tutorial to use "frame_post_draw" 2020-04-03 19:42:51 +02:00
Aaron Franke
57baf0a1b5 Merge pull request #453 from aaronfranke/plugin-proj
Refactor the plugin demos to be inside of a project and add main screen plugin demo
2020-03-31 03:12:26 -04:00
Aaron Franke
a0a87c3bea Add a main screen plugin to the plugin demos 2020-03-25 23:29:55 -04:00
Aaron Franke
51c0f3abb8 Refactor the plugin demos to be inside of a project for convenience 2020-03-25 23:28:42 -04:00
LaBodilsen
8464543a23 simplifying steering to a single line with move_toward (#451)
* simplyfied the steering to a single line with lerp

Replaced:
	if steer_target < steer_angle:
		steer_angle -= STEER_SPEED * delta
		if steer_target > steer_angle:
			steer_angle = steer_target
	elif steer_target > steer_angle:
		steer_angle += STEER_SPEED * delta
		if steer_target < steer_angle:
			steer_angle = steer_target
	
	steering = steer_angle
with
	steering = lerp(steering, steer_target, STEER_SPEED)

and lowered STEER_SPEED to 0.2

* Update vehicle.gd

* added space around *
2020-03-25 13:46:42 -04:00
Rémi Verschelde
e95cbac634 Merge pull request #450 from aaronfranke/travis
Add a formatting script for local checking and for Travis CI
2020-03-25 09:12:38 +01:00
Aaron Franke
eab59a6d2e Merge pull request #452 from aaronfranke/issue-templates
Remove duplicate issue templates
2020-03-23 04:58:06 -04:00
Aaron Franke
474f246096 Remove duplicate issue templates 2020-03-23 04:57:24 -04:00
Aaron Franke
a12f54cfef Update issue templates 2020-03-23 04:51:27 -04:00
Aaron Franke
7e09d2fec7 Commit files changed by the formatting script 2020-03-19 20:30:40 -04:00
Aaron Franke
7ba8b9930d Add a formatting script for Travis CI 2020-03-19 20:30:33 -04:00
Aaron Franke
ec28f44e3c Merge pull request #449 from aaronfranke/description
Add descriptions to all projects with README files
2020-03-17 19:12:03 -04:00
Aaron Franke
f9e7456b70 Add descriptions to all projects with README files
These show up in the project manager when hovering over projects.
2020-03-16 20:50:53 -04:00
Aaron Franke
93b1f689f2 Merge pull request #447 from aaronfranke/multitouch
Multitouch View tweaks
2020-03-15 12:05:55 -04:00
Aaron Franke
c0880343bc Merge pull request #446 from aaronfranke/dodge-the-attributions
Move Dodge the Creeps license information into the README files
2020-03-15 12:05:18 -04:00
Aaron Franke
43dfa363c3 Merge pull request #445 from aaronfranke/kc2d
Organize and simplify the Kinematic Character 2D demo
2020-03-15 12:04:51 -04:00
Aaron Franke
699abade3a Merge pull request #448 from aaronfranke/mult-thread-load
Style tweaks and add import files to multiple threads loading demo
2020-03-15 12:04:26 -04:00
Aaron Franke
1ef6b121e3 Style tweaks and add import files to multiple threads loading demo 2020-03-15 04:37:34 -04:00
Vitaliy
5f7072a18d Multiple-threads loading (#425)
Add Multiple-threads loading demo
2020-03-15 04:25:18 -04:00
Aaron Franke
bc949bd47e Multitouch View tweaks 2020-03-14 03:07:16 -04:00
Aaron Franke
38d44dbb70 Move Dodge the Creeps license information into the README files 2020-03-14 01:58:57 -04:00
Aaron Franke
022ec69810 Organize and simplify the Kinematic Character 2D demo 2020-03-14 01:39:19 -04:00
Aaron Franke
f3c8885d8f Merge pull request #444 from aaronfranke/truck-town-tres
Convert materials to tres format in Truck Town
2020-03-13 15:12:15 -04:00
Aaron Franke
b103db5e50 Convert materials to tres format in Truck Town 2020-03-13 06:19:13 -04:00
Aaron Franke
671e1299e6 Merge pull request #443 from aaronfranke/2d-nav-poly-tweak
Tweak 2D navigation polygon demo camera and remove RPG unused files
2020-03-13 05:43:08 -04:00
Aaron Franke
bb61e49397 Tweak 2D navigation polygon demo camera and remove RPG unused files 2020-03-12 22:04:42 -04:00
Aaron Franke
69f21ce4c7 Merge pull request #442 from aaronfranke/dodge-the-csproj
Fix C# project files for Dodge the Creeps
2020-03-12 21:14:04 -04:00
Aaron Franke
d189a2b05a Fix C# project files for Dodge the Creeps 2020-03-12 20:44:42 -04:00
Aaron Franke
82fe29b90b Merge pull request #441 from aaronfranke/issue-template
Improve the issue template and add a PR template
2020-03-11 22:32:30 -04:00
Aaron Franke
ff483e2b71 Improve the issue template and add a PR template
Improve the comments in the issue template, and the PR template is entirely one comment.
2020-03-11 18:52:44 -04:00
Aaron Franke
758f38db67 Merge pull request #436 from aaronfranke/astar-kinematic
Some changes to Astar and Kinematic Character 3D
2020-03-10 16:16:15 -04:00
Aaron Franke
5caa78ef58 Some changes to kinematic character 3D 2020-03-10 07:23:55 -04:00
Aaron Franke
13f6e015bd Some changes to Astar code 2020-03-10 06:48:50 -04:00
Aaron Franke
db2941bed4 Merge pull request #435 from Calinou/fix-hfsm-comment
Fix incorrect comment in hierarchical FSM demo script
2020-03-09 10:22:16 -04:00
Aaron Franke
9553549a61 Merge pull request #432 from aaronfranke/readme
Add README files to many demos
2020-03-09 10:21:53 -04:00
Hugo Locurcio
222f94444a Fix incorrect comment in hierarchical FSM demo script
This closes #433.
2020-03-09 15:00:56 +01:00
Aaron Franke
9b4cac5782 Add README files to most of the misc demos
The Android ones can wait for later
2020-03-09 05:39:32 -04:00
Aaron Franke
fea5db8ed2 Add README files to loading and multiplayer demos 2020-03-09 05:06:17 -04:00
Aaron Franke
9e3ffe456b Add README files to GUI demos 2020-03-09 04:26:24 -04:00
Aaron Franke
8cdddc87ce Add README files to audio demos 2020-03-09 03:54:32 -04:00
Aaron Franke
da280ec220 Add README to and fix Circle Pop demo
Circle Pop gets its own commit since I found a bug that had to be fixed
2020-03-09 03:54:32 -04:00
Aaron Franke
f2a18910aa Add README files to Viewport demos 2020-03-09 03:54:32 -04:00
Aaron Franke
2eaedf8064 Add README files to demos with multiple versions 2020-03-09 03:54:32 -04:00
Aaron Franke
7e0032eb8e Add README files to 3D demos 2020-03-09 03:54:32 -04:00
Aaron Franke
a24ac796b6 Add README files to 2D demos 2020-03-09 03:54:32 -04:00
Aaron Franke
9809601e40 Merge pull request #431 from aaronfranke/no-grid
Remove the grid based movement demo
2020-03-09 03:54:12 -04:00
Aaron Franke
9b6109e44d Merge pull request #428 from aaronfranke/splitscreen
Add a splitscreen mode to the 2D platformer.
2020-03-07 19:56:52 -05:00
Aaron Franke
2ea2b02b68 Remove grid based movement demo
I don't think there's a point to this since we also have the JRPG demo.
2020-03-07 19:54:03 -05:00
Aaron Franke
ebc435074b [2D Platformer] Add a splitscreen mode 2020-03-06 23:00:11 -05:00
Aaron Franke
f5f72e6d3e [2D Platformer] Move Player out of Level, set limits in a script 2020-03-06 18:17:33 -05:00
Aaron Franke
e11fa006d6 Merge pull request #427 from aaronfranke/joypad
Refactor the Joypads demo
2020-03-06 18:17:01 -05:00
Aaron Franke
5322be1a54 Refactor the Joypads demo 2020-03-05 20:50:16 -05:00
Aaron Franke
18679efd75 Merge pull request #426 from aaronfranke/gles2
Convert most demos to GLES 2 and update to Godot 3.2
2020-03-05 20:49:11 -05:00
Aaron Franke
aea4010bc8 Convert most demos to GLES 2
Also fix Viewport error in 3D scaling demo, add an icon to Multiplayer Bomber, and rename BPM sync files.
2020-03-04 20:59:12 -05:00
Aaron Franke
db7c9f162f Open and save 3D IK demo in Godot 3.2 2020-03-04 20:59:12 -05:00
Aaron Franke
c72f65ed36 Update C# demos to Godot 3.2 2020-03-04 20:30:30 -05:00
Aaron Franke
424ad342ad Merge pull request #315 from aaronfranke/2point5d
Add 2.5D Demo Projects
2020-03-02 22:03:53 -05:00
Aaron Franke
841eb1fa37 Add icon for the 2.5D editor viewport 2020-03-01 22:29:44 -05:00
Aaron Franke
1671b4e30e Add music and set physics engine to Bullet 2020-03-01 17:14:11 -05:00
Aaron Franke
c7cc72b705 Add screenshots and tweak README files 2020-03-01 04:43:32 -05:00
Aaron Franke
d1ba41da5d 2.5D Editor Viewport for Mono C# 2020-03-01 04:37:41 -05:00
Aaron Franke
cc68af17af 2.5D Editor Viewport for GDScript 2020-03-01 04:36:44 -05:00
Aaron Franke
7e539cd182 2.5D Demo Project for GDScript
Co-authored-by: Stephen Agbete (Steph155) <bgsteph15@mail.com>
2020-02-29 22:39:32 -05:00
Aaron Franke
722ea9bc01 2.5D Demo Project for Mono C#
Co-authored-by: Stephen Agbete (Steph155) <bgsteph15@mail.com>
2020-02-29 22:39:20 -05:00
Aaron Franke
ca761cff87 Merge pull request #424 from Calinou/readme-add-scan-instructions
Add instructions on importing all projects at once in the README
2020-02-24 02:08:05 -05:00
Aaron Franke
5809089e9e Merge pull request #419 from aaronfranke/multiplayer
Update networking and multiplayer demos
2020-02-20 16:39:23 -05:00
Hugo Locurcio
abe1b0f367 Add instructions on importing all projects at once in the README
This may be helpful to newcomers; see #423.
2020-02-20 22:11:57 +01:00
Aaron Franke
b310877037 Update other networking demos, with style fixes 2020-02-20 15:13:21 -05:00
Aaron Franke
984a731502 Update multiplayer bomber demo 2020-02-20 15:13:21 -05:00
Aaron Franke
de8a79b35b Merge pull request #421 from aaronfranke/platform-3d-animtree
Update Platformer 3D to use AnimationTree and organize into subfolders
2020-02-20 15:12:24 -05:00
Aaron Franke
399de3e954 Organize 3D platformer demo files 2020-02-19 19:09:55 -05:00
Aaron Franke
486d582802 Update 3D platformer to use AnimationTree 2020-02-19 18:55:14 -05:00
Aaron Franke
001e51d2d3 Merge pull request #413 from Calinou/add-viewport-3d-scaling-demo
Add a viewport 3D scaling demo
2020-02-19 15:22:11 -05:00
Hugo Locurcio
b927ea3c63 Add a viewport 3D scaling demo
This demo shows how to scale the 3D viewport rendering without
affecting 2D elements such as the HUD. It also demonstrates how to
toggle filtering on a viewport by using TextureRect to display the
ViewportTexture delivered by the Viewport node.
2020-02-19 21:13:20 +01:00
Aaron Franke
f6c4a0000f Merge pull request #416 from aaronfranke/platformer-tweaks
Tweak the 2D platformer demos, particularly Physics Platformer
2020-02-19 15:08:35 -05:00
Aaron Franke
853565d1be Tweak the platformer demos, particularly physics platformer 2020-02-19 00:37:59 -05:00
Aaron Franke
073640ffcc Merge pull request #414 from aaronfranke/2d-3.2
Update 2D demos for 3.2 and convert many to GLES 2
2020-02-18 23:37:37 -05:00
Aaron Franke
545d63cd2d Merge pull request #412 from NetroScript/fixing-Sprites-at-2x-Resolution
Changing the art assets for the 2D platformers to "real" pixel art (instead of 2x upscaled)
2020-02-18 23:33:07 -05:00
Aaron Franke
c215c62df1 Convert many 2D projects to GLES 2 2020-02-17 21:29:54 -05:00
Aaron Franke
dda0bd7e20 Update other 2D demos for Godot 3.2 2020-02-17 21:29:54 -05:00
Aaron Franke
35bd408367 Update and improve isometric demo for 3.2
Also tweak hex map demo
2020-02-17 20:29:08 -05:00
Aaron Franke
ac179c6745 Merge pull request #382 from TwistedTwigleg/Godot_3_2_IK_Fix
Fixed GDScript IK demo so it works with Godot 3.2
2020-02-17 18:34:54 -05:00
TwistedTwigleg
2136c99672 Fixed up LookAt IK code so it better follows the style guide. Touched up a bunch of the comments 2020-02-17 14:45:02 -05:00
TwistedTwigleg
fdb0d77e88 Fixed style issues in IK Demo. Added a bit of static typing hints to the LookAt IK file to better fit the rest of the scripts 2020-02-17 12:14:36 -05:00
NetroScript
fbe6286656 for the 2d platformer demos changing the asset resolution from 2x upscaled to "true" pixel art, also adjusting values likes positions 2020-02-17 17:05:10 +01:00
Aaron Franke
ef98347469 Merge pull request #358 from pigdevstudio/input-remap-revamp
Revamp Input Remap demo simplifying it
2020-02-17 05:57:24 -05:00
Aaron Franke
07e696661c Merge pull request #392 from Calinou/tweak-3d-settings
Tweak 3D settings in various demos
2020-02-17 04:10:43 -05:00
TwistedTwigleg
1c9c754b79 Fixed SkeletonIK issue in Godot IK Demo. Now the joints should not act crazy 2020-02-16 11:43:21 -05:00
Hugo Locurcio
da374bccda Tweak 3D settings in various demos
- Use 4× MSAA for a better visual appearance.
- Use "3D Without Effects" framebuffer allocation when possible
  for better performance.
- Disable Glow in the 3D Kinematic Character demo for better
  performance. Increase the DirectionalLight strength to compensate.
- Use a non-linear attenuation for the OmniLight in the
  Window Management demo (and increase its range to compensate).
2020-02-15 23:32:00 +01:00
Aaron Franke
05801f9389 Merge pull request #411 from aaronfranke/vs-3.2
Update VisualScript demos for Godot 3.2
2020-02-12 19:59:29 -05:00
Aaron Franke
da157f6d0e Update VisualScript demos for Godot 3.2 2020-02-12 19:31:23 -05:00
Aaron Franke
13ca65800d Merge pull request #405 from NathanLovato/feature/2d-platformer-remake
Remake the 2d platformer demo
2020-02-12 19:30:46 -05:00
Henrique Campos
a76d9471f4 Add a simplified version of input remapping 2020-02-12 19:42:12 -03:00
Aaron Franke
d8546ece42 Add screenshots 2020-02-12 16:36:17 -05:00
Aaron Franke
8d48b7f994 Tweak background and organize clouds 2020-02-12 15:51:56 -05:00
Aaron Franke
c117eb1847 Minor style tweaks 2020-02-12 15:30:42 -05:00
Nathan Lovato
77800b3f15 Add more clouds to cover wide and thin window sizes 2020-02-12 07:53:43 -06:00
Nathan Lovato
332cd3bb38 Remove return type hint 2020-02-12 07:48:21 -06:00
Nathan Lovato
75df35b165 Improve background tiling, move parallax layers vertically 2020-02-12 07:47:56 -06:00
Nathan Lovato
bebf8e8249 Fix background disappearing when scaling the window
Use the keep_height aspect ratio option as in the original demo. This prevents
seeing the clear color when making the window tall
Change the ParallaxBackground scene so mirrored sections don't disappear on wide windows
2020-02-11 22:18:48 -06:00
Nathan Lovato
bd6da6a610 Limit the window size 2020-02-11 22:08:01 -06:00
Nathan Lovato
ab04b998fc Update the platformer demo's readme 2020-02-11 21:56:15 -06:00
Nathan Lovato
263bfd8bd3 Add README to the 2D platformer 2020-02-11 18:22:26 -06:00
Nathan Lovato
9ee778bd5d Address requested changes in the review
Remove unused spawn input action
Add support for the gamepad's left stick for movement
Use the project settings to store the gravity value project-wide
Remove type hints
2020-02-11 17:24:57 -06:00
Aaron Franke
2372fd155f Merge pull request #366 from aaronfranke/matrix-transform
Add Matrix Transform demo
2020-02-11 03:53:07 -05:00
Aaron Franke
86944d5236 Merge pull request #404 from aaronfranke/readme-license
Update README and LICENSE for Godot 3.2
2020-02-10 19:06:53 -05:00
Aaron Franke
827d67b2ab Update README and LICENSE 2020-02-09 01:36:43 -05:00
Nathan Lovato
e323bead2e Remake the 2d/platformer demo from scratch
This Godot project is a complete rewrite of the official Platformer 2D demo. This is part of a proposal to improve and harmonize the official demo projects. We want to:

- Teach good programming practices with Godot.
- Bring demos to a higher quality standard.
- Unify the code in the demos.

See the [open issue](https://github.com/godotengine/godot-demo-projects/issues/390) for more information.

This new demo showcases features from the original, and works with Godot 3.2.

Co-authored-by: Johnny Goss <me@johnnygoss.dev>
2020-02-04 21:50:54 -06:00
Aaron Franke
177884ff19 Merge pull request #401 from aaronfranke/2d
Update the rest of the 2D demos for Godot 3.1.2
2020-02-03 16:56:50 -05:00
Aaron Franke
87f42b77e0 Update 2D shader and SDF demos 2020-02-03 16:37:54 -05:00
Aaron Franke
b0e1cc0227 Update 2D navigation demos 2020-02-03 16:37:54 -05:00
Aaron Franke
7af4d281b9 Update 2D lighting demos
Just renaming things, these contain no script.
2020-02-03 16:37:54 -05:00
Aaron Franke
c270db0635 Remove the kinematic collision demo
Lots of demos already feature collisions with KinematicBodies
2020-02-03 16:37:54 -05:00
Aaron Franke
746928b623 Update kinematic character 2020-02-03 16:37:54 -05:00
Aaron Franke
b0b63e80f5 Update isometric demo 2020-02-03 16:37:54 -05:00
Aaron Franke
7421736568 Update hex map demo 2020-02-03 16:37:54 -05:00
Aaron Franke
db6967868f Update HDR demo 2020-02-03 16:37:54 -05:00
Aaron Franke
49a01d6f87 Update grid based movement demo 2020-02-03 16:37:54 -05:00
Aaron Franke
ff10a807d0 Update GD Paint demo 2020-02-03 16:37:54 -05:00
Aaron Franke
704ebeec81 Merge pull request #400 from aaronfranke/2d-physics-pl
Update 2D physics platformer
2020-02-03 16:33:06 -05:00
Aaron Franke
60f515eaf9 Merge pull request #399 from aaronfranke/rpg
Update 2D role playing game
2020-02-03 16:30:36 -05:00
Aaron Franke
3eeba859b1 Update 2D physics platformer 2020-02-03 04:00:44 -05:00
Aaron Franke
9218f88723 Update 2D role playing game 2020-02-03 03:57:46 -05:00
Aaron Franke
375d5d13d2 Merge pull request #397 from aaronfranke/misc
Update and improve misc demos for Godot 3.1.2
2020-02-03 03:55:36 -05:00
Aaron Franke
c9d3646d45 Merge pull request #398 from aaronfranke/fsm
Update Finite State Machine demo to Godot 3.1.2
2020-02-03 03:55:25 -05:00
Aaron Franke
9975c95065 Update Finite State Machine demo 2020-02-02 20:28:25 -05:00
Aaron Franke
c90a251445 Update the rest of the misc demos to Godot 3.1.2
I have not tested if these work, but I made minimal changes to them (only things like comments and newlines).
2020-02-02 04:53:12 -05:00
Aaron Franke
cd7c652975 Improve scene instancing demo 2020-02-02 04:53:12 -05:00
Aaron Franke
e5ee4a5971 Improve the tween demo
Significant style changes.
2020-02-02 04:53:12 -05:00
Aaron Franke
729be3461d Style fixes for open simplex noise demo 2020-02-02 04:53:12 -05:00
Aaron Franke
abf9d68bf4 Improve regex demo 2020-02-02 04:53:12 -05:00
Aaron Franke
67a490ab50 Improve pause demo 2020-02-02 04:53:12 -05:00
Aaron Franke
f07c7091fc Improve window management demo 2020-02-02 04:53:12 -05:00
Aaron Franke
ac882369bc Merge pull request #395 from aaronfranke/gui
Improve GUI demos
2020-02-02 03:13:34 -05:00
Aaron Franke
6899d44615 Merge pull request #394 from aaronfranke/pong
Update and improve all Pong demos
2020-02-01 15:55:57 -05:00
Aaron Franke
84c8d6ef69 Update and improve GUI demos 2020-02-01 15:47:44 -05:00
Aaron Franke
691f1d94d6 Merge pull request #393 from aaronfranke/viewport
Update remaining Viewport demos to Godot 3.1.2
2020-02-01 15:34:02 -05:00
Aaron Franke
cb5906aea3 Slightly improve the GUI in 3D demo 2020-02-01 03:18:53 -05:00
Aaron Franke
237a8654b0 Improve the screen capture demo 2020-02-01 03:18:53 -05:00
Aaron Franke
4f5f0ec1a9 Update all Pong demos to Godot 3.1.2 and conform to style guides 2020-02-01 03:15:27 -05:00
Aaron Franke
e3fd4c662c Update 3D in 2D demo to Godot 3.1.2 2020-01-31 15:15:57 -05:00
Aaron Franke
ff93de81bb Merge pull request #391 from aaronfranke/mono
Update and improve Mono demos and Dodge the Creeps GDScript
2020-01-31 13:01:25 -05:00
Aaron Franke
28c3103132 Merge pull request #388 from aaronfranke/material-tester
Significantly improve the material tester demo
2020-01-31 12:32:41 -05:00
Aaron Franke
958f686e12 Update Dodge the Creeps GDScript to Godot 3.1.2 2020-01-31 02:47:36 -05:00
Aaron Franke
edb8372db8 Update Dodge the Creeps C# to Godot 3.1.2 2020-01-31 02:47:36 -05:00
Aaron Franke
de57f45049 Update Pong with C# demo to Godot 3.1.2 2020-01-31 01:43:40 -05:00
Aaron Franke
4ec9d7921b Significantly improve the material tester demo 2020-01-30 21:48:59 -05:00
Aaron Franke
a5b8cd11d9 Merge pull request #385 from aaronfranke/truck-town
Update and improve Truck Town for Godot 3.1.2
2020-01-29 21:10:21 -05:00
Aaron Franke
0746c063b4 Merge pull request #384 from aaronfranke/navmesh
Update 3D navmesh demo to Godot 3.1.2
2020-01-29 21:10:04 -05:00
Aaron Franke
9e197b8c20 Merge pull request #383 from aaronfranke/platformer-3d
Update Platformer 3D demo to Godot 3.1.2
2020-01-29 21:09:54 -05:00
TwistedTwigleg
2e681e132a IK demo: Fixed bug in FABRIK IK that would cause the right arm to freak out by changing the middle joint code. 2020-01-29 17:52:25 -05:00
Aaron Franke
2afbeef96f Allow using WASD and controllers in Truck Town 2020-01-29 17:43:46 -05:00
TwistedTwigleg
40bcc0f55f Added SkeletonIK example to IK demo. Updated the anchors on all of the UI so it can scale to any sized window. Removed the project settings keeping the aspect ratio the same 2020-01-29 17:37:04 -05:00
Aaron Franke
9c17c25343 Update and improve Truck Town for Godot 3.1.2
Conform to style guide
2020-01-29 17:36:50 -05:00
Aaron Franke
357620b336 Update 3D navmesh demo to Godot 3.1.2 2020-01-29 17:07:18 -05:00
Aaron Franke
33494c4592 [3DP] Update to Godot 3.1.2
Conform to style guide, add WASD movement, add controller support
2020-01-29 17:00:07 -05:00
Aaron Franke
76d43cf23a [3DP] Convert SCN to TSCN 2020-01-29 15:58:17 -05:00
TwistedTwigleg
59e85689ba IK Demo - Removed code that straightens the FABRIK chain when the target is out of reach because it was not working, and instead just run the FABRIK chain even if the target is out of reach. This straightens the arms like expected and simplifies the code. Moved the camera back in both the look_at_ik and fabrik_ik scenes 2020-01-29 14:13:50 -05:00
TwistedTwigleg
fd6e157596 Minor typo and style fixes for the IK demo 2020-01-29 13:43:54 -05:00
TwistedTwigleg
3dbd79217d Fixed GDScript IK demo so it works with Godot 3.2 2020-01-29 13:19:14 -05:00
Aaron Franke
97f9632be4 Merge pull request #381 from aaronfranke/loading
Move loading demos to their own folder
2020-01-28 20:11:54 -05:00
Aaron Franke
463da9948f Update and improve background load demo 2020-01-28 14:23:24 -05:00
Aaron Franke
04d86775da Move loading demos to their own folder 2020-01-28 14:19:42 -05:00
Aaron Franke
c6922db2a1 Merge pull request #380 from aaronfranke/display-folded
Clean up editor/display_folded
2020-01-28 13:49:32 -05:00
Aaron Franke
43dcf5c1e7 Clean up editor/display_folded 2020-01-28 13:47:21 -05:00
Aaron Franke
d19c746231 Merge pull request #371 from BenjaminNavarro/master
Add dynamic split screen demo
2020-01-28 13:38:26 -05:00
Aaron Franke
aca3ea4749 Merge pull request #341 from Calinou/handle-multiple-resolutions
Handle multiple resolutions in most demos
2020-01-28 13:29:37 -05:00
Hugo Locurcio
a45b84a5ad Handle multiple resolutions in most demos
This makes demos render correctly on hiDPI displays,
while also demonstrating how to handle multiple resolutions.

The 3D in 2D demo now uses "3D No-Effects" for the 3D viewport,
which is faster to render. Thanks to this, 4× MSAA is now enabled
for a better result.

The background loading demo now uses mipmaps for better-looking images.

The material testers demo now samples mouse input in a
resolution-independent manner when panning.

Default clear colors were also changed in some projects for visual
consistency with the project's theme.
2020-01-28 19:08:03 +01:00
Benjamin Navarro
5bdd178d85 Embed WorldEnvironement scene into the main one 2020-01-28 13:32:45 +01:00
Benjamin Navarro
b93d9028a9 Coding style 2020-01-28 13:32:18 +01:00
Benjamin Navarro
566c7e15f8 Use second controller's left stick for player2 2020-01-28 13:27:55 +01:00
Aaron Franke
eb814782c6 Merge pull request #357 from pigdevstudio/pause-demo
Improve Pause demo
2020-01-27 05:33:06 -05:00
Aaron Franke
029706d4fb Merge pull request #356 from pigdevstudio/add-script-instancing
Add Ball Factory
2020-01-27 05:29:40 -05:00
Benjamin Navarro
f922bcb8c7 Add dynamic split screen demo
Answering PR reviews

Removeing class_name

_get_split_state documentation

Mentioning Voronoi split screen in README

Fixing comments

Use the same script for both players

The input map is configured to work with AZERTY and QWERTY keyboards

Use spaces for comments alignment + code style

Fix empty line and incorrect comment

Add arrow keys to control player 2

Removing most static typing as suggested for demo projects

Removing broken split origin feature

Removing the floor texture to avoid copyright issues

Changing game icon

Make Walls.gd a tool script + randomize

Fixing style

 Handle joysticks for player movement
2020-01-27 08:58:50 +01:00
Aaron Franke
2490d9ae45 Merge pull request #379 from aaronfranke/2d-in-3d
Update 2D in 3D demo to Godot 3.1.2
2020-01-26 16:55:59 -05:00
Aaron Franke
f9b9b86949 Update 2D in 3D demo to Godot 3.1.2
Conform to style guide, make positions exact, fix viewport quad
2020-01-26 16:53:20 -05:00
Aaron Franke
79f7554bc3 Merge pull request #376 from aaronfranke/plugin-demos
Update and improve plugin demos
2020-01-26 16:52:30 -05:00
Aaron Franke
7e96ba1a6a Update plugin demos 2020-01-26 02:21:24 -05:00
Aaron Franke
861f0418f0 Merge pull request #324 from talklittle/role-playing-game-3.1
Port 2d/role_playing_game to Godot 3.1
2020-01-23 00:23:47 -05:00
Aaron Franke
8a6b1f87ba Merge pull request #89 from TwistedTwigleg/gd_paint
Added a simple drawing demo (GD paint)
2020-01-22 18:51:52 -05:00
Aaron Franke
c5a37ea618 Merge pull request #323 from Calinou/2d-platformer-ultrawide
Make the Platformer 2D demo work with ultrawide displays
2020-01-22 18:50:30 -05:00
Aaron Franke
c0f4bad011 Merge pull request #337 from robspsj/extract_shaders
Extract shader code from 2D shader demos
2020-01-22 17:53:10 -05:00
Aaron Franke
7658e62636 Merge pull request #374 from aaronfranke/device-changer
Update Audio Device Changer demo to Godot 3.1.2
2020-01-22 17:37:38 -05:00
Aaron Franke
b1953be73f Update Audio Device Changer demo to Godot 3.1.2 2020-01-22 17:32:12 -05:00
Aaron Franke
5bc48e2080 Merge pull request #287 from marcelofg55/audio_device_changer
Add new Audio Device Changer demo
2020-01-22 16:32:11 -05:00
Aaron Franke
2c6df4ed79 Merge pull request #364 from Jummit/tidy
Tidy up Main.vs in the CirclePop demo
2020-01-21 21:48:16 -05:00
Aaron Franke
015cb6e64c Merge pull request #350 from aaronfranke/audio
Update Audio demos for Godot 3.1.1
2020-01-21 21:36:58 -05:00
Aaron Franke
617896737e Update Audio demos for Godot 3.1.1 2020-01-21 21:33:36 -05:00
Aaron Franke
50d5a118c9 Merge pull request #330 from aaronfranke/update-ik
Update and optimize 3D IK Demo
2020-01-21 21:24:20 -05:00
Aaron Franke
e5e20a57a1 [IK] Conform to the new GDScript style guide 2020-01-21 21:20:27 -05:00
Aaron Franke
72ff4543c8 [IK] Organize FPS into subfolder
Also, removed Wall8 so that you can't get stuck
2020-01-21 21:18:09 -05:00
Aaron Franke
f863ebe52c [IK] Refactor ik_fabrik.gd
Add static typing in many places, cache values to improve performance, use printerr, use Vector3.UP, and use linear_interpolate method
2020-01-21 21:17:09 -05:00
Aaron Franke
4ce086a745 [IK] FPS example fixes
Fix being able to lean through walls, fix walls floating slightly above the ground, aligned walls to integer grid when applicable
2020-01-21 21:16:25 -05:00
Aaron Franke
6a1fe3b48a [IK] Script fixes
Fix warnings, ensure functions are spaced
2020-01-21 21:15:42 -05:00
Aaron Franke
990042e3c5 [IK] Update to Godot 3.1
Open and save all resources
2020-01-21 21:15:31 -05:00
Aaron Franke
53fc37e64e Merge pull request #331 from aaronfranke/update-kc3d
Update and optimize 3D KC demo
2020-01-21 20:28:32 -05:00
Aaron Franke
de309f0544 Merge pull request #299 from TwistedTwigleg/gui_in_3d_fix
Rewrote most of the code in the gui_in_3d demo.
2020-01-21 20:22:37 -05:00
Aaron Franke
c101b13b27 Merge pull request #340 from aaronfranke/misc-files-templates
Funding and issue template files, and update gitignore
2020-01-21 20:18:50 -05:00
Hugo Locurcio
54ae746654 Merge pull request #370 from Calinou/material-testers-disable-etc2-import
Disable ETC2 texture compression in the Material Testers demo
2020-01-09 22:53:13 +01:00
Aaron Franke
21e6dc8576 Add Matrix Transform demo 2020-01-08 15:37:29 -05:00
Rémi Verschelde
1ca3204e0a hexmap: Enable Centered Texture option
See godotengine/godot#21213.
2020-01-08 09:43:10 +01:00
Hugo Locurcio
d191bf5558 Disable ETC2 texture compression in the Material Testers demo
Importing ETC2 textures is slow and requires a lot of RAM, so it
makes sense to disable it. Those who would like to run the demo
on mobile platforms can re-enable it in the Project Settings.
2020-01-04 00:19:55 +01:00
Rémi Verschelde
61ea666d69 Remove bogus draw_order values due to a pre-3.0 initialization bug
Fixes godotengine/godot#25642.
2020-01-02 11:25:16 +01:00
Jummit
ebdb732fc8 tidy up Main.vs 2019-12-07 16:58:48 +01:00
TwistedTwigleg
ee3dac1635 Fixed issue with strange tool script included in the gui in 3D demo 2019-10-20 14:33:02 -04:00
Bojidar Marinov
c34a2b423b Merge pull request #348 from texaco/master
Fix seesaw falling plank from 2d demo
2019-10-16 10:26:48 +03:00
Manolo Texaco
98e60d4ff6 Fix seesaw falling plank from 2d demo
Seesaw did stand up in 2d Demo - Physics Platformer.

Add a pillar as static body and reasign PinJoin2D nodes
2019-10-16 10:23:30 +03:00
Henrique Campos
85afe1bc9a Improved Pause demo 2019-10-07 21:19:13 -03:00
Henrique Campos
1ae9f1b549 Added Ball Factory and Removed container.png using a Polygond2D instead 2019-10-07 21:04:40 -03:00
Rémi Verschelde
d29b987235 Merge pull request #353 from hbina/fix_quat_error
Fixed casting from Basis to Quat
2019-09-26 12:36:20 +02:00
Hanif Bin Ariffin
1e44578b1e Fixed basis -> quat casting
Noticed a lot of error spat out because of unnormalized basis.
I simply followed the suggestion to use get_rotation_quat() instead of using constructor of Quat(x).
2019-09-23 19:09:40 -04:00
TwistedTwigleg
61ea89e836 Made minor changes to GUI in 3D demo script 2019-08-29 13:26:51 -04:00
TwistedTwigleg
0d40b69c19 Minor changes to GD_Paint demo 2019-08-29 13:17:15 -04:00
Rémi Verschelde
9b2da1fa2f Merge pull request #343 from Faless/websocket/initial
Add 3 WebSocket demos
2019-08-22 14:34:03 +02:00
Roberto Proença
36c9ecdfa8 Extract shader code from 2D shader demos 2019-07-31 13:15:42 -03:00
Fabio Alessandrelli
359ef78ee0 Add WebSocket high level multiplayer demo. 2019-07-28 15:25:36 +02:00
Fabio Alessandrelli
e9f02ff05f Add Websocket chat demo 2019-07-28 14:20:57 +02:00
Fabio Alessandrelli
949a9428eb Add websocket minimal demo 2019-07-28 14:13:19 +02:00
Hugo Locurcio
974e506371 Make the Platformer 2D demo work with ultrawide displays
This makes it possible to fill the whole viewport when playing on
a 21:9 monitor or a 19:9 smartphone.
2019-07-20 11:33:05 +02:00
Aaron Franke
3bf7046184 FUNDING, issue template files, and update gitignore
The mono_crash ignore is because they generated anytime there was a crash. The rest of the files mirror the main Godot repo.
2019-07-19 18:07:46 -04:00
Aaron Franke
a2e7bf2b36 [KC3D] Improvements and fixes
WASD movement, script improvements, move Cubio to its own scene, capitalize nodes, better win text, fix GDScript warnings
2019-07-11 13:31:06 -04:00
Aaron Franke
fa09138422 [KC3D] Convert scn to tscn and res to tres 2019-07-11 13:31:06 -04:00
Rémi Verschelde
c2d2718cca Merge pull request #339 from Faless/mp/bomber_fix_pr
Use p2p in multiplayer bomber player exchange.
2019-07-11 08:33:15 +02:00
Fabio Alessandrelli
38bfaba92d Use p2p in multiplayer bomber player exchange.
We used to broadcast player info on connect and have the server relay it
to other clients.
With this approach, each peer (including server) sends its own info once
to other peers as soon as they connects.
When a new player connects, it is notified of all the already connected
peers by the `network_peer_connected` signal.
Any already connected peer is also notified of the newly connected peer
by the same signal.
2019-07-10 18:29:44 +02:00
Rémi Verschelde
85f36d6b3b Merge pull request #338 from kjav/master
Fixed typo in overlay instructions
2019-07-08 07:10:05 +02:00
Sam
bee90f6bd7 Fixed typo in overlay instructions 2019-07-06 00:59:21 +01:00
Rémi Verschelde
e691f98c18 Merge pull request #302 from kkmzero/patch-1
Automatic brake/reverse
2019-07-04 12:03:05 +02:00
Rémi Verschelde
99f6e67d40 Merge pull request #335 from Faless/webrtc/initial
Add two WebRTC demo
2019-06-19 14:27:39 +02:00
TwistedTwigleg
2c5b4a48d0 Made changes to gd_paint demo based on feedback by aaronfranke 2019-06-15 11:52:41 -04:00
TwistedTwigleg
82d9684caf Made changes to the gui in 3D demo based on suggestions by aaronfranke 2019-06-15 11:38:09 -04:00
TwistedTwigleg
a527318768 Updated demo to work with Godot 3.1 with changes in the demo rewrite PR. Changed comments according to discussion in merged PR 2019-06-15 11:38:09 -04:00
Wagner Ferreira
7e37b4162f Renamed to lowercase to follow conventions 2019-06-15 11:38:09 -04:00
Wagner Ferreira
9adc81ce7f Added extra rewriting in the code to improve mouse drag
* Made the whole block a separated scene to demonstrate it can work across multiple instances.
* Dropped the Area.input_event and did everything manually with raycasting.
* Made quad_mesh_size automatically pick the quad size, avoiding the extra setup.
* Changed from PlaneMesh to QuadMesh. Now everyting can start with 0 rotation.
* The function will keep handling input when the mouse is outside of the area to avoid orphan clicks, but stop when the click is released.
* Changed some variable and function names to make sense with the code changes.
* Added an extra function to deal with billboard mode. But is not perfect, specially with scaling and Y-billboard + camera tilting.
2019-06-15 11:38:09 -04:00
TwistedTwigleg
092cf6fc03 Rewrote most of the code in the gui_in_3d demo. Now the demo supports viewports of different sizes, different sized quads, and has comments explaining what the code is doing 2019-06-15 11:38:09 -04:00
Fabio Alessandrelli
2a57c64c30 Add webrtc signaling example 2019-06-14 06:15:22 +02:00
Fabio Alessandrelli
0bbe5ef586 Add minimal connection demos 2019-06-14 04:14:53 +02:00
Rémi Verschelde
0db440bb55 Merge pull request #274 from Calinou/optimize-images
Optimize all images using `oxipng -o6 --strip all --zopfli`
2019-06-14 00:16:48 +02:00
Hugo Locurcio
184b0fe5f8 Optimize all images using oxipng -o6 --strip all --zopfli 2019-06-11 16:40:50 +02:00
Rémi Verschelde
6a9bb96ebd Merge pull request #332 from t-karcher/visual-script-patch
Visual Script demos converted to and tested with V3.1
2019-06-11 12:25:06 +02:00
Rémi Verschelde
4bb717c59f Merge pull request #220 from Calinou/increase-sky-radiance-size
Increase sky radiance size to 128 (from 64) in the Material Tester demo
2019-06-10 15:31:21 +02:00
Rémi Verschelde
f83706d306 Merge pull request #286 from williamd1k0/improve-godette-sprite
Improve Godette sprite in sprite_shaders demo
2019-06-10 10:49:21 +02:00
TwistedTwigleg
7ad43829ef Updated project to work with the latest version of Godot. Reworked the code so it is cleaner and easier to understand. Updated comments within code according to changes 2019-06-09 18:44:01 -04:00
Hugo Locurcio
7f41a74a98 Increase sky radiance size to 128 (from 64) in the Material Tester demo
This makes reflections look nicer, especially on materials with low
roughness values.
2019-06-05 13:38:52 +02:00
Andrew Shu
11425f2a6a Port 2d/role_playing_game to Godot 3.1
1. Renamed `CELL_TYPES` enums to `CellType`
2. Fixed references, old: `turn_combat_system/actors/Actor.gd`, new: `turn_combat/combatants/Combatant.gd`
3. Fixed references, old: `turn_combat_system/actors/health/Health.tscn`, new: `turn_combat/combatants/health/Health.tscn`
4. Fixed bug in `grid_movement/pawns/Actor.gd` extending lowercase `pawn.gd`; changed to `Pawn.gd`
5. Renamed lowercase `grid_movement/pawns/actor.gd` to capital `Actor.gd` for consistency
6. Fixed some unused local variables warnings

Other changes are from engine, after opening and saving all scenes.
2019-06-04 16:45:41 -07:00
Thomas Karcher
626b9178bb Converted to and tested with V3.1 2019-06-04 21:25:25 +02:00
Rémi Verschelde
47be86af93 Merge pull request #319 from wscalf/master
Updated rotation of Quad to be right side up
2019-06-03 21:31:54 +02:00
Rémi Verschelde
61c03933e4 Merge pull request #328 from t-karcher/patch-1
More projects converted to and tested with Godot 3.1
2019-06-03 21:17:03 +02:00
Thomas Karcher
1cfb3ee621 Small bugfix in 3D platformer
Gravity vector is zero in the first few frames, leading to errors in follow-up calculations expecting a normalized  vector. Fixed by assigning a default gravity in case those cases.
2019-05-15 21:57:35 +02:00
Thomas Karcher
39590fadd3 2D RPG converted to and tested with V3.1 2019-05-15 21:34:26 +02:00
Thomas Karcher
d21936b32d 3D projects converted to and tested with Godot 3.1 2019-05-15 19:26:16 +02:00
Thomas Karcher
d9a4d21e16 Updated latest Godot version (3.1) in README.md 2019-05-14 15:33:44 +02:00
Rémi Verschelde
b9bca13221 Merge pull request #326 from DevinPentecost/opensimplexnoise
Adding OpenSimplexNoise Viewer demo
2019-05-10 11:15:47 +02:00
Devin Pentecost
19c4d7311f Adding example NoiseTexture usage, as an example
Set the use_noise_texture flag to true to use it instead.
2019-05-08 21:58:10 -07:00
Devin Pentecost
27727fdde5 Adding OpenSimplexNoise Viewer demo 2019-05-04 23:50:24 -07:00
Juan Linietsky
ceefc33fe4 Improved tutorial for sync audio with music, use two approaches. 2019-04-27 15:26:48 -03:00
Juan Linietsky
e22a46f301 Add a BPM sync tutorial. 2019-04-27 14:14:17 -03:00
Juan Linietsky
c819e3b276 Demos for sound generation and audio spectrum analysis. 2019-04-10 12:26:55 -03:00
Rémi Verschelde
56a2b28c53 Merge pull request #322 from bojidar-bg/321-navigation-reach-end
Fix navigation demo not reaching the final point
2019-04-08 16:43:38 +02:00
Bojidar Marinov
55d1deeeac Fix navigation demo not reaching the final point
Fixes #321
2019-04-08 16:46:00 +03:00
William Scalf
cc0b002e6e Updated rotation of Quad to be right side up 2019-03-23 18:06:43 -04:00
Rémi Verschelde
17e80079e3 Merge pull request #318 from cbscribe/dodge_31_updates
Update Dodge demo to match 3.1 docs
2019-03-16 17:45:24 -07:00
Chris Bradfield
961c71d003 Update Dodge demo to match 3.1 docs 2019-03-16 17:26:56 -07:00
Rémi Verschelde
1a5517ae1a MicRecord: Improve UI for mobile, add status label 2019-03-08 15:39:49 +01:00
Rémi Verschelde
63392a3574 Port 3D kinematic char and materials tester to Godot 3.1 2019-03-07 23:36:30 +01:00
TestDotCom
2fb80980b9 2d/physics_platformer works flawlessly on Godot 3.1 beta 8 (#312)
* 2d/physics_platformer works flawlessly on Godot 3.1 beta 8
* fix warnings for inferred node type
* every script has a class_name
* formatted code for better clarity
* each files has its own subfolder
* bullet collisions and shooting have to be executed from call_deferred

* PascalCase naming for nodes
2019-03-04 12:12:33 +01:00
TestDotCom
81441c42b7 2d/platformer works flawlessly on Godot 3.1 beta 8 (#310)
* 2d/platformer works flawlessly on Godot 3.1 beta 8
* fix warnings for inferred node type
* every script has a class_name
* formatted code for better clarity
* each files has its own subfolder

* As suggested by @akien-mga
* states are back to const instead of enum
* class_name comes after extends
* better code style

* PascalCase for nodes
2019-03-04 12:12:08 +01:00
Rémi Verschelde
cfcc0f3964 Port misc and plugin demos to Godot 3.1 2019-02-26 15:13:08 +01:00
Rémi Verschelde
a38b315064 Port audio, gui, mono, networking and viewport demos to Godot 3.1 2019-02-26 14:50:18 +01:00
Rémi Verschelde
faae60ac2f Port 2D demos to Godot 3.1
Opened them, saved all scenes, ran the project. Did necessary fixes here and there,
fixed some warnings (but some remain in bigger demos).

Did not port JRPG demo yet (#306) nor the two platformer demos.
2019-02-26 14:22:02 +01:00
Ivan Kmeťo
bded14a506 Automatic brake/reverse
Value fwd_mps converts global velocity into a velocity vector which is rotated to cars local coordinate system (in this example x-axis).
Then if key "ui_down" is pressed and the fwd_mps value is greater or equal to -1 (which seems to be very good spot and represents car still moving forward but nearly standing still) the car reverses (negative engine_force_value). If this condition isn't met (which means the car is moving forward) then the car brakes.

Tested and working on Godot 3.1 Beta 3.

Suggestions:
In this case, if you want something more realistic, the -engine_force_value can be much lower because no car reverses in same speed as it goes forward but for the sake of demo project I left it as it is.

Created for my own project with help of user wombatstampede from godotdevelopers.org/forum
2019-02-06 05:59:45 +01:00
Toshio Araki
a6ce6dbf4c Updated 2D pathfinding for version 3.1 (#301) 2019-01-29 09:00:43 +01:00
Marcelo Fernandez
db411004b5 Add new Audio Device Changer demo 2018-10-08 22:23:23 -03:00
William Tumeo
765ca64680 Improve Godette sprite in sprite_shaders demo 2018-10-02 00:58:08 -03:00
TwistedTwigleg
a159361a2f Added a simple drawing example to help show how to use the drawing functions
in CanvasItem to make a simple MS paint like program.
2017-11-03 14:23:07 -04:00
2869 changed files with 89779 additions and 43726 deletions

2
.gitattributes vendored
View File

@@ -1,2 +1,4 @@
# Normalize EOL for all files that Git considers text files.
* text=auto eol=lf
*.hdr binary

13
.github/CODEOWNERS vendored Normal file
View File

@@ -0,0 +1,13 @@
# Lines starting with '#' are comments.
# Each line is a file pattern followed by one or more owners.
# Owners can be @users, @org/teams or emails
/.github/dist/ @Calinou
/3d/voxel/ @aaronfranke
/misc/matrix_transform/ @aaronfranke
/misc/2.5d/ @aaronfranke
/mono/2.5d/ @aaronfranke
/2d/physics_tests/ @pouleyKetchoupp
/3d/physics_tests/ @pouleyKetchoupp

34
.github/ISSUE_TEMPLATE/bug-report.md vendored Normal file
View File

@@ -0,0 +1,34 @@
---
name: Bug Report
about: Report a bug with one of the demo projects.
title: ""
labels: bug
assignees: ""
---
<!--
Please search existing issues for potential duplicates before filing yours:
https://github.com/godotengine/godot-demo-projects/issues?q=is%3Aissue
Only submit an issue if it is reproducible with the latest stable Godot version.
-->
**Which demo project is affected:**
<!-- Specify the project name or path. -->
**OS/device including version:**
<!-- Specify GPU model and drivers if graphics-related. -->
**Issue description:**
<!-- What happened, what was expected, and what went wrong. -->
**Screenshots of issue:**
<!--
This section is optional.
Drag in an image, or post an image with a link in the form of:
![Alt Text Here](https://pbs.twimg.com/media/DW5AJnZVAAM1805?format=jpg)
-->

View File

@@ -0,0 +1,19 @@
---
name: Feature / Enhancement Request
about: Adding new features or improving existing ones.
title: ""
labels: enhancement
assignees: ""
---
<!--
Please search existing issues for potential duplicates before filing yours:
https://github.com/godotengine/godot-demo-projects/issues?q=is%3Aissue
-->
**Which demo project is affected:**
<!-- Specify the project name or path. -->
**Description:**

23
.github/PULL_REQUEST_TEMPLATE.md vendored Normal file
View File

@@ -0,0 +1,23 @@
<!--
Only submit a pull request if all of the following conditions are met:
* 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.
-->

6
.github/dependabot.yml vendored Normal file
View File

@@ -0,0 +1,6 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"

0
.github/dist/.nojekyll vendored Normal file
View File

23
.github/dist/export_presets.cfg vendored Normal file
View File

@@ -0,0 +1,23 @@
[preset.0]
name="HTML5"
platform="HTML5"
runnable=true
custom_features=""
export_filter="all_resources"
include_filter="*.json"
exclude_filter=""
export_path=""
script_export_mode=1
script_encryption_key=""
[preset.0.options]
custom_template/debug=""
custom_template/release=""
variant/export_type=0
vram_texture_compression/for_desktop=true
vram_texture_compression/for_mobile=false
html/custom_html_shell=""
html/head_include=""
html/full_window_size=true

20
.github/dist/footer.html vendored Normal file
View File

@@ -0,0 +1,20 @@
<!-- 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>
</body>
</html>

118
.github/dist/header.html vendored Normal file
View File

@@ -0,0 +1,118 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Godot demos exported to HTML5</title>
<style>
:root {
--background-color: #fff;
--text-color: #222;
--link-color: hsl(220, 100%, 45%);
--link-underline-color: hsla(220, 100%, 45%, 0.3);
}
@media (prefers-color-scheme: dark) {
:root {
--background-color: #222;
--text-color: #eee;
--link-color: hsl(200, 100%, 70%);
--link-underline-color: hsla(200, 100%, 70%, 0.3);
}
}
*:focus {
/* More visible outline for better keyboard navigation. */
outline: 0.125rem solid hsl(220, 100%, 62.5%);
/* Make the outline always appear above other elements. */
position: relative;
}
html {
background-color: var(--background-color);
color: var(--text-color);
}
body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
max-width: 50rem;
margin: 0 auto;
padding: 0.75rem;
line-height: 1.618rem;
}
h2 {
margin-top: 2.5rem;
}
a {
color: var(--link-color);
text-decoration-color: var(--link-underline-color);
text-decoration-thickness: 0.125rem;
}
a:hover {
filter: brightness(117.5%);
}
a:active {
filter: brightness(82.5%);
}
ul {
padding-left: 0;
}
li {
display: block;
}
li a {
display: inline-block;
width: 100%;
height: 4rem;
margin-left: 0.5rem;
}
li a:hover {
background-color: hsla(0, 0%, 50%, 0.1);
}
li a * {
float: left;
}
li a p {
height: 24px;
margin: 20px 10px;
}
</style>
</head>
<body>
<h1>Godot demo projects</h1>
<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
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,
especially on mobile devices.
For best performance, it's recommended to
<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.
</p>
<h2>List of demos</h2>
<ul>
<!-- The list of demos will be inserted below by the CI process. -->

8
2d/README.md Normal file
View File

@@ -0,0 +1,8 @@
# 2D Demos
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)
Renderers: 4 of them are GLES 3, but most are GLES 2

View File

@@ -0,0 +1,20 @@
# Bullet Shower
This demonstrates how to manage large amounts of objects efficiently using
low-level Servers.
See
[Optimization using Servers](https://docs.godotengine.org/en/latest/tutorials/performance/using_servers.html)
in the documentation for more information.
Language: GDScript
Renderer: GLES 2
Check out this demo on the asset library: https://godotengine.org/asset-library/asset/887
## Screenshots
![No collision](screenshots/no_collision.png)
![Collision](screenshots/collision.png)

BIN
2d/bullet_shower/bullet.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 312 B

View File

@@ -0,0 +1,35 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/bullet.png-ff1424653e10246c11e3724e402c519e.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://bullet.png"
dest_files=[ "res://.import/bullet.png-ff1424653e10246c11e3724e402c519e.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

View File

@@ -0,0 +1,93 @@
extends Node2D
# This demo is an example of controling 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.
const BULLET_COUNT = 500
const SPEED_MIN = 20
const SPEED_MAX = 80
const bullet_image = preload("res://bullet.png")
var bullets = []
var shape
class Bullet:
var position = Vector2()
var speed = 1.0
# The body is stored as a 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()
func _ready():
randomize()
shape = Physics2DServer.circle_shape_create()
# Set the collision shape's radius for each bullet in pixels.
Physics2DServer.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()
Physics2DServer.body_set_space(bullet.body, get_world_2d().get_space())
Physics2DServer.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)
# 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()
transform2d.origin = bullet.position
Physics2DServer.body_set_state(bullet.body, Physics2DServer.BODY_STATE_TRANSFORM, transform2d)
bullets.push_back(bullet)
func _process(_delta):
# Order the CanvasItem to update every frame.
update()
func _physics_process(delta):
var transform2d = Transform2D()
var offset = get_viewport_rect().size.x + 16
for 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.
bullet.position.x = offset
transform2d.origin = bullet.position
Physics2DServer.body_set_state(bullet.body, Physics2DServer.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:
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)
Physics2DServer.free_rid(shape)
bullets.clear()

Binary file not shown.

After

Width:  |  Height:  |  Size: 907 B

View File

@@ -0,0 +1,35 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/face_happy.png-38d387d31ec13459f749c93ce3d75d80.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://face_happy.png"
dest_files=[ "res://.import/face_happy.png-38d387d31ec13459f749c93ce3d75d80.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: 846 B

View File

@@ -0,0 +1,35 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/face_sad.png-0ac7165eab24f595aba17a746a66c550.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://face_sad.png"
dest_files=[ "res://.import/face_sad.png-0ac7165eab24f595aba17a746a66c550.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.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

View File

@@ -0,0 +1,35 @@
[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

View File

@@ -0,0 +1,33 @@
extends Node2D
# This demo is an example of controling 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
onready var sprite = $AnimatedSprite
func _ready():
# 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 _on_body_shape_entered(_body_id, _body, _body_shape, _local_shape):
touching += 1
if touching >= 1:
sprite.frame = 1
func _on_body_shape_exited(_body_id, _body, _body_shape, _local_shape):
touching -= 1
if touching == 0:
sprite.frame = 0

View File

@@ -0,0 +1,40 @@
; 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=4
_global_script_classes=[ ]
_global_script_class_icons={
}
[application]
config/name="Bullet Shower"
config/description="Demonstrates how to manage large amounts of objects efficiently using low-level Servers."
run/main_scene="res://shower.tscn"
config/icon="res://icon.png"
[display]
window/dpi/allow_hidpi=true
window/stretch/mode="2d"
window/stretch/aspect="expand"
[physics]
common/enable_pause_aware_picking=true
2d/cell_size=64
[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 )

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 152 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 150 KiB

View File

@@ -0,0 +1,34 @@
[gd_scene load_steps=7 format=2]
[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]
[sub_resource type="SpriteFrames" id=1]
animations = [ {
"frames": [ ExtResource( 3 ), ExtResource( 4 ) ],
"loop": true,
"name": "default",
"speed": 5.0
} ]
[sub_resource type="CircleShape2D" id=2]
radius = 27.0
[node name="Shower" type="Node2D"]
[node name="Bullets" type="Node2D" parent="."]
script = ExtResource( 2 )
[node name="Player" type="Area2D" parent="."]
script = ExtResource( 5 )
[node name="AnimatedSprite" type="AnimatedSprite" parent="Player"]
frames = SubResource( 1 )
[node name="CollisionShape2D" type="CollisionShape2D" parent="Player"]
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

@@ -2,24 +2,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")
yield($MessageTimer, "timeout")
$StartButton.show()
$MessageLabel.text = "Dodge the\nCreeps!"
$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,126 +1,61 @@
[gd_scene load_steps=6 format=2]
[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
use_mipmaps = false
use_filter = false
font_data = ExtResource( 2 )
_sections_unfolded = [ "Font", "Settings" ]
[sub_resource type="DynamicFont" id=2]
size = 72
use_mipmaps = false
use_filter = false
size = 64
font_data = ExtResource( 2 )
_sections_unfolded = [ "Font", "Settings" ]
[sub_resource type="DynamicFont" id=3]
[sub_resource type="InputEventAction" id=3]
action = "start_game"
size = 48
use_mipmaps = false
use_filter = false
font_data = ExtResource( 2 )
_sections_unfolded = [ "Font", "Settings" ]
[sub_resource type="ShortCut" id=4]
shortcut = SubResource( 3 )
[node name="HUD" type="CanvasLayer"]
layer = 1
offset = Vector2( 0, 0 )
rotation = 0.0
scale = Vector2( 1, 1 )
transform = Transform2D( 1, 0, 0, 1, 0, 0 )
script = ExtResource( 1 )
[node name="ScoreLabel" type="Label" parent="." index="0"]
anchor_left = 0.5
anchor_top = 0.0
anchor_right = 0.5
anchor_bottom = 0.0
margin_left = -25.0
margin_right = 25.0
margin_bottom = 100.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
mouse_filter = 2
mouse_default_cursor_shape = 0
size_flags_horizontal = 1
size_flags_vertical = 4
[node name="ScoreLabel" type="Label" parent="."]
anchor_right = 1.0
margin_bottom = 78.0
custom_fonts/font = SubResource( 1 )
text = "0"
align = 1
percent_visible = 1.0
lines_skipped = 0
max_lines_visible = -1
_sections_unfolded = [ "Anchor", "Margin", "custom_fonts" ]
[node name="MessageLabel" type="Label" parent="." index="1"]
anchor_left = 0.5
[node name="MessageLabel" type="Label" parent="."]
anchor_top = 0.5
anchor_right = 0.5
anchor_right = 1.0
anchor_bottom = 0.5
margin_left = -200.0
margin_top = -150.0
margin_right = 200.0
margin_bottom = 50.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
mouse_filter = 2
mouse_default_cursor_shape = 0
size_flags_horizontal = 1
size_flags_vertical = 4
custom_fonts/font = SubResource( 2 )
margin_top = -79.5
margin_bottom = 79.5
custom_fonts/font = SubResource( 1 )
text = "Dodge the
Creeps!"
Creeps"
align = 1
valign = 1
percent_visible = 1.0
lines_skipped = 0
max_lines_visible = -1
_sections_unfolded = [ "Anchor", "Margin", "custom_fonts" ]
[node name="MessageTimer" type="Timer" parent="." index="2"]
process_mode = 1
wait_time = 2.0
one_shot = true
autostart = false
[node name="StartButton" type="Button" parent="." index="3"]
[node name="StartButton" type="Button" parent="."]
anchor_left = 0.5
anchor_top = 1.0
anchor_right = 0.5
anchor_bottom = 1.0
margin_left = -100.0
margin_left = -90.0
margin_top = -200.0
margin_right = 100.0
margin_right = 90.0
margin_bottom = -100.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
focus_mode = 2
mouse_filter = 0
mouse_default_cursor_shape = 0
size_flags_horizontal = 1
size_flags_vertical = 1
custom_fonts/font = SubResource( 3 )
toggle_mode = false
enabled_focus_mode = 2
shortcut = null
group = null
custom_fonts/font = SubResource( 2 )
shortcut = SubResource( 4 )
text = "Start"
flat = false
align = 1
_sections_unfolded = [ "Anchor", "Margin", "Visibility", "custom_fonts" ]
__meta__ = {
"_edit_use_anchors_": false
}
[connection signal="timeout" from="MessageTimer" to="." method="_on_MessageTimer_timeout"]
[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,42 +1,62 @@
extends Node
export (PackedScene) var Mob
export(PackedScene) var mob_scene
var score
func _ready():
randomize()
func new_game():
score = 0
$HUD.update_score(score)
$Player.start($StartPosition.position)
$StartTimer.start()
$HUD.show_message("Get Ready")
$Music.play()
func game_over():
$DeathSound.play()
$Music.stop()
$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():
# choose a random location on the Path2D
$MobPath/MobSpawnLocation.set_offset(randi())
var mob = Mob.instance()
add_child(mob)
var direction = $MobPath/MobSpawnLocation.rotation + PI/2
mob.position = $MobPath/MobSpawnLocation.position
# add some randomness to the direction
direction += rand_range(-PI/4, PI/4)
mob.rotation = direction
mob.set_linear_velocity(Vector2(rand_range(mob.MIN_SPEED, mob.MAX_SPEED), 0).rotated(direction))
# 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_StartTimer_timeout():
$MobTimer.start()
$ScoreTimer.start()
func _on_ScoreTimer_timeout():
score += 1
$HUD.update_score(score)
func _on_StartTimer_timeout():
$MobTimer.start()
$ScoreTimer.start()

View File

@@ -8,105 +8,48 @@
[ext_resource path="res://art/gameover.wav" type="AudioStream" id=6]
[sub_resource type="Curve2D" id=1]
bake_interval = 5.0
_data = {
"points": PoolVector2Array( 0, 0, 0, 0, 1.70602, 3.56798, 0, 0, 0, 0, 482.263, 3.26522, 0, 0, 0, 0, 480.489, 729.458, 0, 0, 0, 0, 0.794434, 732.118, 0, 0, 0, 0, 1.97066, 3.83263 )
"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" index="0"]
[node name="Main" type="Node"]
script = ExtResource( 1 )
Mob = ExtResource( 2 )
mob_scene = ExtResource( 2 )
[node name="ColorRect" type="ColorRect" parent="." index="0"]
[node name="ColorRect" type="ColorRect" parent="."]
anchor_right = 1.0
anchor_bottom = 1.0
color = Color( 0.219608, 0.372549, 0.380392, 1 )
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_right = 486.0
margin_bottom = 734.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
mouse_filter = 0
mouse_default_cursor_shape = 0
size_flags_horizontal = 1
size_flags_vertical = 1
color = Color( 0.253451, 0.425288, 0.429412, 1 )
[node name="Player" parent="." instance=ExtResource( 3 )]
[node name="Player" parent="." index="1" instance=ExtResource( 3 )]
[node name="MobTimer" type="Timer" parent="." index="2"]
process_mode = 1
[node name="MobTimer" type="Timer" parent="."]
wait_time = 0.5
one_shot = false
autostart = false
[node name="ScoreTimer" type="Timer" parent="." index="3"]
[node name="ScoreTimer" type="Timer" parent="."]
process_mode = 1
wait_time = 1.0
one_shot = false
autostart = false
[node name="StartTimer" type="Timer" parent="." index="4"]
process_mode = 1
[node name="StartTimer" type="Timer" parent="."]
wait_time = 2.0
one_shot = true
autostart = false
[node name="StartPosition" type="Position2D" parent="." index="5"]
[node name="StartPosition" type="Position2D" parent="."]
position = Vector2( 240, 450 )
_sections_unfolded = [ "Transform" ]
[node name="HUD" parent="." index="6" instance=ExtResource( 4 )]
transform = Transform2D( 1, 0, 0, 1, 0, 0 )
[node name="Music" type="AudioStreamPlayer" parent="." index="7"]
stream = ExtResource( 5 )
volume_db = -8.0
autoplay = false
mix_target = 0
bus = "Master"
[node name="DeathSound" type="AudioStreamPlayer" parent="." index="8"]
stream = ExtResource( 6 )
volume_db = -5.0
autoplay = false
mix_target = 0
bus = "Master"
[node name="MobPath" type="Path2D" parent="." index="9"]
[node name="MobPath" type="Path2D" parent="."]
curve = SubResource( 1 )
[node name="MobSpawnLocation" type="PathFollow2D" parent="MobPath" index="0"]
[node name="MobSpawnLocation" type="PathFollow2D" parent="MobPath"]
position = Vector2( 1.70602, 3.56798 )
rotation = -0.000630111
offset = 0.0
h_offset = 0.0
v_offset = 0.0
rotate = true
cubic_interp = true
loop = true
lookahead = 4.0
[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 +1,11 @@
extends RigidBody2D
export (int) var MIN_SPEED
export (int) var MAX_SPEED
var mob_types = ["walk", "swim", "fly"]
func _ready():
$AnimatedSprite.playing = true
var mob_types = $AnimatedSprite.frames.get_animation_names()
$AnimatedSprite.animation = mob_types[randi() % mob_types.size()]
func _on_Visibility_screen_exited():
func _on_VisibilityNotifier2D_screen_exited():
queue_free()

View File

@@ -1,23 +1,17 @@
[gd_scene load_steps=10 format=2]
[ext_resource path="res://Mob.gd" type="Script" id=1]
[ext_resource path="res://art/enemyWalking_1.png" type="Texture" id=2]
[ext_resource path="res://art/enemyWalking_2.png" type="Texture" id=3]
[ext_resource path="res://art/enemyFlyingAlt_1.png" type="Texture" id=4]
[ext_resource path="res://art/enemyFlyingAlt_2.png" type="Texture" id=5]
[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": "walk",
"speed": 4.0
}, {
"frames": [ ExtResource( 4 ), ExtResource( 5 ) ],
"loop": true,
"name": "fly",
"speed": 3.0
}, {
@@ -25,58 +19,34 @@ animations = [ {
"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
custom_solver_bias = 0.0
radius = 34.8222
height = 28.8308
[node name="Mob" type="RigidBody2D"]
input_pickable = true
collision_layer = 1
[node name="Mob" type="RigidBody2D" groups=["mobs"]]
collision_mask = 0
mode = 0
mass = 1.0
friction = 1.0
bounce = 0.0
gravity_scale = 0.0
custom_integrator = false
continuous_cd = 0
contacts_reported = 0
contact_monitor = false
sleeping = false
can_sleep = true
linear_velocity = Vector2( 0, 0 )
linear_damp = 0.1
angular_velocity = 0.0
angular_damp = 1.0
script = ExtResource( 1 )
_sections_unfolded = [ "Angular", "Collision", "Transform" ]
__meta__ = {
"_edit_group_": true
}
MIN_SPEED = 150
MAX_SPEED = 250
[node name="AnimatedSprite" type="AnimatedSprite" parent="." index="0"]
[node name="AnimatedSprite" type="AnimatedSprite" parent="."]
scale = Vector2( 0.75, 0.75 )
frames = SubResource( 1 )
animation = "swim"
playing = true
_sections_unfolded = [ "Transform" ]
[node name="Collision" type="CollisionShape2D" parent="." index="1"]
animation = "walk"
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
rotation = 1.5708
shape = SubResource( 2 )
_sections_unfolded = [ "Transform", "Visibility" ]
[node name="Visibility" type="VisibilityNotifier2D" parent="." index="2"]
rect = Rect2( -10, -10, 20, 20 )
[node name="VisibilityNotifier2D" type="VisibilityNotifier2D" parent="."]
[connection signal="screen_exited" from="VisibilityNotifier2D" to="." method="_on_VisibilityNotifier2D_screen_exited"]

View File

@@ -2,40 +2,35 @@ extends Area2D
signal hit
export (int) var SPEED
var velocity = Vector2()
var screensize
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()
screensize = get_viewport_rect().size
func start(pos):
position = pos
show()
$Collision.disabled = false
func _process(delta):
velocity = Vector2()
if Input.is_action_pressed("ui_right"):
var velocity = Vector2.ZERO # The player's movement vector.
if Input.is_action_pressed("move_right"):
velocity.x += 1
if Input.is_action_pressed("ui_left"):
if Input.is_action_pressed("move_left"):
velocity.x -= 1
if Input.is_action_pressed("ui_down"):
if Input.is_action_pressed("move_down"):
velocity.y += 1
if Input.is_action_pressed("ui_up"):
if Input.is_action_pressed("move_up"):
velocity.y -= 1
if velocity.length() > 0:
velocity = velocity.normalized() * SPEED
velocity = velocity.normalized() * speed
$AnimatedSprite.play()
$Trail.emitting = true
else:
$AnimatedSprite.stop()
$Trail.emitting = false
position += velocity * delta
position.x = clamp(position.x, 0, screensize.x)
position.y = clamp(position.y, 0, screensize.y)
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"
@@ -45,10 +40,15 @@ func _process(delta):
$AnimatedSprite.animation = "up"
$AnimatedSprite.flip_v = velocity.y > 0
func _on_Player_body_entered( body ):
$Collision.disabled = true
hide()
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

@@ -7,7 +7,6 @@
[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,
@@ -21,125 +20,52 @@ animations = [ {
} ]
[sub_resource type="CapsuleShape2D" id=2]
custom_solver_bias = 0.0
radius = 26.5155
height = 13.8847
radius = 26.1701
height = 14.822
[sub_resource type="Gradient" id=3]
offsets = PoolRealArray( 0, 1 )
colors = PoolColorArray( 1, 1, 1, 0.523804, 1, 1, 1, 0 )
colors = PoolColorArray( 1, 1, 1, 0.501961, 1, 1, 1, 0 )
[sub_resource type="GradientTexture" id=4]
flags = 4
gradient = SubResource( 3 )
width = 2048
[sub_resource type="Curve" id=5]
min_value = 0.0
max_value = 1.0
bake_resolution = 100
_data = [ Vector2( 0, 0.446289 ), 0.0, 0.0, 0, 0, Vector2( 1, 0.306641 ), 0.0, 0.0, 0, 0 ]
_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]
flags = 4
width = 2048
curve = SubResource( 5 )
[sub_resource type="ParticlesMaterial" id=7]
render_priority = 0
trail_divisor = 1
emission_shape = 0
flag_align_y = false
flag_rotate_y = false
flag_disable_z = true
spread = 45.0
flatness = 0.0
gravity = Vector3( 0, 0, 0 )
initial_velocity = 1.0
initial_velocity_random = 0.0
angular_velocity = 1.56945e-43
angular_velocity_random = 0.0
orbit_velocity = 0.0
orbit_velocity_random = 0.0
linear_accel = 0.0
linear_accel_random = 0.0
radial_accel = 0.0
radial_accel_random = 0.0
tangential_accel = 0.0
tangential_accel_random = 0.0
damping = 0.0
damping_random = 0.0
angle = 0.0
angle_random = 0.0
scale = 1.0
scale_random = 0.0
scale = 0.75
scale_curve = SubResource( 6 )
color_ramp = SubResource( 4 )
hue_variation = 0.0
hue_variation_random = 0.0
anim_speed = 0.0
anim_speed_random = 0.0
anim_offset = 0.0
anim_offset_random = 0.0
anim_loop = false
_sections_unfolded = [ "Color", "Gravity", "Scale" ]
[node name="Player" type="Area2D"]
input_pickable = true
gravity_vec = Vector2( 0, 1 )
gravity = 98.0
linear_damp = 0.1
angular_damp = 1.0
audio_bus_override = false
audio_bus_name = "Master"
z_index = 10
script = ExtResource( 1 )
_sections_unfolded = [ "Transform" ]
__meta__ = {
"_edit_group_": true
}
SPEED = 400
[node name="AnimatedSprite" type="AnimatedSprite" parent="." index="0"]
[node name="AnimatedSprite" type="AnimatedSprite" parent="."]
scale = Vector2( 0.5, 0.5 )
frames = SubResource( 1 )
animation = "right"
_sections_unfolded = [ "Region", "Transform", "Z" ]
[node name="Collision" type="CollisionShape2D" parent="." index="1"]
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
shape = SubResource( 2 )
[node name="Trail" type="Particles2D" parent="." index="2"]
show_behind_parent = true
emitting = true
[node name="Trail" type="Particles2D" parent="."]
z_index = -1
amount = 10
lifetime = 1.0
one_shot = false
preprocess = 0.0
speed_scale = 2.0
explosiveness = 0.0
randomness = 0.0
fixed_fps = 0
fract_delta = true
visibility_rect = Rect2( -100, -100, 200, 200 )
local_coords = false
draw_order = 0
process_material = SubResource( 7 )
texture = ExtResource( 4 )
normal_map = null
h_frames = 1
v_frames = 1
_sections_unfolded = [ "Drawing", "Process Material", "Textures", "Time", "Transform", "Visibility" ]
texture = ExtResource( 2 )
[connection signal="body_entered" from="." to="." method="_on_Player_body_entered"]

View File

@@ -0,0 +1,33 @@
# Dodge the Creeps
This is a simple game where your character must move
and avoid the enemies for as long as possible.
This is a finished version of the game featured in the
["Your first 2D game"](https://docs.godotengine.org/en/latest/getting_started/first_2d_game/index.html)
tutorial in the documentation. For more details,
consider following the tutorial in the documentation.
Language: GDScript
Renderer: GLES 3 (particles are not available in GLES 2)
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
## Screenshots
![GIF from the documentation](https://docs.godotengine.org/en/latest/_images/dodge_preview.gif)
![Screenshot](screenshots/dodge.png)
## 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
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
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

@@ -6,7 +6,8 @@ path="res://.import/House In a Forest Loop.ogg-1a6a72ae843ad792b7039931227e8d50.
[deps]
source_md5="c395b0cc351a71713417cf862282849f"
source_file="res://art/House In a Forest Loop.ogg"
dest_files=[ "res://.import/House In a Forest Loop.ogg-1a6a72ae843ad792b7039931227e8d50.oggstr" ]
[params]

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.4 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

View File

@@ -3,16 +3,21 @@
importer="texture"
type="StreamTexture"
path="res://.import/enemyFlyingAlt_1.png-559f599b16c69b112c1b53f6332e9489.stex"
metadata={
"vram_texture": false
}
[deps]
source_md5="64d9fdc23f76112a64a283673e3fd8dd"
source_file="res://art/enemyFlyingAlt_1.png"
dest_files=[ "res://.import/enemyFlyingAlt_1.png-559f599b16c69b112c1b53f6332e9489.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=false
@@ -22,6 +27,8 @@ 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

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.7 KiB

After

Width:  |  Height:  |  Size: 2.0 KiB

View File

@@ -3,16 +3,21 @@
importer="texture"
type="StreamTexture"
path="res://.import/enemyFlyingAlt_2.png-31dc7310eda6e1b721224f3cd932c076.stex"
metadata={
"vram_texture": false
}
[deps]
source_md5="5281b0d2b947deb09cbf95ecf9628ae7"
source_file="res://art/enemyFlyingAlt_2.png"
dest_files=[ "res://.import/enemyFlyingAlt_2.png-31dc7310eda6e1b721224f3cd932c076.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=false
@@ -22,6 +27,8 @@ 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

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

View File

@@ -3,16 +3,21 @@
importer="texture"
type="StreamTexture"
path="res://.import/enemySwimming_1.png-dd0e11759dc3d624c8a704f6e98a3d80.stex"
metadata={
"vram_texture": false
}
[deps]
source_md5="5e557d1bd564dd553650de1c38746ed9"
source_file="res://art/enemySwimming_1.png"
dest_files=[ "res://.import/enemySwimming_1.png-dd0e11759dc3d624c8a704f6e98a3d80.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=false
@@ -22,6 +27,8 @@ 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

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

View File

@@ -3,16 +3,21 @@
importer="texture"
type="StreamTexture"
path="res://.import/enemySwimming_2.png-4c0cbc0732264c4ea3290340bd4a0a62.stex"
metadata={
"vram_texture": false
}
[deps]
source_md5="d04b001ba2f4ac6884fdbe44b55fa656"
source_file="res://art/enemySwimming_2.png"
dest_files=[ "res://.import/enemySwimming_2.png-4c0cbc0732264c4ea3290340bd4a0a62.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=false
@@ -22,6 +27,8 @@ 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

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

@@ -3,16 +3,21 @@
importer="texture"
type="StreamTexture"
path="res://.import/enemyWalking_1.png-5af6eedbe61b701677d490ffdc1e6471.stex"
metadata={
"vram_texture": false
}
[deps]
source_md5="0e417b74e72f5d8f4aca0e557a735643"
source_file="res://art/enemyWalking_1.png"
dest_files=[ "res://.import/enemyWalking_1.png-5af6eedbe61b701677d490ffdc1e6471.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=false
@@ -22,6 +27,8 @@ 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

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.7 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

@@ -3,16 +3,21 @@
importer="texture"
type="StreamTexture"
path="res://.import/enemyWalking_2.png-67c480ed60c35e95f5acb0436246b935.stex"
metadata={
"vram_texture": false
}
[deps]
source_md5="838f40a8b77a0cb387dc5e5aff6bd8d5"
source_file="res://art/enemyWalking_2.png"
dest_files=[ "res://.import/enemyWalking_2.png-67c480ed60c35e95f5acb0436246b935.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=false
@@ -22,6 +27,8 @@ 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

View File

@@ -6,7 +6,8 @@ path="res://.import/gameover.wav-98c95c744b35280048c2bd093cf8a356.sample"
[deps]
source_md5="fe94a3a7558cff917a5500a1298fdcac"
source_file="res://art/gameover.wav"
dest_files=[ "res://.import/gameover.wav-98c95c744b35280048c2bd093cf8a356.sample" ]
[params]
@@ -16,5 +17,7 @@ force/max_rate=false
force/max_rate_hz=44100
edit/trim=true
edit/normalize=true
edit/loop=false
edit/loop_mode=0
edit/loop_begin=0
edit/loop_end=-1
compress/mode=0

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.8 KiB

After

Width:  |  Height:  |  Size: 2.7 KiB

View File

@@ -3,16 +3,21 @@
importer="texture"
type="StreamTexture"
path="res://.import/playerGrey_up1.png-6bd114d0a6beac91f48e3a7314d44564.stex"
metadata={
"vram_texture": false
}
[deps]
source_md5="f84241d41055080a3393c9a8619f172b"
source_file="res://art/playerGrey_up1.png"
dest_files=[ "res://.import/playerGrey_up1.png-6bd114d0a6beac91f48e3a7314d44564.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=false
@@ -22,6 +27,8 @@ 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

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.6 KiB

After

Width:  |  Height:  |  Size: 2.7 KiB

View File

@@ -3,16 +3,21 @@
importer="texture"
type="StreamTexture"
path="res://.import/playerGrey_up2.png-d6aba85f5f2675ebc7045efa7552ee79.stex"
metadata={
"vram_texture": false
}
[deps]
source_md5="57618c302a312d248705c7f045978765"
source_file="res://art/playerGrey_up2.png"
dest_files=[ "res://.import/playerGrey_up2.png-d6aba85f5f2675ebc7045efa7552ee79.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=false
@@ -22,6 +27,8 @@ 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

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.7 KiB

After

Width:  |  Height:  |  Size: 2.7 KiB

View File

@@ -3,16 +3,21 @@
importer="texture"
type="StreamTexture"
path="res://.import/playerGrey_walk1.png-c4773fe7a7bf85d7ab732eb4458c2742.stex"
metadata={
"vram_texture": false
}
[deps]
source_md5="7892ed98ba910fbda0d37266127e96bb"
source_file="res://art/playerGrey_walk1.png"
dest_files=[ "res://.import/playerGrey_walk1.png-c4773fe7a7bf85d7ab732eb4458c2742.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=false
@@ -22,6 +27,8 @@ 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

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.2 KiB

After

Width:  |  Height:  |  Size: 2.9 KiB

View File

@@ -3,16 +3,21 @@
importer="texture"
type="StreamTexture"
path="res://.import/playerGrey_walk2.png-34d2d916366100182d08037c51884043.stex"
metadata={
"vram_texture": false
}
[deps]
source_md5="9fc73e1224a6b16d8fb5d0f667e3aed2"
source_file="res://art/playerGrey_walk2.png"
dest_files=[ "res://.import/playerGrey_walk2.png-34d2d916366100182d08037c51884043.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=false
@@ -22,7 +27,9 @@ 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=false
detect_3d=true
svg/scale=1.0

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.8 KiB

View File

@@ -1,28 +0,0 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/set3_tiles.png-7dd06b1fc0bcfaa06e9dd732f61382a2.stex"
[deps]
source_md5="eef34d896b231438a2d97707c0ab06a2"
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/normal_map=0
flags/repeat=0
flags/filter=false
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0

View File

@@ -1,2 +0,0 @@
"Abstract Platformer" by kenney.nl is licensed under http://creativecommons.org/publicdomain/zero/1.0/
"House in a Forest Loop" by https://opengameart.org/users/horrorpen is licensed under http://creativecommons.org/licenses/by/3.0/

View File

@@ -1,102 +0,0 @@
[gd_resource type="Environment" load_steps=2 format=2]
[sub_resource type="ProceduralSky" id=1]
radiance_size = 4
sky_top_color = Color( 0.0470588, 0.454902, 0.976471, 1 )
sky_horizon_color = Color( 0.556863, 0.823529, 0.909804, 1 )
sky_curve = 0.25
sky_energy = 1.0
ground_bottom_color = Color( 0.101961, 0.145098, 0.188235, 1 )
ground_horizon_color = Color( 0.482353, 0.788235, 0.952941, 1 )
ground_curve = 0.01
ground_energy = 1.0
sun_color = Color( 1, 1, 1, 1 )
sun_latitude = 35.0
sun_longitude = 0.0
sun_angle_min = 1.0
sun_angle_max = 100.0
sun_curve = 0.05
sun_energy = 16.0
texture_size = 2
[resource]
background_mode = 2
background_sky = SubResource( 1 )
background_sky_custom_fov = 0.0
background_color = Color( 0, 0, 0, 1 )
background_energy = 1.0
background_canvas_max_layer = 0
ambient_light_color = Color( 0, 0, 0, 1 )
ambient_light_energy = 1.0
ambient_light_sky_contribution = 0.0
fog_enabled = false
fog_color = Color( 0.5, 0.6, 0.7, 1 )
fog_sun_color = Color( 1, 0.9, 0.7, 1 )
fog_sun_amount = 0.0
fog_depth_enabled = true
fog_depth_begin = 10.0
fog_depth_curve = 1.0
fog_transmit_enabled = false
fog_transmit_curve = 1.0
fog_height_enabled = false
fog_height_min = 0.0
fog_height_max = 100.0
fog_height_curve = 1.0
tonemap_mode = 0
tonemap_exposure = 1.0
tonemap_white = 1.0
auto_exposure_enabled = false
auto_exposure_scale = 0.4
auto_exposure_min_luma = 0.05
auto_exposure_max_luma = 8.0
auto_exposure_speed = 0.5
ss_reflections_enabled = false
ss_reflections_max_steps = 64
ss_reflections_fade_in = 0.15
ss_reflections_fade_out = 2.0
ss_reflections_depth_tolerance = 0.2
ss_reflections_roughness = true
ssao_enabled = false
ssao_radius = 1.0
ssao_intensity = 1.0
ssao_radius2 = 0.0
ssao_intensity2 = 1.0
ssao_bias = 0.01
ssao_light_affect = 0.0
ssao_color = Color( 0, 0, 0, 1 )
ssao_quality = 0
ssao_blur = 1
ssao_edge_sharpness = 4.0
dof_blur_far_enabled = false
dof_blur_far_distance = 10.0
dof_blur_far_transition = 5.0
dof_blur_far_amount = 0.1
dof_blur_far_quality = 1
dof_blur_near_enabled = false
dof_blur_near_distance = 2.0
dof_blur_near_transition = 1.0
dof_blur_near_amount = 0.1
dof_blur_near_quality = 1
glow_enabled = false
glow_levels/1 = false
glow_levels/2 = false
glow_levels/3 = true
glow_levels/4 = false
glow_levels/5 = true
glow_levels/6 = false
glow_levels/7 = false
glow_intensity = 0.8
glow_strength = 1.0
glow_bloom = 0.0
glow_blend_mode = 2
glow_hdr_threshold = 1.0
glow_hdr_scale = 2.0
glow_bicubic_upscale = false
adjustment_enabled = false
adjustment_brightness = 1.0
adjustment_contrast = 1.0
adjustment_saturation = 1.0
_sections_unfolded = [ "Background" ]

0
2d/dodge_the_creeps/fonts/FONTLOG.txt Executable file → Normal file
View File

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.2 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

@@ -3,16 +3,21 @@
importer="texture"
type="StreamTexture"
path="res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex"
metadata={
"vram_texture": false
}
[deps]
source_md5="7b0d811088c13a3b6d79f9895b9f2935"
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
@@ -22,6 +27,8 @@ 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

View File

@@ -6,11 +6,17 @@
; [section] ; section goes between []
; param=value ; assign values to parameters
config_version=3
config_version=4
[application]
config/name="Dodge the Creeps"
config/description="This is a simple game where your character must move
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"
@@ -18,12 +24,45 @@ config/icon="res://icon.png"
window/size/width=480
window/size/height=720
window/size/resizable=false
window/stretch/mode="2d"
window/stretch/aspect="keep"
[gdnative]
[input]
singletons=[ ]
[rendering]
environment/default_environment="res://default_env.tres"
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)
, 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)
, 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)
, 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)
, 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)
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

View File

@@ -1,21 +1,57 @@
[gd_scene load_steps=5 format=2]
[gd_scene load_steps=6 format=2]
[ext_resource path="res://player/Player.tscn" type="PackedScene" id=1]
[ext_resource path="res://debug/StatesStackDiplayer.tscn" type="PackedScene" id=2]
[ext_resource path="res://debug/ControlsPanel.tscn" type="PackedScene" id=3]
[ext_resource path="res://debug/Explanations.tscn" type="PackedScene" id=4]
[ext_resource path="res://fonts/source_code_pro_explanations.tres" type="DynamicFont" id=2]
[ext_resource path="res://debug/StatesStackDiplayer.tscn" type="PackedScene" id=3]
[ext_resource path="res://debug/ControlsPanel.tscn" type="PackedScene" id=4]
[ext_resource path="res://fonts/source_code_pro_explanations_bold.tres" type="DynamicFont" id=5]
[node name="Demo" type="Node"]
[node name="Player" parent="." index="0" instance=ExtResource( 1 )]
[node name="Player" parent="." instance=ExtResource( 1 )]
position = Vector2( 640, 400 )
editor/display_folded = true
[node name="Explanations" type="RichTextLabel" parent="."]
anchor_right = 1.0
anchor_bottom = 1.0
margin_left = 10.0
margin_top = -370.0
margin_right = -10.0
margin_bottom = -730.0
rect_clip_content = false
mouse_filter = 2
size_flags_vertical = 4
custom_fonts/bold_font = ExtResource( 5 )
custom_fonts/normal_font = ExtResource( 2 )
bbcode_enabled = true
bbcode_text = "This example shows how to apply the State programming pattern in GDScript, including Hierarchical States, and a pushdown automaton.
[node name="StatesStackDiplayer" parent="." index="1" instance=ExtResource( 2 )]
States are common in games. You can use the pattern to:
[node name="ControlsPanel" parent="." index="2" instance=ExtResource( 3 )]
1. Separate each behavior and transitions between behaviors, thus make scripts shorter and easier to manage
2. Respect the Single Responsibility Principle. Each State object represents [b]one[/b] action
3. Improve your code's structure. Look at the scene tree and FileSystem tab: without looking at the code, you'll know what the Player can or cannot do.
[node name="Explanations" parent="." index="3" instance=ExtResource( 4 )]
You can read more about States in the excellent [url=http://gameprogrammingpatterns.com/state.html]Game Programming Patterns ebook[/url]."
text = "This example shows how to apply the State programming pattern in GDScript, including Hierarchical States, and a pushdown automaton.
States are common in games. You can use the pattern to:
1. Separate each behavior and transitions between behaviors, thus make scripts shorter and easier to manage
2. Respect the Single Responsibility Principle. Each State object represents one action
3. Improve your code's structure. Look at the scene tree and FileSystem tab: without looking at the code, you'll know what the Player can or cannot do.
You can read more about States in the excellent Game Programming Patterns ebook."
__meta__ = {
"_edit_lock_": true
}
[node name="Control" type="Control" parent="."]
anchor_right = 1.0
anchor_bottom = 1.0
[node name="StatesStackDiplayer" parent="Control" instance=ExtResource( 3 )]
[node name="ControlsPanel" parent="Control" instance=ExtResource( 4 )]
[editable path="Player"]

View File

@@ -0,0 +1,32 @@
# Hierarchical Finite State Machine
This example shows how to apply the State machine programming
pattern in GDscript, including Hierarchical States, and a
pushdown automaton.
Language: GDScript
Renderer: GLES 2
Check out this demo on the asset library: https://godotengine.org/asset-library/asset/516
## Why use a state machine
States are common in games. You can use the pattern to:
1. Separate each behavior and transitions between behaviors,
thus make scripts shorter and easier to manage.
2. Respect the Single Responsibility Principle.
Each State object represents one action.
3. Improve your code's structure. Look at the scene tree and
FileSystem tab: without looking at the code, you'll know
what the Player can or cannot do.
You can read more about States in the excellent
[Game Programming Patterns ebook](https://gameprogrammingpatterns.com/state.html).
## Screenshots
![Screenshot](screenshots/fsm-attack.png)

View File

@@ -1,77 +1,38 @@
[gd_scene load_steps=3 format=2]
[gd_scene load_steps=2 format=2]
[ext_resource path="res://debug/top_level_ui.gd" type="Script" id=1]
[ext_resource path="res://fonts/source_code_pro_explanations.tres" type="DynamicFont" id=2]
[node name="ControlsPanel" type="Panel" index="0"]
[ext_resource path="res://fonts/source_code_pro_explanations.tres" type="DynamicFont" id=1]
[node name="ControlsPanel" type="Panel"]
anchor_left = 1.0
anchor_top = 0.0
anchor_right = 1.0
anchor_bottom = 0.0
margin_left = -220.0
margin_bottom = 170.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
mouse_filter = 0
mouse_default_cursor_shape = 0
size_flags_horizontal = 1
size_flags_vertical = 1
script = ExtResource( 1 )
[node name="Keys" type="Label" parent="." index="0"]
anchor_left = 0.0
anchor_top = 0.0
[node name="Keys" type="Label" parent="."]
anchor_right = 1.0
anchor_bottom = 1.0
margin_left = 10.0
margin_top = 10.0
margin_right = -10.0
margin_bottom = -10.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
mouse_filter = 2
mouse_default_cursor_shape = 0
size_flags_horizontal = 1
size_flags_vertical = 4
custom_fonts/font = ExtResource( 2 )
custom_fonts/font = ExtResource( 1 )
text = "Shoot:
Attack:
Stagger:
Jump:
Sprint:"
percent_visible = 1.0
lines_skipped = 0
max_lines_visible = -1
_sections_unfolded = [ "BBCode", "custom_fonts" ]
[node name="Keys2" type="Label" parent="." index="1"]
anchor_left = 0.0
anchor_top = 0.0
[node name="Keys2" type="Label" parent="."]
anchor_right = 1.0
anchor_bottom = 1.0
margin_left = 10.0
margin_top = 10.0
margin_right = -10.0
margin_bottom = -10.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
mouse_filter = 2
mouse_default_cursor_shape = 0
size_flags_horizontal = 1
size_flags_vertical = 4
custom_fonts/font = ExtResource( 2 )
custom_fonts/font = ExtResource( 1 )
text = "R
F
X
Space
Shift"
align = 2
percent_visible = 1.0
lines_skipped = 0
max_lines_visible = -1
_sections_unfolded = [ "BBCode", "custom_fonts" ]

View File

@@ -1,25 +1,17 @@
[gd_scene load_steps=4 format=2]
[gd_scene load_steps=3 format=2]
[ext_resource path="res://fonts/source_code_pro_explanations_bold.tres" type="DynamicFont" id=1]
[ext_resource path="res://fonts/source_code_pro_explanations.tres" type="DynamicFont" id=2]
[ext_resource path="res://debug/top_level_ui.gd" type="Script" id=3]
[node name="Explanations" type="RichTextLabel"]
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 1.0
anchor_bottom = 1.0
margin_left = 10.0
margin_top = -370.0
margin_right = -10.0
margin_bottom = -730.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
mouse_filter = 2
mouse_default_cursor_shape = 0
size_flags_horizontal = 1
size_flags_vertical = 4
custom_fonts/bold_font = ExtResource( 1 )
custom_fonts/normal_font = ExtResource( 2 )
@@ -33,10 +25,6 @@ States are common in games. You can use the pattern to:
3. Improve your code's structure. Look at the scene tree and FileSystem tab: without looking at the code, you'll know what the Player can or cannot do.
You can read more about States in the excellent [url=http://gameprogrammingpatterns.com/state.html]Game Programming Patterns ebook[/url]."
visible_characters = -1
percent_visible = 1.0
meta_underlined = true
tab_size = 4
text = "This example shows how to apply the State programming pattern in GDscript, including Hierarchical States, and a pushdown automaton.
States are common in games. You can use the pattern to:
@@ -46,14 +34,6 @@ States are common in games. You can use the pattern to:
3. Improve your code's structure. Look at the scene tree and FileSystem tab: without looking at the code, you'll know what the Player can or cannot do.
You can read more about States in the excellent Game Programming Patterns ebook."
scroll_active = true
scroll_following = false
selection_enabled = false
override_selected_font_color = false
script = ExtResource( 3 )
_sections_unfolded = [ "BBCode", "custom_fonts" ]
__meta__ = {
"_edit_lock_": true
}

View File

@@ -3,106 +3,46 @@
[ext_resource path="res://debug/states_stack_displayer.gd" type="Script" id=1]
[ext_resource path="res://fonts/SourceCodePro-Bold.ttf" type="DynamicFontData" id=2]
[sub_resource type="DynamicFont" id=1]
size = 20
use_mipmaps = false
use_filter = true
font_data = ExtResource( 2 )
_sections_unfolded = [ "Font", "Settings" ]
[node name="StatesStackDiplayer" type="Panel"]
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_right = 210.0
margin_bottom = 170.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
mouse_filter = 0
mouse_default_cursor_shape = 0
size_flags_horizontal = 1
size_flags_vertical = 1
script = ExtResource( 1 )
__meta__ = {
"_edit_group_": true
}
[node name="Title" type="Label" parent="." index="0"]
[node name="Title" type="Label" parent="."]
anchor_left = 0.5
anchor_top = 0.0
anchor_right = 0.5
anchor_bottom = 0.0
margin_left = -105.0
margin_right = 105.0
margin_bottom = 40.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
mouse_filter = 2
mouse_default_cursor_shape = 0
size_flags_horizontal = 1
size_flags_vertical = 4
custom_fonts/font = SubResource( 1 )
text = "Pushown"
align = 1
valign = 1
uppercase = true
percent_visible = 1.0
lines_skipped = 0
max_lines_visible = -1
_sections_unfolded = [ "custom_fonts" ]
[node name="States" type="Label" parent="." index="1"]
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
[node name="States" type="Label" parent="."]
margin_left = 20.0
margin_top = 50.0
margin_right = 190.0
margin_bottom = 170.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
mouse_filter = 2
mouse_default_cursor_shape = 0
size_flags_horizontal = 1
size_flags_vertical = 4
custom_fonts/font = SubResource( 1 )
text = "Jump
Test"
align = 1
percent_visible = 1.0
lines_skipped = 0
max_lines_visible = -1
_sections_unfolded = [ "custom_fonts" ]
[node name="Numbers" type="Label" parent="." index="2"]
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
[node name="Numbers" type="Label" parent="."]
margin_left = 20.0
margin_top = 50.0
margin_right = 190.0
margin_bottom = 170.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
mouse_filter = 2
mouse_default_cursor_shape = 0
size_flags_horizontal = 1
size_flags_vertical = 4
custom_fonts/font = SubResource( 1 )
text = "1.
2."
percent_visible = 1.0
lines_skipped = 0
max_lines_visible = -1
_sections_unfolded = [ "custom_fonts" ]

View File

@@ -1,18 +1,15 @@
extends Panel
onready var fsm_node = get_node("../Player/StateMachine")
onready var fsm_node = get_node("../../Player/StateMachine")
func _ready():
set_as_toplevel(true)
func _process(delta):
var states_names = ''
var numbers = ''
func _process(_delta):
var states_names = ""
var numbers = ""
var index = 0
for state in fsm_node.states_stack:
states_names += state.get_name() + '\n'
numbers += str(index) + '\n'
states_names += String(state.get_name()) + "\n"
numbers += str(index) + "\n"
index += 1
$States.text = states_names
$Numbers.text = numbers

View File

@@ -1,5 +0,0 @@
tool
extends Control
func _ready():
set_as_toplevel(true)

View File

@@ -1,101 +0,0 @@
[gd_resource type="Environment" load_steps=2 format=2]
[sub_resource type="ProceduralSky" id=1]
radiance_size = 4
sky_top_color = Color( 0.0470588, 0.454902, 0.976471, 1 )
sky_horizon_color = Color( 0.556863, 0.823529, 0.909804, 1 )
sky_curve = 0.25
sky_energy = 1.0
ground_bottom_color = Color( 0.101961, 0.145098, 0.188235, 1 )
ground_horizon_color = Color( 0.482353, 0.788235, 0.952941, 1 )
ground_curve = 0.01
ground_energy = 1.0
sun_color = Color( 1, 1, 1, 1 )
sun_latitude = 35.0
sun_longitude = 0.0
sun_angle_min = 1.0
sun_angle_max = 100.0
sun_curve = 0.05
sun_energy = 16.0
texture_size = 2
[resource]
background_mode = 2
background_sky = SubResource( 1 )
background_sky_custom_fov = 0.0
background_color = Color( 0, 0, 0, 1 )
background_energy = 1.0
background_canvas_max_layer = 0
ambient_light_color = Color( 0, 0, 0, 1 )
ambient_light_energy = 1.0
ambient_light_sky_contribution = 1.0
fog_enabled = false
fog_color = Color( 0.5, 0.6, 0.7, 1 )
fog_sun_color = Color( 1, 0.9, 0.7, 1 )
fog_sun_amount = 0.0
fog_depth_enabled = true
fog_depth_begin = 10.0
fog_depth_curve = 1.0
fog_transmit_enabled = false
fog_transmit_curve = 1.0
fog_height_enabled = false
fog_height_min = 0.0
fog_height_max = 100.0
fog_height_curve = 1.0
tonemap_mode = 0
tonemap_exposure = 1.0
tonemap_white = 1.0
auto_exposure_enabled = false
auto_exposure_scale = 0.4
auto_exposure_min_luma = 0.05
auto_exposure_max_luma = 8.0
auto_exposure_speed = 0.5
ss_reflections_enabled = false
ss_reflections_max_steps = 64
ss_reflections_fade_in = 0.15
ss_reflections_fade_out = 2.0
ss_reflections_depth_tolerance = 0.2
ss_reflections_roughness = true
ssao_enabled = false
ssao_radius = 1.0
ssao_intensity = 1.0
ssao_radius2 = 0.0
ssao_intensity2 = 1.0
ssao_bias = 0.01
ssao_light_affect = 0.0
ssao_color = Color( 0, 0, 0, 1 )
ssao_quality = 0
ssao_blur = 3
ssao_edge_sharpness = 4.0
dof_blur_far_enabled = false
dof_blur_far_distance = 10.0
dof_blur_far_transition = 5.0
dof_blur_far_amount = 0.1
dof_blur_far_quality = 1
dof_blur_near_enabled = false
dof_blur_near_distance = 2.0
dof_blur_near_transition = 1.0
dof_blur_near_amount = 0.1
dof_blur_near_quality = 1
glow_enabled = false
glow_levels/1 = false
glow_levels/2 = false
glow_levels/3 = true
glow_levels/4 = false
glow_levels/5 = true
glow_levels/6 = false
glow_levels/7 = false
glow_intensity = 0.8
glow_strength = 1.0
glow_bloom = 0.0
glow_blend_mode = 2
glow_hdr_threshold = 1.0
glow_hdr_scale = 2.0
glow_bicubic_upscale = false
adjustment_enabled = false
adjustment_brightness = 1.0
adjustment_contrast = 1.0
adjustment_saturation = 1.0

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

View File

@@ -3,6 +3,9 @@
importer="texture"
type="StreamTexture"
path="res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex"
metadata={
"vram_texture": false
}
[deps]
@@ -14,6 +17,7 @@ dest_files=[ "res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex" ]
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
@@ -23,6 +27,8 @@ 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

View File

@@ -18,15 +18,8 @@
[sub_resource type="Animation" id=1]
length = 1.0
loop = false
step = 0.1
[sub_resource type="Animation" id=2]
length = 0.6
loop = false
step = 0.1
tracks/0/type = "value"
tracks/0/path = NodePath("BodyPivot/Body:modulate")
tracks/0/interp = 1
@@ -42,159 +35,88 @@ tracks/0/keys = {
[sub_resource type="Animation" id=3]
length = 1.0
loop = false
step = 0.1
[sub_resource type="DynamicFont" id=4]
size = 20
use_mipmaps = false
use_filter = true
font_data = ExtResource( 14 )
_sections_unfolded = [ "Font", "Settings" ]
[node name="Player" type="KinematicBody2D" index="0"]
position = Vector2( 628.826, 391.266 )
input_pickable = false
collision_layer = 1
collision_mask = 1
collision/safe_margin = 0.08
[node name="Player" type="KinematicBody2D"]
script = ExtResource( 1 )
_sections_unfolded = [ "Visibility" ]
__meta__ = {
"_edit_horizontal_guides_": [ ]
}
[node name="StateMachine" type="Node" parent="." index="0"]
[node name="StateMachine" type="Node" parent="."]
script = ExtResource( 2 )
START_STATE = NodePath("Idle")
[node name="Idle" type="Node" parent="StateMachine" index="0"]
[node name="Idle" type="Node" parent="StateMachine"]
script = ExtResource( 3 )
[node name="Move" type="Node" parent="StateMachine" index="1"]
[node name="Move" type="Node" parent="StateMachine"]
script = ExtResource( 4 )
MAX_WALK_SPEED = 450
MAX_RUN_SPEED = 700
[node name="Jump" type="Node" parent="StateMachine" index="2"]
[node name="Jump" type="Node" parent="StateMachine"]
script = ExtResource( 5 )
BASE_MAX_HORIZONTAL_SPEED = 400.0
AIR_ACCELERATION = 1000.0
AIR_DECCELERATION = 2000.0
AIR_STEERING_POWER = 50.0
JUMP_HEIGHT = 120.0
JUMP_DURATION = 0.8
GRAVITY = 1600.0
[node name="Stagger" type="Node" parent="StateMachine" index="3"]
[node name="Stagger" type="Node" parent="StateMachine"]
script = ExtResource( 6 )
[node name="Attack" type="Node" parent="StateMachine" index="4"]
[node name="Attack" type="Node" parent="StateMachine"]
script = ExtResource( 7 )
[node name="Die" type="Node" parent="StateMachine" index="5"]
[node name="Die" type="Node" parent="StateMachine"]
script = ExtResource( 8 )
[node name="AnimationPlayer" type="AnimationPlayer" parent="." index="1"]
root_node = NodePath("..")
autoplay = ""
playback_process_mode = 1
playback_default_blend_time = 0.0
playback_speed = 1.0
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
anims/idle = SubResource( 1 )
anims/stagger = SubResource( 2 )
anims/walk = SubResource( 3 )
blend_times = [ ]
[node name="Shadow" type="Sprite" parent="." index="2"]
[node name="Shadow" type="Sprite" parent="."]
self_modulate = Color( 1, 1, 1, 0.361098 )
position = Vector2( 0, -4 )
texture = ExtResource( 9 )
_sections_unfolded = [ "Visibility" ]
[node name="BodyPivot" type="Position2D" parent="." index="3"]
[node name="BodyPivot" type="Position2D" parent="."]
[node name="Body" type="Sprite" parent="BodyPivot" index="0"]
position = Vector2( 0, -58.8242 )
[node name="Body" type="Sprite" parent="BodyPivot"]
position = Vector2( 0, -58 )
texture = ExtResource( 10 )
[node name="BulletSpawn" type="Node2D" parent="BodyPivot" index="1"]
editor/display_folded = true
position = Vector2( 1.17401, -61.266 )
[node name="BulletSpawn" type="Node2D" parent="BodyPivot"]
position = Vector2( 0, -58 )
script = ExtResource( 11 )
_sections_unfolded = [ "Transform" ]
[node name="CooldownTimer" type="Timer" parent="BodyPivot/BulletSpawn" index="0"]
process_mode = 1
[node name="CooldownTimer" type="Timer" parent="BodyPivot/BulletSpawn"]
wait_time = 0.2
one_shot = true
autostart = false
[node name="WeaponPivot" type="Position2D" parent="BodyPivot" index="2"]
position = Vector2( 1.17401, -61.266 )
[node name="WeaponPivot" type="Position2D" parent="BodyPivot"]
position = Vector2( 0, -58 )
script = ExtResource( 12 )
[node name="Offset" type="Position2D" parent="BodyPivot/WeaponPivot" index="0"]
[node name="Offset" type="Position2D" parent="BodyPivot/WeaponPivot"]
position = Vector2( 110, 0 )
[node name="Sword" parent="BodyPivot/WeaponPivot/Offset" index="0" instance=ExtResource( 13 )]
[node name="Sword" parent="BodyPivot/WeaponPivot/Offset" instance=ExtResource( 13 )]
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="." index="4"]
build_mode = 0
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="."]
polygon = PoolVector2Array( -20, 0, -20, -20, 20, -20, 20, 0 )
[node name="StateNameDisplayer" type="Label" parent="." index="5"]
editor/display_folded = true
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
[node name="StateNameDisplayer" type="Label" parent="."]
physics_interpolation_mode = 2
margin_left = -109.0
margin_top = -172.0
margin_right = 110.0
margin_bottom = -138.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
mouse_filter = 2
mouse_default_cursor_shape = 0
size_flags_horizontal = 1
size_flags_vertical = 4
custom_fonts/font = SubResource( 4 )
text = "Test"
text = "Idle"
align = 1
valign = 1
uppercase = true
percent_visible = 1.0
lines_skipped = 0
max_lines_visible = -1
script = ExtResource( 15 )
_sections_unfolded = [ "Rect", "custom_fonts" ]
[connection signal="state_changed" from="StateMachine" to="BodyPivot/WeaponPivot/Offset/Sword" method="_on_StateMachine_state_changed"]
[connection signal="state_changed" from="StateMachine" to="StateNameDisplayer" method="_on_StateMachine_state_changed"]
[connection signal="animation_finished" from="AnimationPlayer" to="StateMachine" method="_on_animation_finished"]
[connection signal="attack_finished" from="BodyPivot/WeaponPivot/Offset/Sword" to="StateMachine/Attack" method="_on_Sword_attack_finished"]

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

@@ -3,6 +3,9 @@
importer="texture"
type="StreamTexture"
path="res://.import/body.png-313f6363670a5852a7b7126ab476d8b1.stex"
metadata={
"vram_texture": false
}
[deps]
@@ -14,6 +17,7 @@ dest_files=[ "res://.import/body.png-313f6363670a5852a7b7126ab476d8b1.stex" ]
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
@@ -23,6 +27,8 @@ 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

View File

@@ -2,24 +2,13 @@
[ext_resource path="res://player/bullet/bullet.gd" type="Script" id=1]
[sub_resource type="CircleShape2D" id=1]
custom_solver_bias = 0.0
radius = 12.0
[node name="Bullet" type="KinematicBody2D"]
input_pickable = false
collision_layer = 2
collision_mask = 2
collision/safe_margin = 0.08
script = ExtResource( 1 )
_sections_unfolded = [ "Collision", "collision" ]
SPEED = 1000.0
[node name="CollisionShape2D" type="CollisionShape2D" parent="." index="0"]
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
shape = SubResource( 1 )

View File

@@ -1,8 +1,9 @@
extends KinematicBody2D
var direction = Vector2()
export(float) var SPEED = 1000.0
export(float) var speed = 1000.0
onready var root = get_tree().root
func _ready():
@@ -10,19 +11,14 @@ func _ready():
func _physics_process(delta):
if is_outside_view_bounds():
if not root.get_visible_rect().has_point(position):
queue_free()
var motion = direction * SPEED * delta
var motion = direction * speed * delta
var collision_info = move_and_collide(motion)
if collision_info:
queue_free()
func is_outside_view_bounds():
return position.x > OS.get_screen_size().x or position.x < 0.0 \
or position.y > OS.get_screen_size().y or position.y < 0.0
func _draw():
draw_circle(Vector2(), $CollisionShape2D.shape.radius, Color('#ffffff'))
draw_circle(Vector2(), $CollisionShape2D.shape.radius, Color.white)

View File

@@ -2,15 +2,18 @@ extends Node2D
var bullet = preload("Bullet.tscn")
func _input(event):
if event.is_action_pressed("fire"):
fire(owner.look_direction)
func fire(direction):
func _unhandled_input(event):
if event.is_action_pressed("fire"):
fire()
func fire():
if not $CooldownTimer.is_stopped():
return
$CooldownTimer.start()
var new_bullet = bullet.instance()
new_bullet.direction = direction
new_bullet.position = global_position
new_bullet.direction = owner.look_direction
add_child(new_bullet)

View File

@@ -1,25 +1,26 @@
"""
The Player is a KinematicBody2D, in other words a physics-driven object.
It can move, collide with the world...
It HAS a state machine, but the body and the state machine are separate.
"""
extends KinematicBody2D
# The Player is a KinematicBody2D, in other words a physics-driven object.
# It can move, collide with the world, etc...
# The player has a state machine, but the body and the state machine are separate.
signal direction_changed(new_direction)
var look_direction = Vector2(1, 0) setget set_look_direction
var look_direction = Vector2.RIGHT setget set_look_direction
func take_damage(attacker, amount, effect=null):
if self.is_a_parent_of(attacker):
func take_damage(attacker, amount, effect = null):
if is_a_parent_of(attacker):
return
$States/Stagger.knockback_direction = (attacker.global_position - global_position).normalized()
$Health.take_damage(amount, effect)
func set_dead(value):
set_process_input(not value)
set_physics_process(not value)
$CollisionPolygon2D.disabled = value
func set_look_direction(value):
look_direction = value
emit_signal("direction_changed", value)

View File

@@ -1,33 +1,38 @@
extends "res://state_machine/state_machine.gd"
onready var idle = $Idle
onready var move = $Move
onready var jump = $Jump
onready var stagger = $Stagger
onready var attack = $Attack
func _ready():
states_map = {
"idle": $Idle,
"move": $Move,
"jump": $Jump,
"stagger": $Stagger,
"attack": $Attack,
"idle": idle,
"move": move,
"jump": jump,
"stagger": stagger,
"attack": attack,
}
func _change_state(state_name):
"""
The base state_machine interface this node extends does most of the work
"""
# The base state_machine interface this node extends does most of the work.
if not _active:
return
if state_name in ["stagger", "jump", "attack"]:
states_stack.push_front(states_map[state_name])
if state_name == "jump" and current_state == $Move:
$Jump.initialize($Move.speed, $Move.velocity)
if state_name == "jump" and current_state == move:
jump.initialize(move.speed, move.velocity)
._change_state(state_name)
func _input(event):
"""
Here we only handle input that can interrupt states, attacking in this case
otherwise we let the state node handle it
"""
func _unhandled_input(event):
# Here we only handle input that can interrupt states, attacking in this case,
# otherwise we let the state node handle it.
if event.is_action_pressed("attack"):
if current_state in [$Attack, $Stagger]:
if current_state in [attack, stagger]:
return
_change_state("attack")
return

Binary file not shown.

Before

Width:  |  Height:  |  Size: 967 B

After

Width:  |  Height:  |  Size: 427 B

View File

@@ -3,6 +3,9 @@
importer="texture"
type="StreamTexture"
path="res://.import/shadow.png-493c4635eca1ce8bdece629560617dc7.stex"
metadata={
"vram_texture": false
}
[deps]
@@ -14,6 +17,7 @@ dest_files=[ "res://.import/shadow.png-493c4635eca1ce8bdece629560617dc7.stex" ]
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
@@ -23,6 +27,8 @@ 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

View File

@@ -1,7 +1,9 @@
extends "res://state_machine/state.gd"
func enter():
owner.get_node("AnimationPlayer").play("idle")
func _on_Sword_attack_finished():
emit_signal("finished", "previous")

View File

@@ -1,15 +1,13 @@
"""
The stagger state end with the stagger animation from the AnimationPlayer
The animation only affects the Body Sprite"s modulate property so
it could stack with other animations if we had two AnimationPlayer nodes
"""
extends "res://state_machine/state.gd"
# The stagger state end with the stagger animation from the AnimationPlayer.
# The animation only affects the Body Sprite's modulate property so it
# could stack with other animations if we had two AnimationPlayer nodes.
var knockback_direction = Vector2()
func enter():
owner.get_node("AnimationPlayer").play("stagger")
func _on_animation_finished(anim_name):
assert anim_name == "stagger"
assert(anim_name == "stagger")
emit_signal("finished", "previous")

View File

@@ -2,11 +2,14 @@ extends Label
var start_position = Vector2()
func _ready():
start_position = rect_position
func _physics_process(delta):
func _physics_process(_delta):
rect_position = $"../BodyPivot".position + start_position
func _on_StateMachine_state_changed(current_state):
text = current_state.get_name()
text = String(current_state.get_name())

View File

@@ -1,10 +1,11 @@
extends "res://state_machine/state.gd"
# Initialize the state. E.g. change the animation
# Initialize the state. E.g. change the animation.
func enter():
owner.set_dead(true)
owner.get_node("AnimationPlayer").play("die")
func _on_animation_finished(anim_name):
func _on_animation_finished(_anim_name):
emit_signal("finished", "dead")

View File

@@ -1,15 +1,12 @@
extends "../motion.gd"
export(float) var BASE_MAX_HORIZONTAL_SPEED = 400.0
export(float) var base_max_horizontal_speed = 400.0
export(float) var AIR_ACCELERATION = 1000.0
export(float) var AIR_DECCELERATION = 2000.0
export(float) var AIR_STEERING_POWER = 50.0
export(float) var air_acceleration = 1000.0
export(float) var air_deceleration = 2000.0
export(float) var air_steering_power = 50.0
export(float) var JUMP_HEIGHT = 120.0
export(float) var JUMP_DURATION = 0.8
export(float) var GRAVITY = 1600.0
export(float) var gravity = 1600.0
var enter_velocity = Vector2()
@@ -20,20 +17,29 @@ var horizontal_velocity = Vector2()
var vertical_speed = 0.0
var height = 0.0
func initialize(speed, velocity):
horizontal_speed = speed
max_horizontal_speed = speed if speed > 0.0 else BASE_MAX_HORIZONTAL_SPEED
if speed > 0.0:
max_horizontal_speed = speed
else:
max_horizontal_speed = base_max_horizontal_speed
enter_velocity = velocity
func enter():
var input_direction = get_input_direction()
update_look_direction(input_direction)
horizontal_velocity = enter_velocity if input_direction else Vector2()
if input_direction:
horizontal_velocity = enter_velocity
else:
horizontal_velocity = Vector2()
vertical_speed = 600.0
owner.get_node("AnimationPlayer").play("idle")
func update(delta):
var input_direction = get_input_direction()
update_look_direction(input_direction)
@@ -43,21 +49,23 @@ func update(delta):
if height <= 0.0:
emit_signal("finished", "previous")
func move_horizontally(delta, direction):
if direction:
horizontal_speed += AIR_ACCELERATION * delta
horizontal_speed += air_acceleration * delta
else:
horizontal_speed -= AIR_DECCELERATION * delta
horizontal_speed -= air_deceleration * delta
horizontal_speed = clamp(horizontal_speed, 0, max_horizontal_speed)
var target_velocity = horizontal_speed * direction.normalized()
var steering_velocity = (target_velocity - horizontal_velocity).normalized() * AIR_STEERING_POWER
var steering_velocity = (target_velocity - horizontal_velocity).normalized() * air_steering_power
horizontal_velocity += steering_velocity
owner.move_and_slide(horizontal_velocity)
func animate_jump_height(delta):
vertical_speed -= GRAVITY * delta
vertical_speed -= gravity * delta
height += vertical_speed * delta
height = max(0.0, height)

View File

@@ -1,16 +1,20 @@
# Collection of important methods to handle direction and animation
extends "res://state_machine/state.gd"
# Collection of important methods to handle direction and animation.
func handle_input(event):
if event.is_action_pressed("simulate_damage"):
emit_signal("finished", "stagger")
func get_input_direction():
var input_direction = Vector2()
input_direction.x = int(Input.is_action_pressed("move_right")) - int(Input.is_action_pressed("move_left"))
input_direction.y = int(Input.is_action_pressed("move_down")) - int(Input.is_action_pressed("move_up"))
var input_direction = Vector2(
Input.get_action_strength("move_right") - Input.get_action_strength("move_left"),
Input.get_action_strength("move_down") - Input.get_action_strength("move_up")
)
return input_direction
func update_look_direction(direction):
if direction and owner.look_direction != direction:
owner.look_direction = direction

View File

@@ -1,12 +1,15 @@
extends "on_ground.gd"
func enter():
owner.get_node("AnimationPlayer").play("idle")
func handle_input(event):
return .handle_input(event)
func update(delta):
func update(_delta):
var input_direction = get_input_direction()
if input_direction:
emit_signal("finished", "move")

View File

@@ -1,7 +1,9 @@
extends "on_ground.gd"
export(float) var MAX_WALK_SPEED = 450
export(float) var MAX_RUN_SPEED = 700
export(float) var max_walk_speed = 450.0
export(float) var max_run_speed = 700.0
func enter():
speed = 0.0
@@ -11,22 +13,29 @@ func enter():
update_look_direction(input_direction)
owner.get_node("AnimationPlayer").play("walk")
func handle_input(event):
return .handle_input(event)
func update(delta):
func update(_delta):
var input_direction = get_input_direction()
if not input_direction:
emit_signal("finished", "idle")
update_look_direction(input_direction)
speed = MAX_RUN_SPEED if Input.is_action_pressed("run") else MAX_WALK_SPEED
if Input.is_action_pressed("run"):
speed = max_run_speed
else:
speed = max_walk_speed
var collision_info = move(speed, input_direction)
if not collision_info:
return
if speed == MAX_RUN_SPEED and collision_info.collider.is_in_group("environment"):
if speed == max_run_speed and collision_info.collider.is_in_group("environment"):
return null
func move(speed, direction):
velocity = direction.normalized() * speed
owner.move_and_slide(velocity, Vector2(), 5, 2)

View File

@@ -1,8 +1,10 @@
extends "../motion.gd"
# warning-ignore-all:unused_class_variable
var speed = 0.0
var velocity = Vector2()
func handle_input(event):
if event.is_action_pressed("jump"):
emit_signal("finished", "jump")

View File

@@ -4,11 +4,7 @@
[ext_resource path="res://player/weapon/sword.png" type="Texture" id=2]
[sub_resource type="Animation" id=1]
resource_name = "SETUP"
length = 1.0
loop = false
step = 0.1
tracks/0/type = "value"
tracks/0/path = NodePath(".:rotation_degrees")
tracks/0/interp = 1
@@ -71,10 +67,8 @@ tracks/4/keys = {
}
[sub_resource type="Animation" id=2]
resource_name = "attack_circular"
length = 0.3
loop = false
step = 0.05
tracks/0/type = "value"
tracks/0/path = NodePath(".:rotation_degrees")
@@ -114,9 +108,7 @@ tracks/2/keys = {
}
[sub_resource type="Animation" id=3]
length = 0.45
loop = false
step = 0.05
tracks/0/type = "value"
tracks/0/path = NodePath(".:rotation_degrees")
@@ -173,10 +165,8 @@ tracks/3/keys = {
}
[sub_resource type="Animation" id=4]
resource_name = "attack_medium"
length = 0.5
loop = false
step = 0.05
tracks/0/type = "value"
tracks/0/path = NodePath(".:rotation_degrees")
@@ -216,10 +206,7 @@ tracks/2/keys = {
}
[sub_resource type="Animation" id=5]
length = 0.01
loop = false
step = 0.1
tracks/0/type = "value"
tracks/0/path = NodePath(".:visible")
tracks/0/interp = 1
@@ -234,45 +221,23 @@ tracks/0/keys = {
}
[node name="Sword" type="Area2D"]
input_pickable = false
gravity_vec = Vector2( 0, 1 )
gravity = 98.0
linear_damp = 0.1
angular_damp = 1.0
monitorable = false
collision_layer = 16
collision_mask = 3
audio_bus_override = false
audio_bus_name = "Master"
input_pickable = false
monitorable = false
script = ExtResource( 1 )
_sections_unfolded = [ "Transform" ]
[node name="AnimationPlayer" type="AnimationPlayer" parent="." index="0"]
root_node = NodePath("..")
autoplay = ""
playback_process_mode = 1
playback_default_blend_time = 0.0
playback_speed = 1.0
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
anims/SETUP = SubResource( 1 )
anims/attack_circular = SubResource( 2 )
anims/attack_fast = SubResource( 3 )
anims/attack_medium = SubResource( 4 )
anims/idle = SubResource( 5 )
blend_times = [ ]
_sections_unfolded = [ "Playback Options" ]
[node name="sword" type="Sprite" parent="." index="1"]
[node name="Sword" type="Sprite" parent="."]
position = Vector2( 4, 0 )
texture = ExtResource( 2 )
offset = Vector2( 67, 0 )
_sections_unfolded = [ "Offset", "Transform" ]
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="." index="2"]
build_mode = 0
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="."]
polygon = PoolVector2Array( 28.0001, -15.9999, 136, -15.9995, 160, 0, 136, 16.0005, 27.9999, 16.0001 )

View File

@@ -2,101 +2,113 @@ extends Area2D
signal attack_finished
enum STATES { IDLE, ATTACK }
enum States { IDLE, ATTACK }
var state = null
enum ATTACK_INPUT_STATES { IDLE, LISTENING, REGISTERED }
var attack_input_state = ATTACK_INPUT_STATES.IDLE
enum AttackInputStates { IDLE, LISTENING, REGISTERED }
var attack_input_state = AttackInputStates.IDLE
var ready_for_next_attack = false
const MAX_COMBO_COUNT = 3
var combo_count = 0
var attack_current = {}
var combo = [{
'damage': 1,
'animation': 'attack_fast',
'effect': null
"damage": 1,
"animation": "attack_fast",
"effect": null
},
{
'damage': 1,
'animation': 'attack_fast',
'effect': null
"damage": 1,
"animation": "attack_fast",
"effect": null
},
{
'damage': 3,
'animation': 'attack_medium',
'effect': null
"damage": 3,
"animation": "attack_medium",
"effect": null
}]
var hit_objects = []
func _ready():
$AnimationPlayer.connect('animation_finished', self, "_on_animation_finished")
# warning-ignore:return_value_discarded
$AnimationPlayer.connect("animation_finished", self, "_on_animation_finished")
# warning-ignore:return_value_discarded
self.connect("body_entered", self, "_on_body_entered")
_change_state(STATES.IDLE)
_change_state(States.IDLE)
func _change_state(new_state):
match state:
STATES.ATTACK:
States.ATTACK:
hit_objects = []
attack_input_state = ATTACK_INPUT_STATES.LISTENING
attack_input_state = AttackInputStates.LISTENING
ready_for_next_attack = false
match new_state:
STATES.IDLE:
States.IDLE:
combo_count = 0
$AnimationPlayer.stop()
visible = false
monitoring = false
STATES.ATTACK:
States.ATTACK:
attack_current = combo[combo_count -1]
$AnimationPlayer.play(attack_current['animation'])
$AnimationPlayer.play(attack_current["animation"])
visible = true
monitoring = true
state = new_state
func _input(event):
if not state == STATES.ATTACK:
return
if attack_input_state != ATTACK_INPUT_STATES.LISTENING:
return
if event.is_action_pressed('attack'):
attack_input_state = ATTACK_INPUT_STATES.REGISTERED
func _physics_process(delta):
if attack_input_state == ATTACK_INPUT_STATES.REGISTERED and ready_for_next_attack:
func _unhandled_input(event):
if not state == States.ATTACK:
return
if attack_input_state != AttackInputStates.LISTENING:
return
if event.is_action_pressed("attack"):
attack_input_state = AttackInputStates.REGISTERED
func _physics_process(_delta):
if attack_input_state == AttackInputStates.REGISTERED and ready_for_next_attack:
attack()
func attack():
combo_count += 1
_change_state(STATES.ATTACK)
_change_state(States.ATTACK)
# use with AnimationPlayer func track
# Use with AnimationPlayer func track.
func set_attack_input_listening():
attack_input_state = ATTACK_INPUT_STATES.LISTENING
attack_input_state = AttackInputStates.LISTENING
# use with AnimationPlayer func track
# Use with AnimationPlayer func track.
func set_ready_for_next_attack():
ready_for_next_attack = true
func _on_body_entered(body):
if not body.has_node('Health'):
if not body.has_node("Health"):
return
if body.get_rid().get_id() in hit_objects:
return
hit_objects.append(body.get_rid().get_id())
body.take_damage(self, attack_current['damage'], attack_current['effect'])
body.take_damage(self, attack_current["damage"], attack_current["effect"])
func _on_animation_finished(name):
func _on_animation_finished(_name):
if not attack_current:
return
if attack_input_state == ATTACK_INPUT_STATES.REGISTERED and combo_count < MAX_COMBO_COUNT:
if attack_input_state == AttackInputStates.REGISTERED and combo_count < MAX_COMBO_COUNT:
attack()
else:
_change_state(STATES.IDLE)
_change_state(States.IDLE)
emit_signal("attack_finished")
func _on_StateMachine_state_changed(current_state):
if current_state.name == "Attack":
attack()

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

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