From 3e67369f905556134059c825440ce3e8c5a3cc05 Mon Sep 17 00:00:00 2001 From: Chris Cromer Date: Tue, 5 Apr 2022 15:05:53 -0400 Subject: [PATCH 01/42] remove vscode project file --- .gitignore | 4 ++++ source.code-workspace | 43 ------------------------------------------- 2 files changed, 4 insertions(+), 43 deletions(-) delete mode 100644 source.code-workspace diff --git a/.gitignore b/.gitignore index 40cc6ad..6297a84 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,9 @@ # Godot Serialisations api.json +# Visual Studio Code Project file +source.code-workspace + # Visual Studio Cache .vs/ @@ -36,3 +39,4 @@ compile_commands.json # docs docs/ + diff --git a/source.code-workspace b/source.code-workspace deleted file mode 100644 index a5c01f6..0000000 --- a/source.code-workspace +++ /dev/null @@ -1,43 +0,0 @@ -{ - "folders": [ - { - "path": "." - } - ], - "settings": { - "files.exclude": { - "**/*.cpp": false, - "**/*.h": false, - "**/*.o": true, - "**/*.svg": true, - "**/*.png": true, - "**/*.a": true, - "**/*.os": true, - "**/*.so": true, - "**/*.dll": true, - "**/*.tmx": true, - "**/*.tsx": true, - "**/SConstruct": false, - "**/__pycache__": true, - "**/.git": true, - "**/*.yml": true, - "**/SCsub": true, - "**/Makefile": false, - "**/bin": true, - "**/build": true, - "godot/android": true, - "godot": true, - "docs": true, - "**/.import": true, - "**/*.import": true, - "compile_commands.json": true, - "**/.sconsign.dblite": true - }, - "cSpell.words": [ - "gdnative", - "godot", - "lerp", - "tscn" - ] - } -} From cdb0fbe3f7d5c6a2c71e9289a668bd09966f309f Mon Sep 17 00:00:00 2001 From: Chris Cromer Date: Wed, 6 Apr 2022 22:38:26 -0400 Subject: [PATCH 02/42] ignore any filename for code workspaces --- .gitignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 6297a84..b2b3eca 100644 --- a/.gitignore +++ b/.gitignore @@ -5,7 +5,7 @@ api.json # Visual Studio Code Project file -source.code-workspace +*.code-workspace # Visual Studio Cache .vs/ From fac339926b927ba6b5cce1b2aff8ee64329535e4 Mon Sep 17 00:00:00 2001 From: Chris Cromer Date: Wed, 6 Apr 2022 22:46:31 -0400 Subject: [PATCH 03/42] change speed back to 60.0 --- src/include/Player.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/include/Player.h b/src/include/Player.h index ab30e97..7349d47 100644 --- a/src/include/Player.h +++ b/src/include/Player.h @@ -8,7 +8,7 @@ /** * @brief The speed the player should move it. */ -#define JUEGO_PLAYER_SPEED 100.0 +#define JUEGO_PLAYER_SPEED 60.0 /** * @brief The force applied to the player when jumping. */ From bfb535cad3f97ddd466a3059920dc524debc4233 Mon Sep 17 00:00:00 2001 From: Chris Cromer Date: Wed, 6 Apr 2022 22:50:07 -0400 Subject: [PATCH 04/42] reimport icon as lossless 2D pixel art --- godot/icon.png.import | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/godot/icon.png.import b/godot/icon.png.import index a4c02e6..eb3cdb6 100644 --- a/godot/icon.png.import +++ b/godot/icon.png.import @@ -20,7 +20,7 @@ compress/hdr_mode=0 compress/bptc_ldr=0 compress/normal_map=0 flags/repeat=0 -flags/filter=true +flags/filter=false flags/mipmaps=false flags/anisotropic=false flags/srgb=2 @@ -31,5 +31,5 @@ process/invert_color=false process/normal_map_invert_y=false stream=false size_limit=0 -detect_3d=true +detect_3d=false svg/scale=1.0 From 02e6e54e2b23b6acbd43d08ade36b81f2e1957b9 Mon Sep 17 00:00:00 2001 From: Chris Cromer Date: Wed, 6 Apr 2022 22:54:35 -0400 Subject: [PATCH 05/42] tweak project settings --- godot/project.godot | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/godot/project.godot b/godot/project.godot index a7f684a..2d33340 100644 --- a/godot/project.godot +++ b/godot/project.godot @@ -21,6 +21,10 @@ window/size/height=288 window/stretch/mode="viewport" window/stretch/aspect="keep" +[editor] + +scene/scene_naming=1 + [editor_plugins] enabled=PoolStringArray( "res://addons/vnen.tiled_importer/plugin.cfg" ) @@ -74,14 +78,25 @@ right={ ] } +[layer_names] + +2d_physics/layer_1="Tiles" +2d_physics/layer_2="Player" + [physics] common/enable_pause_aware_picking=true +2d/cell_size=18 [rendering] -environment/default_environment="res://default_env.tres" +2d/snapping/use_gpu_pixel_snap=true +misc/lossless_compression/force_png=true [tiled_importer] enable_json_format=false + +[world] + +2d/cell_size=18 From 98a3a04e6ab8458862b026e596c793b2cb2bae43 Mon Sep 17 00:00:00 2001 From: Chris Cromer Date: Wed, 6 Apr 2022 22:54:54 -0400 Subject: [PATCH 06/42] remove default environment since it is not needed --- godot/default_env.tres | 7 ------- 1 file changed, 7 deletions(-) delete mode 100644 godot/default_env.tres diff --git a/godot/default_env.tres b/godot/default_env.tres deleted file mode 100644 index 20207a4..0000000 --- a/godot/default_env.tres +++ /dev/null @@ -1,7 +0,0 @@ -[gd_resource type="Environment" load_steps=2 format=2] - -[sub_resource type="ProceduralSky" id=1] - -[resource] -background_mode = 2 -background_sky = SubResource( 1 ) From c635f64d3f74618f7b9bc4e3422eb2e51658028b Mon Sep 17 00:00:00 2001 From: Chris Cromer Date: Wed, 6 Apr 2022 23:09:30 -0400 Subject: [PATCH 07/42] rename level 1 file --- godot/{Level 1.tscn => Level1.tscn} | 2 +- godot/Main.tscn | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) rename godot/{Level 1.tscn => Level1.tscn} (97%) diff --git a/godot/Level 1.tscn b/godot/Level1.tscn similarity index 97% rename from godot/Level 1.tscn rename to godot/Level1.tscn index aaa0575..c538c64 100644 --- a/godot/Level 1.tscn +++ b/godot/Level1.tscn @@ -4,7 +4,7 @@ [ext_resource path="res://levels/level01.tmx" type="PackedScene" id=3] [ext_resource path="res://characters/player/Player.tscn" type="PackedScene" id=4] -[node name="Level 1" type="Node2D"] +[node name="Level1" type="Node2D"] [node name="Player" parent="." instance=ExtResource( 4 )] position = Vector2( 8, 5 ) diff --git a/godot/Main.tscn b/godot/Main.tscn index 83963c6..f78d34a 100644 --- a/godot/Main.tscn +++ b/godot/Main.tscn @@ -1,10 +1,10 @@ [gd_scene load_steps=3 format=2] [ext_resource path="res://Main.gdns" type="Script" id=1] -[ext_resource path="res://Level 1.tscn" type="PackedScene" id=2] +[ext_resource path="res://Level1.tscn" type="PackedScene" id=2] [node name="Main" type="Node"] script = ExtResource( 1 ) launch_screen = 0 -[node name="Level 1" parent="." instance=ExtResource( 2 )] +[node name="Level1" parent="." instance=ExtResource( 2 )] From dffd81018358eeac39e627a16b46aa767b962505 Mon Sep 17 00:00:00 2001 From: Chris Cromer Date: Wed, 6 Apr 2022 23:27:40 -0400 Subject: [PATCH 08/42] recenter player in 0,0 --- godot/Level1.tscn | 1 - 1 file changed, 1 deletion(-) diff --git a/godot/Level1.tscn b/godot/Level1.tscn index c538c64..4c3cddc 100644 --- a/godot/Level1.tscn +++ b/godot/Level1.tscn @@ -7,7 +7,6 @@ [node name="Level1" type="Node2D"] [node name="Player" parent="." instance=ExtResource( 4 )] -position = Vector2( 8, 5 ) [node name="Camera2D" type="Camera2D" parent="Player"] current = true From aeb3816ded64e3990962274b210705b4f1b13467 Mon Sep 17 00:00:00 2001 From: Chris Cromer Date: Wed, 6 Apr 2022 23:43:23 -0400 Subject: [PATCH 09/42] change player collision shape to a rectangle --- godot/characters/player/Player.tscn | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/godot/characters/player/Player.tscn b/godot/characters/player/Player.tscn index 896dbe3..dde73e1 100644 --- a/godot/characters/player/Player.tscn +++ b/godot/characters/player/Player.tscn @@ -3,9 +3,8 @@ [ext_resource path="res://characters/player/sprites/green.tres" type="SpriteFrames" id=1] [ext_resource path="res://characters/player/Player.gdns" type="Script" id=2] -[sub_resource type="CapsuleShape2D" id=1] -radius = 6.0 -height = 12.0 +[sub_resource type="RectangleShape2D" id=1] +extents = Vector2( 7, 11.5 ) [node name="Player" type="KinematicBody2D"] script = ExtResource( 2 ) @@ -16,7 +15,7 @@ animation = "idle" centered = false [node name="CollisionShape2D" type="CollisionShape2D" parent="."] -position = Vector2( 12, 12 ) +position = Vector2( 12, 12.5 ) shape = SubResource( 1 ) [connection signal="player_moved" from="." to="." method="_on_Player_player_moved"] From 756b42bf82fbd0c2dcce23e95d3394eda11af49a Mon Sep 17 00:00:00 2001 From: Chris Cromer Date: Sat, 9 Apr 2022 21:50:08 -0400 Subject: [PATCH 10/42] change the game name --- Makefile | 4 ++-- README.md | 4 ++-- doxygen.conf | 2 +- godot/Main.gdns | 2 +- godot/Main.tscn | 1 - godot/characters/player/Player.gdns | 2 +- godot/gdnative/libalai.tres | 7 +++++++ godot/gdnative/libjuego.tres | 7 ------- godot/project.godot | 3 ++- src/Main.cpp | 12 ++++++------ src/Player.cpp | 18 +++++++++--------- src/include/Main.h | 10 +++++----- src/include/Player.h | 14 +++++++------- 13 files changed, 43 insertions(+), 43 deletions(-) create mode 100644 godot/gdnative/libalai.tres delete mode 100644 godot/gdnative/libjuego.tres diff --git a/Makefile b/Makefile index d3c418b..e651b4f 100644 --- a/Makefile +++ b/Makefile @@ -24,10 +24,10 @@ godot-cpp-windows: game: game-linux game-windows game-linux: - scons use_llvm=$(USE_LLVM) target=$(RELEASE_TYPE) target_path=godot/gdnative/ target_name=libjuego platform=linux bits=64 -j $(PROCS) + scons use_llvm=$(USE_LLVM) target=$(RELEASE_TYPE) target_path=godot/gdnative/ target_name=libalai platform=linux bits=64 -j $(PROCS) game-windows: - scons target=$(RELEASE_TYPE) target_name=libjuego target_path=godot/gdnative/ platform=windows bits=64 -j $(PROCS) + scons target=$(RELEASE_TYPE) target_name=libalai target_path=godot/gdnative/ platform=windows bits=64 -j $(PROCS) docs: # if doxygen and bear are installed create the code documentation diff --git a/README.md b/README.md index d87c67f..d7339e6 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ -# Juego +# Alai ## License -[3-Clause BSD License](LICENSE) \ No newline at end of file +[3-Clause BSD License](LICENSE) diff --git a/doxygen.conf b/doxygen.conf index bb27cef..244e1f1 100644 --- a/doxygen.conf +++ b/doxygen.conf @@ -32,7 +32,7 @@ DOXYFILE_ENCODING = UTF-8 # title of most generated pages and in a few other places. # The default value is: My Project. -PROJECT_NAME = "juego" +PROJECT_NAME = "Alai" # The PROJECT_NUMBER tag can be used to enter a project or revision number. This # could be handy for archiving the generated documentation or if some version diff --git a/godot/Main.gdns b/godot/Main.gdns index 1a43cfc..764a788 100644 --- a/godot/Main.gdns +++ b/godot/Main.gdns @@ -1,6 +1,6 @@ [gd_resource type="NativeScript" load_steps=2 format=2] -[ext_resource path="res://gdnative/libjuego.tres" type="GDNativeLibrary" id=1] +[ext_resource path="res://gdnative/libalai.tres" type="GDNativeLibrary" id=1] [resource] resource_name = "Main" diff --git a/godot/Main.tscn b/godot/Main.tscn index f78d34a..d264a5c 100644 --- a/godot/Main.tscn +++ b/godot/Main.tscn @@ -5,6 +5,5 @@ [node name="Main" type="Node"] script = ExtResource( 1 ) -launch_screen = 0 [node name="Level1" parent="." instance=ExtResource( 2 )] diff --git a/godot/characters/player/Player.gdns b/godot/characters/player/Player.gdns index 047be51..40af8ae 100644 --- a/godot/characters/player/Player.gdns +++ b/godot/characters/player/Player.gdns @@ -1,6 +1,6 @@ [gd_resource type="NativeScript" load_steps=2 format=2] -[ext_resource path="res://gdnative/libjuego.tres" type="GDNativeLibrary" id=1] +[ext_resource path="res://gdnative/libalai.tres" type="GDNativeLibrary" id=1] [resource] resource_name = "Player" diff --git a/godot/gdnative/libalai.tres b/godot/gdnative/libalai.tres new file mode 100644 index 0000000..e54b81b --- /dev/null +++ b/godot/gdnative/libalai.tres @@ -0,0 +1,7 @@ +[gd_resource type="GDNativeLibrary" format=2] + +[resource] +entry/Windows.64 = "res://gdnative/windows.64/libalai.dll" +entry/X11.64 = "res://gdnative/linux.64/libalai.so" +dependency/Windows.64 = [ ] +dependency/X11.64 = [ ] diff --git a/godot/gdnative/libjuego.tres b/godot/gdnative/libjuego.tres deleted file mode 100644 index 3cc3c56..0000000 --- a/godot/gdnative/libjuego.tres +++ /dev/null @@ -1,7 +0,0 @@ -[gd_resource type="GDNativeLibrary" format=2] - -[resource] -entry/Windows.64 = "res://gdnative/windows.64/libjuego.dll" -entry/X11.64 = "res://gdnative/linux.64/libjuego.so" -dependency/Windows.64 = [ ] -dependency/X11.64 = [ ] diff --git a/godot/project.godot b/godot/project.godot index 2d33340..e1b9eb4 100644 --- a/godot/project.godot +++ b/godot/project.godot @@ -10,7 +10,8 @@ config_version=4 [application] -config/name="Juego" +config/name="Alai" +config/description="This game is for testing an Artificial Intelligence." run/main_scene="res://Main.tscn" config/icon="res://icon.png" diff --git a/src/Main.cpp b/src/Main.cpp index 6202fcf..315bf3b 100644 --- a/src/Main.cpp +++ b/src/Main.cpp @@ -8,9 +8,9 @@ void Main::_register_methods() { register_method("_ready", &Main::_ready); register_method("_physics_process", &Main::_physics_process); - register_property("full_screen", &Main::set_full_screen, &Main::get_full_screen, JUEGO_MAIN_FULL_SCREEN); - register_property("window_size", &Main::set_window_size, &Main::get_window_size, JUEGO_MAIN_WINDOW_SIZE); - register_property("launch_screen", &Main::set_launch_screen, &Main::get_launch_screen, JUEGO_MAIN_LAUNCH_SCREEN); + register_property("full_screen", &Main::set_full_screen, &Main::get_full_screen, ALAI_MAIN_FULL_SCREEN); + register_property("window_size", &Main::set_window_size, &Main::get_window_size, ALAI_MAIN_WINDOW_SIZE); + register_property("launch_screen", &Main::set_launch_screen, &Main::get_launch_screen, ALAI_MAIN_LAUNCH_SCREEN); } Main::Main() @@ -26,9 +26,9 @@ void Main::_init() _os = OS::get_singleton(); _input = Input::get_singleton(); - full_screen = JUEGO_MAIN_FULL_SCREEN; - window_size = JUEGO_MAIN_WINDOW_SIZE; - launch_screen = JUEGO_MAIN_LAUNCH_SCREEN; + full_screen = ALAI_MAIN_FULL_SCREEN; + window_size = ALAI_MAIN_WINDOW_SIZE; + launch_screen = ALAI_MAIN_LAUNCH_SCREEN; } void Main::_ready() diff --git a/src/Player.cpp b/src/Player.cpp index efb7fda..0b0e0fe 100644 --- a/src/Player.cpp +++ b/src/Player.cpp @@ -14,10 +14,10 @@ void Player::_register_methods() register_method("_physics_process", &Player::_physics_process); register_method("_on_Player_player_moved", &Player::_on_Player_player_moved); //register_property>("sprite_frames", &Player::set_sprite_frames, &Player::get_sprite_frames, Ref(), GODOT_METHOD_RPC_MODE_DISABLED, GODOT_PROPERTY_USAGE_DEFAULT, GODOT_PROPERTY_HINT_RESOURCE_TYPE, String("SpriteFrames")); - register_property("speed", &Player::set_speed, &Player::get_speed, JUEGO_PLAYER_SPEED); - register_property("jump_force", &Player::set_jump_force, &Player::get_jump_force, JUEGO_PLAYER_JUMP_FORCE); - register_property("gravity", &Player::set_gravity, &Player::get_gravity, JUEGO_PLAYER_GRAVITY); - register_property("run_speed", &Player::set_run_speed, &Player::get_run_speed, JUEGO_PLAYER_RUN_SPEED); + register_property("speed", &Player::set_speed, &Player::get_speed, ALAI_PLAYER_SPEED); + register_property("jump_force", &Player::set_jump_force, &Player::get_jump_force, ALAI_PLAYER_JUMP_FORCE); + register_property("gravity", &Player::set_gravity, &Player::get_gravity, ALAI_PLAYER_GRAVITY); + register_property("run_speed", &Player::set_run_speed, &Player::get_run_speed, ALAI_PLAYER_RUN_SPEED); register_signal("player_moved", "position", GODOT_VARIANT_TYPE_VECTOR2); } @@ -35,11 +35,11 @@ void Player::_init() _input = Input::get_singleton(); _resource_loader = ResourceLoader::get_singleton(); - //sprite_frames = _resource_loader->load(JUEGO_PLAYER_SPRITE_FRAMES); - set_speed(JUEGO_PLAYER_SPEED); - set_jump_force(JUEGO_PLAYER_JUMP_FORCE); - set_gravity(JUEGO_PLAYER_GRAVITY); - set_run_speed(JUEGO_PLAYER_RUN_SPEED); + //sprite_frames = _resource_loader->load(ALAI_PLAYER_SPRITE_FRAMES); + set_speed(ALAI_PLAYER_SPEED); + set_jump_force(ALAI_PLAYER_JUMP_FORCE); + set_gravity(ALAI_PLAYER_GRAVITY); + set_run_speed(ALAI_PLAYER_RUN_SPEED); coins = 0; diff --git a/src/include/Main.h b/src/include/Main.h index 98c5611..71c9253 100644 --- a/src/include/Main.h +++ b/src/include/Main.h @@ -1,5 +1,5 @@ -#ifndef JUEGO_MAIN_H -#define JUEGO_MAIN_H +#ifndef ALAI_MAIN_H +#define ALAI_MAIN_H #include #include @@ -9,17 +9,17 @@ /** * @brief If the game should be full screen or not by default. */ -#define JUEGO_MAIN_FULL_SCREEN false +#define ALAI_MAIN_FULL_SCREEN false /** * @brief The default size of the window. * @details This is ignored if full screen is true. */ -#define JUEGO_MAIN_WINDOW_SIZE Vector2(1280, 720) +#define ALAI_MAIN_WINDOW_SIZE Vector2(1280, 720) /** * @brief Which screen to launch the game on. * @details If -1 it will launch the game on the "active" screen. Anything between 0 and N represents the screen number to show the game on when opened. */ -#define JUEGO_MAIN_LAUNCH_SCREEN -1 +#define ALAI_MAIN_LAUNCH_SCREEN -1 /** * @brief This is the godot namespace for all the code included in the library. diff --git a/src/include/Player.h b/src/include/Player.h index 7349d47..aca9b16 100644 --- a/src/include/Player.h +++ b/src/include/Player.h @@ -1,26 +1,26 @@ -#ifndef JUEGO_PLAYER_H -#define JUEGO_PLAYER_H +#ifndef ALAI_PLAYER_H +#define ALAI_PLAYER_H /** * @brief This resource is loaded by default for the AnimatedSprite node. */ -#define JUEGO_PLAYER_SPRITE_FRAMES "res://characters/player/sprites/green.tres" +#define ALAI_PLAYER_SPRITE_FRAMES "res://characters/player/sprites/green.tres" /** * @brief The speed the player should move it. */ -#define JUEGO_PLAYER_SPEED 60.0 +#define ALAI_PLAYER_SPEED 60.0 /** * @brief The force applied to the player when jumping. */ -#define JUEGO_PLAYER_JUMP_FORCE 300.0 +#define ALAI_PLAYER_JUMP_FORCE 300.0 /** * @brief The gravity applied to the player. */ -#define JUEGO_PLAYER_GRAVITY 9.81 +#define ALAI_PLAYER_GRAVITY 9.81 /** * @brief The multiplier used to change the speed of the player when running. */ -#define JUEGO_PLAYER_RUN_SPEED 2.0 +#define ALAI_PLAYER_RUN_SPEED 2.0 #include #include From ac86f148ba9e02ac8e17c2184ca06c18a7d0fe4f Mon Sep 17 00:00:00 2001 From: Chris Cromer Date: Sat, 9 Apr 2022 22:16:27 -0400 Subject: [PATCH 11/42] merge develop --- godot/Main.tscn | 6 ++++++ godot/characters/player/Player.tscn | 20 ++++++++++++++++---- src/godot.cpp | 10 ++++++++++ 3 files changed, 32 insertions(+), 4 deletions(-) diff --git a/godot/Main.tscn b/godot/Main.tscn index d264a5c..9d1190c 100644 --- a/godot/Main.tscn +++ b/godot/Main.tscn @@ -7,3 +7,9 @@ script = ExtResource( 1 ) [node name="Level1" parent="." instance=ExtResource( 2 )] + +[node name="StateMachine" type="Node" parent="."] + +[node name="Walk" type="Node" parent="StateMachine"] + +[node name="Run" type="Node" parent="StateMachine"] diff --git a/godot/characters/player/Player.tscn b/godot/characters/player/Player.tscn index dde73e1..b8ef56b 100644 --- a/godot/characters/player/Player.tscn +++ b/godot/characters/player/Player.tscn @@ -1,13 +1,14 @@ -[gd_scene load_steps=4 format=2] +[gd_scene load_steps=5 format=2] [ext_resource path="res://characters/player/sprites/green.tres" type="SpriteFrames" id=1] -[ext_resource path="res://characters/player/Player.gdns" type="Script" id=2] +[ext_resource path="res://characters/player/states/Idle.gdns" type="Script" id=2] +[ext_resource path="res://characters/player/Player.gdns" type="Script" id=3] [sub_resource type="RectangleShape2D" id=1] extents = Vector2( 7, 11.5 ) [node name="Player" type="KinematicBody2D"] -script = ExtResource( 2 ) +script = ExtResource( 3 ) [node name="AnimatedSprite" type="AnimatedSprite" parent="."] frames = ExtResource( 1 ) @@ -18,4 +19,15 @@ centered = false position = Vector2( 12, 12.5 ) shape = SubResource( 1 ) -[connection signal="player_moved" from="." to="." method="_on_Player_player_moved"] +[node name="StateMachine" type="Node" parent="."] + +[node name="Idle" type="Node" parent="StateMachine"] +script = ExtResource( 2 ) + +[node name="Move" type="Node" parent="StateMachine"] + +[node name="Jump" type="Node" parent="StateMachine"] + +[node name="DoubleJump" type="Node" parent="StateMachine"] + +[node name="Fall" type="Node" parent="StateMachine"] diff --git a/src/godot.cpp b/src/godot.cpp index 4389706..d8f50b7 100644 --- a/src/godot.cpp +++ b/src/godot.cpp @@ -1,7 +1,12 @@ #include +#include "StateMachine.h" +#include "State.h" +#include "Walk.h" +#include "Run.h" #include "Main.h" #include "Player.h" +#include "PlayerIdle.h" using namespace godot; @@ -21,6 +26,11 @@ extern "C" void GDN_EXPORT godot_gdnative_terminate(godot_gdnative_terminate_opt extern "C" void GDN_EXPORT godot_nativescript_init(void *handle) { Godot::nativescript_init(handle); + register_class(); + register_class(); + register_class(); + register_class(); register_class
(); register_class(); + register_class(); } From 8f76f9a2c9144567a77014ec2f0cb131c1946dfa Mon Sep 17 00:00:00 2001 From: Chris Cromer Date: Sat, 9 Apr 2022 22:20:02 -0400 Subject: [PATCH 12/42] move player code --- src/{ => player}/Player.cpp | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename src/{ => player}/Player.cpp (100%) diff --git a/src/Player.cpp b/src/player/Player.cpp similarity index 100% rename from src/Player.cpp rename to src/player/Player.cpp From 35af76cda4ee0f0fe1d44954c9c0d2f7cedd6d44 Mon Sep 17 00:00:00 2001 From: Chris Cromer Date: Sat, 9 Apr 2022 22:21:04 -0400 Subject: [PATCH 13/42] detatch script --- godot/characters/player/Player.tscn | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/godot/characters/player/Player.tscn b/godot/characters/player/Player.tscn index b8ef56b..b5643c5 100644 --- a/godot/characters/player/Player.tscn +++ b/godot/characters/player/Player.tscn @@ -1,7 +1,6 @@ -[gd_scene load_steps=5 format=2] +[gd_scene load_steps=4 format=2] [ext_resource path="res://characters/player/sprites/green.tres" type="SpriteFrames" id=1] -[ext_resource path="res://characters/player/states/Idle.gdns" type="Script" id=2] [ext_resource path="res://characters/player/Player.gdns" type="Script" id=3] [sub_resource type="RectangleShape2D" id=1] @@ -22,7 +21,6 @@ shape = SubResource( 1 ) [node name="StateMachine" type="Node" parent="."] [node name="Idle" type="Node" parent="StateMachine"] -script = ExtResource( 2 ) [node name="Move" type="Node" parent="StateMachine"] From 6d2d1178a74c67106bd06ca317a9526e9487b57f Mon Sep 17 00:00:00 2001 From: Chris Cromer Date: Sun, 10 Apr 2022 09:43:33 -0400 Subject: [PATCH 14/42] remove include directory --- SConstruct | 3 ++- src/{include => }/Main.h | 0 src/{include => player}/Player.h | 0 3 files changed, 2 insertions(+), 1 deletion(-) rename src/{include => }/Main.h (100%) rename src/{include => player}/Player.h (100%) diff --git a/SConstruct b/SConstruct index d6aa482..a17df99 100644 --- a/SConstruct +++ b/SConstruct @@ -63,6 +63,7 @@ if env['platform'] == 'linux': env.Append(CCFLAGS=['-g3', '-Og']) else: env.Append(CCFLAGS=['-g', '-O3']) + env.Append(CPPDEFINES=['NDEBUG']) env.Append(CCFLAGS=['-m64']) env.Append(LINKFLAGS=['-m64']) @@ -109,7 +110,7 @@ else: cpp_library += '.' + str(env['bits']) # make sure our binding library is properly includes -env.Append(CPPPATH=['.', godot_headers_path, cpp_bindings_path + 'include/', cpp_bindings_path + 'include/core/', cpp_bindings_path + 'include/gen/', 'src/include/', 'lib/include']) +env.Append(CPPPATH=['.', godot_headers_path, cpp_bindings_path + 'include/', cpp_bindings_path + 'include/core/', cpp_bindings_path + 'include/gen/']) env.Append(LIBPATH=[cpp_bindings_path + 'bin/']) env.Append(LIBS=[cpp_library]) diff --git a/src/include/Main.h b/src/Main.h similarity index 100% rename from src/include/Main.h rename to src/Main.h diff --git a/src/include/Player.h b/src/player/Player.h similarity index 100% rename from src/include/Player.h rename to src/player/Player.h From ecd6fe45b2aecc976c907377d6c56d8df8bce7e2 Mon Sep 17 00:00:00 2001 From: Chris Cromer Date: Mon, 11 Apr 2022 13:30:51 -0400 Subject: [PATCH 15/42] add state machine and have player use it --- godot/Main.gdns | 2 +- godot/Main.tscn | 6 - godot/characters/player/Player.gdns | 9 +- godot/characters/player/Player.tscn | 23 +- godot/characters/player/states/Fall.gdns | 8 + godot/characters/player/states/Idle.gdns | 8 + godot/characters/player/states/Jump.gdns | 8 + godot/characters/player/states/Move.gdns | 8 + godot/gdnative/{libalai.tres => alai.tres} | 0 godot/state_machine/State.gdns | 8 + godot/state_machine/StateMachine.gdns | 8 + src/Main.cpp | 20 +- src/Main.h | 214 +++++++------ src/godot.cpp | 24 +- src/player/Player.cpp | 118 ++------ src/player/Player.h | 330 ++++++++++----------- src/player/states/PlayerFall.cpp | 78 +++++ src/player/states/PlayerFall.h | 44 +++ src/player/states/PlayerIdle.cpp | 65 ++++ src/player/states/PlayerIdle.h | 45 +++ src/player/states/PlayerJump.cpp | 105 +++++++ src/player/states/PlayerJump.h | 45 +++ src/player/states/PlayerMove.cpp | 94 ++++++ src/player/states/PlayerMove.h | 46 +++ src/state_machine/State.cpp | 54 ++++ src/state_machine/State.h | 46 +++ src/state_machine/StateMachine.cpp | 208 +++++++++++++ src/state_machine/StateMachine.h | 95 ++++++ 28 files changed, 1303 insertions(+), 416 deletions(-) create mode 100644 godot/characters/player/states/Fall.gdns create mode 100644 godot/characters/player/states/Idle.gdns create mode 100644 godot/characters/player/states/Jump.gdns create mode 100644 godot/characters/player/states/Move.gdns rename godot/gdnative/{libalai.tres => alai.tres} (100%) create mode 100644 godot/state_machine/State.gdns create mode 100644 godot/state_machine/StateMachine.gdns create mode 100644 src/player/states/PlayerFall.cpp create mode 100644 src/player/states/PlayerFall.h create mode 100644 src/player/states/PlayerIdle.cpp create mode 100644 src/player/states/PlayerIdle.h create mode 100644 src/player/states/PlayerJump.cpp create mode 100644 src/player/states/PlayerJump.h create mode 100644 src/player/states/PlayerMove.cpp create mode 100644 src/player/states/PlayerMove.h create mode 100644 src/state_machine/State.cpp create mode 100644 src/state_machine/State.h create mode 100644 src/state_machine/StateMachine.cpp create mode 100644 src/state_machine/StateMachine.h diff --git a/godot/Main.gdns b/godot/Main.gdns index 764a788..524516e 100644 --- a/godot/Main.gdns +++ b/godot/Main.gdns @@ -1,6 +1,6 @@ [gd_resource type="NativeScript" load_steps=2 format=2] -[ext_resource path="res://gdnative/libalai.tres" type="GDNativeLibrary" id=1] +[ext_resource path="res://gdnative/alai.tres" type="GDNativeLibrary" id=1] [resource] resource_name = "Main" diff --git a/godot/Main.tscn b/godot/Main.tscn index 9d1190c..d264a5c 100644 --- a/godot/Main.tscn +++ b/godot/Main.tscn @@ -7,9 +7,3 @@ script = ExtResource( 1 ) [node name="Level1" parent="." instance=ExtResource( 2 )] - -[node name="StateMachine" type="Node" parent="."] - -[node name="Walk" type="Node" parent="StateMachine"] - -[node name="Run" type="Node" parent="StateMachine"] diff --git a/godot/characters/player/Player.gdns b/godot/characters/player/Player.gdns index 40af8ae..4553176 100644 --- a/godot/characters/player/Player.gdns +++ b/godot/characters/player/Player.gdns @@ -1,8 +1,13 @@ [gd_resource type="NativeScript" load_steps=2 format=2] -[ext_resource path="res://gdnative/libalai.tres" type="GDNativeLibrary" id=1] +[sub_resource type="GDNativeLibrary" id=1] +symbol_prefix = "godot_player" +entry/Windows.64 = "res://gdnative/windows.64/libalai.dll" +entry/X11.64 = "res://gdnative/linux.64/libalai.so" +dependency/Windows.64 = [ ] +dependency/X11.64 = [ ] [resource] resource_name = "Player" class_name = "Player" -library = ExtResource( 1 ) +library = SubResource( 1 ) diff --git a/godot/characters/player/Player.tscn b/godot/characters/player/Player.tscn index b5643c5..fd71fe2 100644 --- a/godot/characters/player/Player.tscn +++ b/godot/characters/player/Player.tscn @@ -1,13 +1,18 @@ -[gd_scene load_steps=4 format=2] +[gd_scene load_steps=9 format=2] [ext_resource path="res://characters/player/sprites/green.tres" type="SpriteFrames" id=1] -[ext_resource path="res://characters/player/Player.gdns" type="Script" id=3] +[ext_resource path="res://characters/player/states/Idle.gdns" type="Script" id=2] +[ext_resource path="res://state_machine/StateMachine.gdns" type="Script" id=3] +[ext_resource path="res://characters/player/states/Move.gdns" type="Script" id=4] +[ext_resource path="res://characters/player/Player.gdns" type="Script" id=5] +[ext_resource path="res://characters/player/states/Jump.gdns" type="Script" id=6] +[ext_resource path="res://characters/player/states/Fall.gdns" type="Script" id=7] [sub_resource type="RectangleShape2D" id=1] -extents = Vector2( 7, 11.5 ) +extents = Vector2( 7, 12 ) [node name="Player" type="KinematicBody2D"] -script = ExtResource( 3 ) +script = ExtResource( 5 ) [node name="AnimatedSprite" type="AnimatedSprite" parent="."] frames = ExtResource( 1 ) @@ -15,17 +20,21 @@ animation = "idle" centered = false [node name="CollisionShape2D" type="CollisionShape2D" parent="."] -position = Vector2( 12, 12.5 ) +position = Vector2( 12, 12 ) shape = SubResource( 1 ) [node name="StateMachine" type="Node" parent="."] +script = ExtResource( 3 ) +default_state = "Idle" [node name="Idle" type="Node" parent="StateMachine"] +script = ExtResource( 2 ) [node name="Move" type="Node" parent="StateMachine"] +script = ExtResource( 4 ) [node name="Jump" type="Node" parent="StateMachine"] - -[node name="DoubleJump" type="Node" parent="StateMachine"] +script = ExtResource( 6 ) [node name="Fall" type="Node" parent="StateMachine"] +script = ExtResource( 7 ) diff --git a/godot/characters/player/states/Fall.gdns b/godot/characters/player/states/Fall.gdns new file mode 100644 index 0000000..520e3af --- /dev/null +++ b/godot/characters/player/states/Fall.gdns @@ -0,0 +1,8 @@ +[gd_resource type="NativeScript" load_steps=2 format=2] + +[ext_resource path="res://gdnative/alai.tres" type="GDNativeLibrary" id=1] + +[resource] +resource_name = "PlayerFall" +class_name = "PlayerFall" +library = ExtResource( 1 ) diff --git a/godot/characters/player/states/Idle.gdns b/godot/characters/player/states/Idle.gdns new file mode 100644 index 0000000..4e5fb7d --- /dev/null +++ b/godot/characters/player/states/Idle.gdns @@ -0,0 +1,8 @@ +[gd_resource type="NativeScript" load_steps=2 format=2] + +[ext_resource path="res://gdnative/alai.tres" type="GDNativeLibrary" id=1] + +[resource] +resource_name = "PlayerIdle" +class_name = "PlayerIdle" +library = ExtResource( 1 ) diff --git a/godot/characters/player/states/Jump.gdns b/godot/characters/player/states/Jump.gdns new file mode 100644 index 0000000..915bbca --- /dev/null +++ b/godot/characters/player/states/Jump.gdns @@ -0,0 +1,8 @@ +[gd_resource type="NativeScript" load_steps=2 format=2] + +[ext_resource path="res://gdnative/alai.tres" type="GDNativeLibrary" id=1] + +[resource] +resource_name = "PlayerJump" +class_name = "PlayerJump" +library = ExtResource( 1 ) diff --git a/godot/characters/player/states/Move.gdns b/godot/characters/player/states/Move.gdns new file mode 100644 index 0000000..5b43556 --- /dev/null +++ b/godot/characters/player/states/Move.gdns @@ -0,0 +1,8 @@ +[gd_resource type="NativeScript" load_steps=2 format=2] + +[ext_resource path="res://gdnative/alai.tres" type="GDNativeLibrary" id=1] + +[resource] +resource_name = "PlayerMove" +class_name = "PlayerMove" +library = ExtResource( 1 ) diff --git a/godot/gdnative/libalai.tres b/godot/gdnative/alai.tres similarity index 100% rename from godot/gdnative/libalai.tres rename to godot/gdnative/alai.tres diff --git a/godot/state_machine/State.gdns b/godot/state_machine/State.gdns new file mode 100644 index 0000000..dad8e97 --- /dev/null +++ b/godot/state_machine/State.gdns @@ -0,0 +1,8 @@ +[gd_resource type="NativeScript" load_steps=2 format=2] + +[ext_resource path="res://gdnative/libalai.tres" type="GDNativeLibrary" id=1] + +[resource] +resource_name = "State" +class_name = "State" +library = ExtResource( 1 ) diff --git a/godot/state_machine/StateMachine.gdns b/godot/state_machine/StateMachine.gdns new file mode 100644 index 0000000..77bc502 --- /dev/null +++ b/godot/state_machine/StateMachine.gdns @@ -0,0 +1,8 @@ +[gd_resource type="NativeScript" load_steps=2 format=2] + +[ext_resource path="res://gdnative/alai.tres" type="GDNativeLibrary" id=1] + +[resource] +resource_name = "StateMachine" +class_name = "StateMachine" +library = ExtResource( 1 ) diff --git a/src/Main.cpp b/src/Main.cpp index 315bf3b..ef0fe55 100644 --- a/src/Main.cpp +++ b/src/Main.cpp @@ -3,14 +3,15 @@ #include using namespace godot; +using namespace main; void Main::_register_methods() { register_method("_ready", &Main::_ready); register_method("_physics_process", &Main::_physics_process); - register_property("full_screen", &Main::set_full_screen, &Main::get_full_screen, ALAI_MAIN_FULL_SCREEN); - register_property("window_size", &Main::set_window_size, &Main::get_window_size, ALAI_MAIN_WINDOW_SIZE); - register_property("launch_screen", &Main::set_launch_screen, &Main::get_launch_screen, ALAI_MAIN_LAUNCH_SCREEN); + register_property("full_screen", &Main::set_full_screen, &Main::get_full_screen, main::full_screen); + register_property("window_size", &Main::set_window_size, &Main::get_window_size, main::window_size); + register_property("launch_screen", &Main::set_launch_screen, &Main::get_launch_screen, main::launch_screen); } Main::Main() @@ -26,9 +27,9 @@ void Main::_init() _os = OS::get_singleton(); _input = Input::get_singleton(); - full_screen = ALAI_MAIN_FULL_SCREEN; - window_size = ALAI_MAIN_WINDOW_SIZE; - launch_screen = ALAI_MAIN_LAUNCH_SCREEN; + full_screen = main::full_screen; + window_size = main::window_size; + launch_screen = main::launch_screen; } void Main::_ready() @@ -39,17 +40,10 @@ void Main::_ready() } else { - String resolution = String("Resolution before: " + String().num(_os->get_window_size().x) + "x" + String().num(_os->get_window_size().y)); - Godot::print(resolution); - _os->set_window_size(window_size); _os->set_window_position( _os->get_screen_position(get_launch_screen()) + _os->get_screen_size() * 0.5 - _os->get_window_size() * 0.5 ); - - resolution = String("Resolution after: " + String().num(_os->get_window_size().x) + "x" + String().num(_os->get_window_size().y)); - - Godot::print(resolution); } } diff --git a/src/Main.h b/src/Main.h index 71c9253..3a65398 100644 --- a/src/Main.h +++ b/src/Main.h @@ -6,138 +6,130 @@ #include #include -/** - * @brief If the game should be full screen or not by default. - */ -#define ALAI_MAIN_FULL_SCREEN false -/** - * @brief The default size of the window. - * @details This is ignored if full screen is true. - */ -#define ALAI_MAIN_WINDOW_SIZE Vector2(1280, 720) -/** - * @brief Which screen to launch the game on. - * @details If -1 it will launch the game on the "active" screen. Anything between 0 and N represents the screen number to show the game on when opened. - */ -#define ALAI_MAIN_LAUNCH_SCREEN -1 - /** * @brief This is the godot namespace for all the code included in the library. * @details This namespace is used a prefix when the Godot engine looks for classes, methods, and properties. */ namespace godot { - /** - * @brief This class controls the Main node. - * @details The main node is responsible for controling the window and the game iteself is a child of it. - */ - class Main : public Node + namespace main { - GODOT_CLASS(Main, Node) + const bool full_screen = false; + const Vector2 window_size = Vector2(1280, 720); + const int8_t launch_screen = -1; - private: - /** - * @brief OS singleton. - */ - OS *_os; - /** - * @brief Input singleton. - */ - Input *_input; + /** + * @brief This class controls the Main node. + * @details The main node is responsible for controling the window and the game iteself is a child of it. + */ + class Main : public Node + { + GODOT_CLASS(Main, Node) - /** - * @brief If the window is full screen or not. - */ - bool full_screen; - /** - * @brief The size of the window. - */ - Vector2 window_size; - /** - * @brief The screen to launch the game on. - */ - int8_t launch_screen; + private: + /** + * @brief OS singleton. + */ + OS *_os; + /** + * @brief Input singleton. + */ + Input *_input; - public: - /** - * @brief This method registers classes with Godot. - * @details This method registers methods, properties, and signals with the Godot engine. - */ - static void _register_methods(); + /** + * @brief If the window is full screen or not. + */ + bool full_screen; + /** + * @brief The size of the window. + */ + Vector2 window_size; + /** + * @brief The screen to launch the game on. + */ + int8_t launch_screen; - /** - * @brief Construct a new Main object. - */ - Main(); + public: + /** + * @brief This method registers classes with Godot. + * @details This method registers methods, properties, and signals with the Godot engine. + */ + static void _register_methods(); - /** - * @brief Destroy the Main object. - */ - ~Main(); + /** + * @brief Construct a new Main object. + */ + Main(); - /** - * @brief Initialize the class from Godot. - * @details This method is called just once when the Godot engine connects to the instance of the class. - */ - void _init(); + /** + * @brief Destroy the Main object. + */ + ~Main(); - /** - * @brief Code to be run when ready. - * @details This method is run when all the children of this node are ready. - */ - void _ready(); + /** + * @brief Initialize the class from Godot. + * @details This method is called just once when the Godot engine connects to the instance of the class. + */ + void _init(); - /** - * @brief This class handles the physics processing. - * @details Every delta time, this function is called to check for input and update positioning. - * - * @param[in] delta The difference in time that passed since the last call to this method. - */ - void _physics_process(float delta); + /** + * @brief Code to be run when ready. + * @details This method is run when all the children of this node are ready. + */ + void _ready(); - /** - * @brief Set the full screen object. - * - * @param[in] new_full_screen The new full screen state. - */ - void set_full_screen(bool new_full_screen); + /** + * @brief This class handles the physics processing. + * @details Every delta time, this function is called to check for input and update positioning. + * + * @param[in] delta The difference in time that passed since the last call to this method. + */ + void _physics_process(float delta); - /** - * @brief Get the full screen object. - * - * @return true If full screen. - * @return false If not full screen. - */ - bool get_full_screen(); + /** + * @brief Set the full screen object. + * + * @param[in] new_full_screen The new full screen state. + */ + void set_full_screen(bool new_full_screen); - /** - * @brief Set the window size object. - * - * @param[in] new_window_size The new window size. - */ - void set_window_size(Vector2 new_window_size); + /** + * @brief Get the full screen object. + * + * @return true If full screen. + * @return false If not full screen. + */ + bool get_full_screen(); - /** - * @brief Get the window size object. - * - * @return Vector2 The window size. - */ - Vector2 get_window_size(); + /** + * @brief Set the window size object. + * + * @param[in] new_window_size The new window size. + */ + void set_window_size(Vector2 new_window_size); - /** - * @brief Set the launch screen object. - * - * @param[in] new_launch_screen The launch screen to use. - */ - void set_launch_screen(int8_t new_launch_screen); + /** + * @brief Get the window size object. + * + * @return Vector2 The window size. + */ + Vector2 get_window_size(); - /** - * @brief Get the launch screen object. - * - * @return int8_t The launch screen. - */ - int8_t get_launch_screen(); - }; + /** + * @brief Set the launch screen object. + * + * @param[in] new_launch_screen The launch screen to use. + */ + void set_launch_screen(int8_t new_launch_screen); + + /** + * @brief Get the launch screen object. + * + * @return int8_t The launch screen. + */ + int8_t get_launch_screen(); + }; + } } #endif diff --git a/src/godot.cpp b/src/godot.cpp index d8f50b7..b449e46 100644 --- a/src/godot.cpp +++ b/src/godot.cpp @@ -1,12 +1,13 @@ #include -#include "StateMachine.h" -#include "State.h" -#include "Walk.h" -#include "Run.h" +#include "state_machine/StateMachine.h" +#include "state_machine/State.h" #include "Main.h" -#include "Player.h" -#include "PlayerIdle.h" +#include "player/Player.h" +#include "player/states/PlayerIdle.h" +#include "player/states/PlayerMove.h" +#include "player/states/PlayerJump.h" +#include "player/states/PlayerFall.h" using namespace godot; @@ -28,9 +29,10 @@ extern "C" void GDN_EXPORT godot_nativescript_init(void *handle) Godot::nativescript_init(handle); register_class(); register_class(); - register_class(); - register_class(); - register_class
(); - register_class(); - register_class(); + register_class(); + register_class(); + register_class(); + register_class(); + register_class(); + register_class(); } diff --git a/src/player/Player.cpp b/src/player/Player.cpp index 0b0e0fe..30c801d 100644 --- a/src/player/Player.cpp +++ b/src/player/Player.cpp @@ -7,18 +7,20 @@ #include using namespace godot; +using namespace player; void Player::_register_methods() { register_method("_ready", &Player::_ready); register_method("_physics_process", &Player::_physics_process); - register_method("_on_Player_player_moved", &Player::_on_Player_player_moved); + register_method("set_velocity", &Player::set_velocity); + register_method("get_velocity", &Player::get_velocity); //register_property>("sprite_frames", &Player::set_sprite_frames, &Player::get_sprite_frames, Ref(), GODOT_METHOD_RPC_MODE_DISABLED, GODOT_PROPERTY_USAGE_DEFAULT, GODOT_PROPERTY_HINT_RESOURCE_TYPE, String("SpriteFrames")); - register_property("speed", &Player::set_speed, &Player::get_speed, ALAI_PLAYER_SPEED); - register_property("jump_force", &Player::set_jump_force, &Player::get_jump_force, ALAI_PLAYER_JUMP_FORCE); - register_property("gravity", &Player::set_gravity, &Player::get_gravity, ALAI_PLAYER_GRAVITY); - register_property("run_speed", &Player::set_run_speed, &Player::get_run_speed, ALAI_PLAYER_RUN_SPEED); - register_signal("player_moved", "position", GODOT_VARIANT_TYPE_VECTOR2); + register_property("speed", &Player::set_speed, &Player::get_speed, player::speed); + register_property("jump_force", &Player::set_jump_force, &Player::get_jump_force, player::jump_force); + register_property("gravity", &Player::set_gravity, &Player::get_gravity, player::gravity); + register_property("run_speed", &Player::set_run_speed, &Player::get_run_speed, player::run_speed); + register_property("double_jump", &Player::set_double_jump, &Player::get_double_jump, player::double_jump); } Player::Player() @@ -31,21 +33,18 @@ Player::~Player() void Player::_init() { - _os = OS::get_singleton(); - _input = Input::get_singleton(); _resource_loader = ResourceLoader::get_singleton(); - //sprite_frames = _resource_loader->load(ALAI_PLAYER_SPRITE_FRAMES); - set_speed(ALAI_PLAYER_SPEED); - set_jump_force(ALAI_PLAYER_JUMP_FORCE); - set_gravity(ALAI_PLAYER_GRAVITY); - set_run_speed(ALAI_PLAYER_RUN_SPEED); + //sprite_frames = _resource_loader->load(player::sprite_frames); + set_speed(player::speed); + set_jump_force(player::jump_force); + set_gravity(player::gravity); + set_run_speed(player::run_speed); + set_double_jump(player::double_jump); coins = 0; velocity = Vector2(); - - jumping = 0; } void Player::_ready() @@ -53,7 +52,7 @@ void Player::_ready() animated_sprite = get_node("AnimatedSprite"); if (!animated_sprite) { - WARN_PRINT("AnimateSprite not found!"); + ERR_PRINT("AnimateSprite not found!"); animated_sprite = AnimatedSprite()._new(); } //animated_sprite->set_sprite_frames(sprite_frames); @@ -74,74 +73,7 @@ void Player::_ready() void Player::_physics_process(float delta) { - auto current_speed = get_speed(); - velocity.x = 0; - if (_input->is_action_pressed("run")) - { - current_speed *= get_run_speed(); - } - - if (_input->is_action_pressed("right")) - { - velocity.x += current_speed; - } - - if (_input->is_action_pressed("left")) - { - velocity.x += -current_speed; - } - - if (velocity.x > 0) - { - animated_sprite->play("move"); - animated_sprite->set_flip_h(true); - } - else if (velocity.x < 0) - { - animated_sprite->play("move"); - animated_sprite->set_flip_h(false); - } - else - { - animated_sprite->stop(); - animated_sprite->set_animation("idle"); - } - - if (jumping > 0 && is_on_floor()) - { - animated_sprite->set_frame(1); - jumping = 0; - } - - if (!is_on_floor()) - { - animated_sprite->stop(); - animated_sprite->set_animation("air"); - if (jumping == 0) - { - jumping = 2; - } - } - velocity.y += get_gravity(); - if (_input->is_action_just_pressed("jump") && jumping < 2) - { - velocity.y = -get_jump_force(); - jumping++; - } - - if (_input->is_action_just_released("jump")) - { - if (velocity.y < -100) - { - velocity.y = -100; - } - } - - if (velocity.x < 0 || velocity.x > 0) - { - //emit_signal("player_moved", get_position()); - } velocity = move_and_slide(velocity, Vector2::UP, true); velocity.x = Math::lerp((float) velocity.x, (float) 0, (float) 0.2); @@ -170,7 +102,6 @@ void Player::_physics_process(float delta) { if (get_parent()->get_class() == "TileMap") { - Godot::print("Off screen"); auto error = get_tree()->change_scene("res://Main.tscn"); if (error != Error::OK) { @@ -231,7 +162,22 @@ float Player::get_run_speed() return run_speed; } -void Player::_on_Player_player_moved(Vector2 position) +void Player::set_double_jump(bool double_jump) { - Godot::print(position); + this->double_jump = double_jump; +} + +bool Player::get_double_jump() +{ + return this->double_jump; +} + +void Player::set_velocity(Vector2 velocity) +{ + this->velocity = velocity; +} + +Vector2 Player::get_velocity() +{ + return this->velocity; } diff --git a/src/player/Player.h b/src/player/Player.h index aca9b16..67ff8c4 100644 --- a/src/player/Player.h +++ b/src/player/Player.h @@ -1,37 +1,12 @@ #ifndef ALAI_PLAYER_H #define ALAI_PLAYER_H -/** - * @brief This resource is loaded by default for the AnimatedSprite node. - */ -#define ALAI_PLAYER_SPRITE_FRAMES "res://characters/player/sprites/green.tres" -/** - * @brief The speed the player should move it. - */ -#define ALAI_PLAYER_SPEED 60.0 -/** - * @brief The force applied to the player when jumping. - */ -#define ALAI_PLAYER_JUMP_FORCE 300.0 -/** - * @brief The gravity applied to the player. - */ -#define ALAI_PLAYER_GRAVITY 9.81 -/** - * @brief The multiplier used to change the speed of the player when running. - */ -#define ALAI_PLAYER_RUN_SPEED 2.0 - #include #include -#include #include -#include -#include #include #include #include -#include /** * @brief This is the godot namespace for all the code included in the library. @@ -39,181 +14,178 @@ */ namespace godot { - /** - * @brief This class is used to control the player. - * @details This class allows the player to move, run, and jump as well as controls the sprite displayed for those actions. - */ - class Player : public KinematicBody2D + namespace player { - GODOT_CLASS(Player, KinematicBody2D) + const char player_sprite_frames[] = "res://characters/player/sprites/green.tres"; + const float speed = 60.0; + const float jump_force = 300.0; + const float gravity = 9.81; + const float run_speed = 2.0; + const bool double_jump = true; - private: - /** - * @brief OS singleton. - */ - OS *_os; - /** - * @brief Input singleton. - */ - Input *_input; - /** - * @brief ResourceLoader singleton. - */ - ResourceLoader *_resource_loader; + /** + * @brief This class is used to control the player. + * @details This class allows the player to move, run, and jump as well as controls the sprite displayed for those actions. + */ + class Player : public KinematicBody2D + { + GODOT_CLASS(Player, KinematicBody2D) - /** - * @brief The animated sprite connected to the KinematicBody2D. - */ - AnimatedSprite *animated_sprite; - /** - * @brief The sprite frames used in the animated sprite. - */ - Ref sprite_frames; - /** - * @brief The coins the player has collected. - */ - uint8_t coins; - /** - * @brief The velocity at which moves the player moves. - */ - Vector2 velocity; - /** - * @brief The speed that the player moves in. - */ - float speed; - /** - * @brief The force applied to the player when jumping. - */ - float jump_force; - /** - * @brief The gravity applied to the player. - */ - float gravity; - /** - * @brief The speed multiplier used to make the player move faster. - */ - float run_speed; + private: + /** + * @brief ResourceLoader singleton. + */ + ResourceLoader *_resource_loader; - /** - * @brief State of jumping of the player. To be replaced with a state machine in the future. - */ - uint8_t jumping; + /** + * @brief The animated sprite connected to the KinematicBody2D. + */ + AnimatedSprite *animated_sprite; + /** + * @brief The sprite frames used in the animated sprite. + */ + Ref sprite_frames; + /** + * @brief The coins the player has collected. + */ + uint8_t coins; + /** + * @brief The velocity at which moves the player moves. + */ + Vector2 velocity; + /** + * @brief The speed that the player moves in. + */ + float speed; + /** + * @brief The force applied to the player when jumping. + */ + float jump_force; + /** + * @brief The gravity applied to the player. + */ + float gravity; + /** + * @brief The speed multiplier used to make the player move faster. + */ + float run_speed; - public: - /** - * @brief This method registers classes with Godot. - * @details This method registers methods, properties, and signals with the Godot engine. - */ - static void _register_methods(); + bool double_jump; - /** - * @brief Construct a new Player object. - */ - Player(); + public: + /** + * @brief This method registers classes with Godot. + * @details This method registers methods, properties, and signals with the Godot engine. + */ + static void _register_methods(); - /** - * @brief Destroy the Player object. - */ - ~Player(); + /** + * @brief Construct a new Player object. + */ + Player(); - /** - * @brief Initialize the class from Godot. - * @details This method is called just once when the Godot engine connects to the instance of the class. - */ - void _init(); + /** + * @brief Destroy the Player object. + */ + ~Player(); - /** - * @brief Code to be run when ready. - * @details This method is run when all the children of this node are ready. - */ - void _ready(); + /** + * @brief Initialize the class from Godot. + * @details This method is called just once when the Godot engine connects to the instance of the class. + */ + void _init(); - /** - * @brief This class handles the physics processing. - * @details Every delta time, this function is called to check for input and update positioning. - * - * @param[in] delta The difference in time that passed since the last call to this method. - */ - void _physics_process(float delta); + /** + * @brief Code to be run when ready. + * @details This method is run when all the children of this node are ready. + */ + void _ready(); - /** - * @brief Set the sprite frames object. - * - * @param[in] new_sprite_frames The new sprite frame. - */ - void set_sprite_frames(Ref new_sprite_frames); + /** + * @brief This class handles the physics processing. + * @details Every delta time, this function is called to check for input and update positioning. + * + * @param[in] delta The difference in time that passed since the last call to this method. + */ + void _physics_process(float delta); - /** - * @brief Get the sprite frames object. - * - * @return Ref A reference to the sprite frames object. - */ - Ref get_sprite_frames(); + /** + * @brief Set the sprite frames object. + * + * @param[in] new_sprite_frames The new sprite frame. + */ + void set_sprite_frames(Ref new_sprite_frames); - /** - * @brief Set the speed object. - * - * @param[in] new_speed The new speed. - */ - void set_speed(float new_speed); + /** + * @brief Get the sprite frames object. + * + * @return Ref A reference to the sprite frames object. + */ + Ref get_sprite_frames(); - /** - * @brief Get the speed object. - * - * @return float The current speed of the player. - */ - float get_speed(); + /** + * @brief Set the speed object. + * + * @param[in] new_speed The new speed. + */ + void set_speed(float new_speed); - /** - * @brief Set the jump force object. - * - * @param[in] new_jump_force The new force applied to the player to make him jump. - */ - void set_jump_force(float new_jump_force); + /** + * @brief Get the speed object. + * + * @return float The current speed of the player. + */ + float get_speed(); - /** - * @brief Get the jump force object. - * - * @return float The current force being applied to the player. - */ - float get_jump_force(); + /** + * @brief Set the jump force object. + * + * @param[in] new_jump_force The new force applied to the player to make him jump. + */ + void set_jump_force(float new_jump_force); - /** - * @brief Set the gravity object. - * - * @param[in] new_gravity The new gravity to apply to the player. - */ - void set_gravity(float new_gravity); + /** + * @brief Get the jump force object. + * + * @return float The current force being applied to the player. + */ + float get_jump_force(); - /** - * @brief Get the gravity object. - * - * @return float The current gravity applied to the player. - */ - float get_gravity(); + /** + * @brief Set the gravity object. + * + * @param[in] new_gravity The new gravity to apply to the player. + */ + void set_gravity(float new_gravity); - /** - * @brief Set the run speed object. - * - * @param[in] new_run_speed The new speed for running. - */ - void set_run_speed(float new_run_speed); + /** + * @brief Get the gravity object. + * + * @return float The current gravity applied to the player. + */ + float get_gravity(); - /** - * @brief Get the run speed object. - * - * @return float The current run speed of the player. - */ - float get_run_speed(); + /** + * @brief Set the run speed object. + * + * @param[in] new_run_speed The new speed for running. + */ + void set_run_speed(float new_run_speed); - /** - * @brief This signal is called when the player moves. - * @details The jump action is not included in this signal, just moving left or right. - * - * @param[in] position The new position of the player. - */ - void _on_Player_player_moved(Vector2 position); - }; + /** + * @brief Get the run speed object. + * + * @return float The current run speed of the player. + */ + float get_run_speed(); + + void set_double_jump(bool double_jump); + bool get_double_jump(); + + void set_velocity(Vector2 velocity); + Vector2 get_velocity(); + }; + } } #endif diff --git a/src/player/states/PlayerFall.cpp b/src/player/states/PlayerFall.cpp new file mode 100644 index 0000000..c3e6ff4 --- /dev/null +++ b/src/player/states/PlayerFall.cpp @@ -0,0 +1,78 @@ +#include "player/states/PlayerFall.h" +#include "player/Player.h" + +using namespace godot; +using namespace player; + +void PlayerFall::_register_methods() +{ + register_method("_state_enter", &PlayerFall::_state_enter); + register_method("_state_exit", &PlayerFall::_state_exit); + register_method("_physics_process", &PlayerFall::_physics_process); +} + +PlayerFall::PlayerFall() +{ +} + +PlayerFall::~PlayerFall() +{ +} + +void PlayerFall::_init() +{ + _input = Input::get_singleton(); +} + +void PlayerFall::_state_enter() +{ + animated_sprite = get_parent()->get_node("AnimatedSprite"); + animated_sprite->stop(); + animated_sprite->set_animation("air"); +} + +void PlayerFall::_state_exit() +{ + animated_sprite->set_animation("move"); + animated_sprite->set_frame(1); +} + +void PlayerFall::_physics_process(float delta) +{ + auto parent = Object::cast_to(get_parent()); + + if (parent->is_on_floor()) + { + get_state_machine()->change("Move"); + return; + } + + auto current_speed = parent->get_speed(); + auto velocity = parent->get_velocity(); + velocity.x = 0; + if (_input->is_action_pressed("run")) + { + current_speed *= parent->get_run_speed(); + } + + if (_input->is_action_pressed("right")) + { + velocity.x += current_speed; + } + + if (_input->is_action_pressed("left")) + { + velocity.x += -current_speed; + } + + if (velocity.x > 0) + { + animated_sprite->set_flip_h(true); + } + else if (velocity.x < 0) + { + animated_sprite->set_flip_h(false); + } + + parent->set_velocity(velocity); +} diff --git a/src/player/states/PlayerFall.h b/src/player/states/PlayerFall.h new file mode 100644 index 0000000..4fcbf83 --- /dev/null +++ b/src/player/states/PlayerFall.h @@ -0,0 +1,44 @@ +#ifndef JUEGO_PLAYER_FALL_H +#define JUEGO_PLAYER_FALL_H + +#include "state_machine/State.h" + +#include +#include +#include + +namespace godot +{ + namespace player + { + class PlayerFall : public State + { + GODOT_CLASS(PlayerFall, State) + + private: + Input *_input; + AnimatedSprite *animated_sprite; + + public: + static void _register_methods(); + + PlayerFall(); + + ~PlayerFall(); + + /** + * @brief Initialize the class from Godot. + * @details This method is called just once when the Godot engine connects to the instance of the class. + */ + void _init(); + + void _state_enter(); + + void _state_exit(); + + void _physics_process(float delta); + }; + } +} + +#endif diff --git a/src/player/states/PlayerIdle.cpp b/src/player/states/PlayerIdle.cpp new file mode 100644 index 0000000..026b5cf --- /dev/null +++ b/src/player/states/PlayerIdle.cpp @@ -0,0 +1,65 @@ +#include "player/states/PlayerIdle.h" +#include "player/Player.h" + +using namespace godot; +using namespace player; + +void PlayerIdle::_register_methods() +{ + register_method("_state_enter", &PlayerIdle::_state_enter); + register_method("_state_exit", &PlayerIdle::_state_exit); + register_method("_physics_process", &PlayerIdle::_physics_process); +} + +PlayerIdle::PlayerIdle() +{ +} + +PlayerIdle::~PlayerIdle() +{ +} + +void PlayerIdle::_init() +{ + _input = Input::get_singleton(); +} + +void PlayerIdle::_state_enter() +{ + animated_sprite = get_parent()->get_node("AnimatedSprite"); + animated_sprite->stop(); + animated_sprite->set_animation("idle"); +} + +void PlayerIdle::_state_exit() +{ +} + +void PlayerIdle::_physics_process(float delta) +{ + auto parent = Object::cast_to(get_parent()); + + if (_input->is_action_pressed("right")) + { + get_state_machine()->change("Move"); + return; + } + + if (_input->is_action_pressed("left")) + { + get_state_machine()->change("Move"); + return; + } + + if (_input->is_action_just_pressed("jump")) + { + get_state_machine()->change("Jump"); + return; + } + + if (!parent->is_on_floor()) + { + get_state_machine()->change("Fall"); + return; + } +} diff --git a/src/player/states/PlayerIdle.h b/src/player/states/PlayerIdle.h new file mode 100644 index 0000000..631aef4 --- /dev/null +++ b/src/player/states/PlayerIdle.h @@ -0,0 +1,45 @@ +#ifndef JUEGO_PLAYER_IDLE_H +#define JUEGO_PLAYER_IDLE_H + +#include "state_machine/State.h" + +#include +#include +#include +#include + +namespace godot +{ + namespace player + { + class PlayerIdle : public State + { + GODOT_CLASS(PlayerIdle, State) + + private: + Input *_input; + AnimatedSprite *animated_sprite; + + public: + static void _register_methods(); + + PlayerIdle(); + + ~PlayerIdle(); + + /** + * @brief Initialize the class from Godot. + * @details This method is called just once when the Godot engine connects to the instance of the class. + */ + void _init(); + + void _state_enter(); + + void _state_exit(); + + void _physics_process(float delta); + }; + } +} + +#endif diff --git a/src/player/states/PlayerJump.cpp b/src/player/states/PlayerJump.cpp new file mode 100644 index 0000000..8255e1b --- /dev/null +++ b/src/player/states/PlayerJump.cpp @@ -0,0 +1,105 @@ +#include "player/states/PlayerJump.h" +#include "player/Player.h" + +using namespace godot; +using namespace player; + +void PlayerJump::_register_methods() +{ + register_method("_state_enter", &PlayerJump::_state_enter); + register_method("_state_exit", &PlayerJump::_state_exit); + register_method("_physics_process", &PlayerJump::_physics_process); +} + +PlayerJump::PlayerJump() +{ +} + +PlayerJump::~PlayerJump() +{ +} + +void PlayerJump::_init() +{ + _input = Input::get_singleton(); +} + +void PlayerJump::_state_enter(const String state) +{ + animated_sprite = get_parent()->get_node("AnimatedSprite"); + animated_sprite->stop(); + animated_sprite->set_animation("air"); + + if (state == "Jump") + { + double_jumped = true; + } + else + { + double_jumped = false; + } + + auto parent = Object::cast_to(get_parent()); + auto velocity = parent->get_velocity(); + velocity.y = -parent->get_jump_force(); + parent->set_velocity(velocity); +} + +void PlayerJump::_state_exit() +{ + animated_sprite->set_animation("move"); + animated_sprite->set_frame(1); +} + +void PlayerJump::_physics_process(float delta) +{ + auto parent = Object::cast_to(get_parent()); + if (parent->is_on_floor()) + { + get_state_machine()->change("Move"); + return; + } + + auto current_speed = parent->get_speed(); + auto velocity = parent->get_velocity(); + velocity.x = 0; + if (_input->is_action_pressed("run")) + { + current_speed *= parent->get_run_speed(); + } + + if (_input->is_action_pressed("right")) + { + velocity.x += current_speed; + } + + if (_input->is_action_pressed("left")) + { + velocity.x += -current_speed; + } + + if (_input->is_action_just_released("jump")) + { + if (velocity.y < -100) + { + velocity.y = -100; + } + } + + if (parent->get_double_jump() && !double_jumped && _input->is_action_just_pressed("jump")) + { + get_state_machine()->change("Jump"); + return; + } + + if (velocity.x > 0) + { + animated_sprite->set_flip_h(true); + } + else if (velocity.x < 0) + { + animated_sprite->set_flip_h(false); + } + + parent->set_velocity(velocity); +} diff --git a/src/player/states/PlayerJump.h b/src/player/states/PlayerJump.h new file mode 100644 index 0000000..7458832 --- /dev/null +++ b/src/player/states/PlayerJump.h @@ -0,0 +1,45 @@ +#ifndef JUEGO_PLAYER_JUMP_H +#define JUEGO_PLAYER_JUMP_H + +#include "state_machine/State.h" + +#include +#include +#include + +namespace godot +{ + namespace player + { + class PlayerJump : public State + { + GODOT_CLASS(PlayerJump, State) + + private: + Input *_input; + AnimatedSprite *animated_sprite; + bool double_jumped; + + public: + static void _register_methods(); + + PlayerJump(); + + ~PlayerJump(); + + /** + * @brief Initialize the class from Godot. + * @details This method is called just once when the Godot engine connects to the instance of the class. + */ + void _init(); + + void _state_enter(const String state); + + void _state_exit(); + + void _physics_process(float delta); + }; + } +} + +#endif diff --git a/src/player/states/PlayerMove.cpp b/src/player/states/PlayerMove.cpp new file mode 100644 index 0000000..787db1d --- /dev/null +++ b/src/player/states/PlayerMove.cpp @@ -0,0 +1,94 @@ +#include "player/states/PlayerMove.h" +#include "player/Player.h" + +using namespace godot; +using namespace player; + +void PlayerMove::_register_methods() +{ + register_method("_state_enter", &PlayerMove::_state_enter); + register_method("_state_exit", &PlayerMove::_state_exit); + register_method("_physics_process", &PlayerMove::_physics_process); +} + +PlayerMove::PlayerMove() +{ +} + +PlayerMove::~PlayerMove() +{ +} + +void PlayerMove::_init() +{ + _input = Input::get_singleton(); +} + +void PlayerMove::_state_enter(String state, Array args) +{ + animated_sprite = get_parent()->get_node("AnimatedSprite"); + animated_sprite->set_animation("move"); + animated_sprite->play(); +} + +void PlayerMove::_state_exit() +{ +} + +void PlayerMove::_physics_process(float delta) +{ + auto parent = Object::cast_to(get_parent()); + + auto direction_pressed = false; + + auto current_speed = parent->get_speed(); + auto velocity = parent->get_velocity(); + velocity.x = 0; + if (_input->is_action_pressed("run")) + { + current_speed *= parent->get_run_speed(); + } + + if (_input->is_action_pressed("right")) + { + direction_pressed = true; + velocity.x += current_speed; + } + + if (_input->is_action_pressed("left")) + { + direction_pressed = true; + velocity.x += -current_speed; + } + + if (_input->is_action_just_pressed("jump")) + { + get_state_machine()->change("Jump"); + return; + } + + if (velocity.x > 0) + { + animated_sprite->set_flip_h(true); + } + else if (velocity.x < 0) + { + animated_sprite->set_flip_h(false); + } + else + { + if (!direction_pressed) + { + get_state_machine()->change("Idle"); + } + return; + } + + parent->set_velocity(velocity); + + if (!parent->is_on_floor()) + { + get_state_machine()->change("Fall"); + return; + } +} diff --git a/src/player/states/PlayerMove.h b/src/player/states/PlayerMove.h new file mode 100644 index 0000000..a41e6d4 --- /dev/null +++ b/src/player/states/PlayerMove.h @@ -0,0 +1,46 @@ +#ifndef JUEGO_PLAYER_MOVE_H +#define JUEGO_PLAYER_MOVE_H + +#include "state_machine/State.h" + +#include +#include +#include + +namespace godot +{ + namespace player + { + class PlayerMove : public State + { + GODOT_CLASS(PlayerMove, State) + + private: + Input *_input; + AnimatedSprite *animated_sprite; + + public: + static void _register_methods(); + + PlayerMove(); + + ~PlayerMove(); + + /** + * @brief Initialize the class from Godot. + * @details This method is called just once when the Godot engine connects to the instance of the class. + */ + void _init(); + + void _state_enter(String state, Array args); + + void _state_exit(); + + void _physics_process(float delta); + + Vector2 move_player(Vector2 velocity); + }; + } +} + +#endif diff --git a/src/state_machine/State.cpp b/src/state_machine/State.cpp new file mode 100644 index 0000000..6e53a52 --- /dev/null +++ b/src/state_machine/State.cpp @@ -0,0 +1,54 @@ +#include "State.h" + +using namespace godot; + +void State::_register_methods() +{ + register_method("set_parent", &State::set_parent); + register_method("get_parent", &State::get_parent); + register_method("set_state_machine", &State::set_state_machine); + register_method("_state_enter", &State::_state_enter); + register_method("_state_exit", &State::_state_exit); +} + +State::State() +{ +} + +State::~State() +{ +} + +void State::_init() +{ +} + +void State::_state_enter(const String state, const Array args) +{ + WARN_PRINT("State " + state + " is missing its _state_enter method!"); +} + +void State::_state_exit(const String state, const Array args) +{ + WARN_PRINT("State " + state + " is missing its _state_exit method!"); +} + +void State::set_parent(Node *new_parent) +{ + parent = new_parent; +} + +Node *State::get_parent() +{ + return parent; +} + +void State::set_state_machine(StateMachine *new_state_machine) +{ + state_machine = new_state_machine; +} + +StateMachine *State::get_state_machine() +{ + return state_machine; +} diff --git a/src/state_machine/State.h b/src/state_machine/State.h new file mode 100644 index 0000000..5ae0db8 --- /dev/null +++ b/src/state_machine/State.h @@ -0,0 +1,46 @@ +#ifndef JUEGO_STATE_H +#define JUEGO_STATE_H + +#include "StateMachine.h" + +#include +#include + +namespace godot +{ + class State : public StateMachine + { + GODOT_CLASS(State, Node) + + private: + StateMachine *state_machine; + + public: + Node *parent; + static void _register_methods(); + + State(); + + ~State(); + + /** + * @brief Initialize the class from Godot. + * @details This method is called just once when the Godot engine connects to the instance of the class. + */ + virtual void _init(); + + virtual void _state_enter(const String state, const Array args = Array()); + + virtual void _state_exit(const String state, const Array args = Array()); + + virtual void set_parent(Node *new_parent) final; + + virtual Node *get_parent() final; + + virtual void set_state_machine(StateMachine *new_state_machine) final; + + virtual StateMachine *get_state_machine() final; + }; +} + +#endif diff --git a/src/state_machine/StateMachine.cpp b/src/state_machine/StateMachine.cpp new file mode 100644 index 0000000..200883b --- /dev/null +++ b/src/state_machine/StateMachine.cpp @@ -0,0 +1,208 @@ +#include "StateMachine.h" +#include "State.h" + +using namespace godot; + +void StateMachine::_register_methods() +{ + register_method("_ready", &StateMachine::_ready); + register_method("_on_StateMachine_tree_entered", &StateMachine::_on_StateMachine_tree_entered); + register_method("_on_StateMachine_tree_exiting", &StateMachine::_on_StateMachine_tree_exiting); + register_property("default_state", &StateMachine::set_default_state, &StateMachine::get_default_state, String()); + register_property("debug", &StateMachine::set_debug, &StateMachine::get_debug, false); + register_signal("state_entered", "state", GODOT_VARIANT_TYPE_STRING); + register_signal("state_exited", "state", GODOT_VARIANT_TYPE_STRING); + register_signal("state_restarted", "state", GODOT_VARIANT_TYPE_STRING); +} + +StateMachine::StateMachine() +{ +} + +StateMachine::~StateMachine() +{ +} + +void StateMachine::_init() +{ + set_default_state(String()); + set_debug(false); +} + +void StateMachine::_ready() +{ + connect("tree_entered", this, "_on_StateMachine_tree_entered"); + connect("tree_exiting", this, "_on_StateMachine_tree_exiting"); + parent = get_parent(); + set_current_state(get_default_state()); + setup(); +} + +void StateMachine::setup() +{ + auto children = get_children(); + + if (get_current_state() == "") + { + if (children.size() > 0) + { + WARN_PRINT("State machine doesn't have a default state set, using first child!"); + auto child = Object::cast_to(children[0].operator Object*()); + set_current_state(child->get_name()); + } + else + { + ERR_PRINT("State machine doesn't have a default state set and has no child states!"); + return; + } + } + + for (uint8_t i = 0; i < children.size(); i++) + { + auto child = Object::cast_to(children[i].operator Object*()); + add_state(child->get_name(), child); + + child->call("set_state_machine", this); + + child->call("set_parent", parent); + + if (child->get_name() != get_current_state()) + { + this->remove_child(child); + } + } + + this->call("_state_enter", get_current_state()); +} + +void StateMachine::add_state(const String state, Node *child) +{ + states[state] = child; +} + +bool StateMachine::is_current(const String state) +{ + if (get_current_state() == "") + { + return false; + } + else + { + return get_current_state() == state; + } +} + +bool StateMachine::has(const String state) +{ + return states.has(state); +} + +void StateMachine::restart(const String state, const Array& args) +{ + this->call("_state_exit", state, args); + this->call("_state_enter", state, args); + this->emit_signal("state_restarted", get_current_state()); +} + +void StateMachine::change(const String state, const Array &args) +{ + if (is_current(state)) + { + return this->restart(state, args); + } + + auto previous_state = get_current_state(); + auto exiting = this->call("_state_exit", state, args); + + if (get_current_state() != "") + { + auto child = Object::cast_to(states[get_current_state()].operator Object*()); + if (child != nullptr) + { + this->remove_child(child); + } + this->emit_signal("state_exited", get_current_state()); + if (debug) + { + Godot::print(get_current_state() + " exited!"); + } + } + + set_current_state(state); + auto child = Object::cast_to(states[get_current_state()].operator Object*()); + this->add_child(child); + + this->call("_state_enter", previous_state, args); + this->emit_signal("state_entered", get_current_state()); + if (debug) + { + Godot::print(get_current_state() + " entered!"); + } +} + +Variant StateMachine::call(const String method, const Array &args) +{ + auto node = Object::cast_to(states[get_current_state()].operator Object*()); + if (node != nullptr) + { + return node->call(method, args); + } + return Variant(); +} + +Variant StateMachine::_call(const String method, const Array &args) +{ + return this->call(method, args); +} + +void StateMachine::set_default_state(const String new_default_state) +{ + default_state = new_default_state; +} + +String StateMachine::get_default_state() +{ + return default_state; +} + +void StateMachine::set_current_state(const String new_current_sate) +{ + current_state = new_current_sate; +} + +String StateMachine::get_current_state() +{ + return current_state; +} + +void StateMachine::set_debug(bool debug) +{ + this->debug = debug; +} + +bool StateMachine::get_debug() +{ + return this->debug; +} + +void StateMachine::_on_StateMachine_tree_entered() +{ + setup(); +} + +void StateMachine::_on_StateMachine_tree_exiting() +{ + auto keys = states.keys(); + for (uint8_t i = 0; i < keys.size(); i++) + { + auto child = Object::cast_to(states[keys[i]].operator Object*()); + if (child != nullptr) + { + auto children = get_children(); + if (!children.has(child)) + { + this->add_child(child); + } + } + } +} diff --git a/src/state_machine/StateMachine.h b/src/state_machine/StateMachine.h new file mode 100644 index 0000000..66920e3 --- /dev/null +++ b/src/state_machine/StateMachine.h @@ -0,0 +1,95 @@ +#ifndef JUEGO_STATE_MACHINE_H +#define JUEGO_STATE_MACHINE_H + +#include +#include + +namespace godot +{ + class StateMachine : public Node + { + GODOT_CLASS(StateMachine, Node) + + private: + Node *parent; + String default_state; + bool debug; + String current_state; + Dictionary states; + + void add_state(const String state, Node *child); + + public: + static void _register_methods(); + + StateMachine(); + + ~StateMachine(); + + /** + * @brief Initialize the class from Godot. + * @details This method is called just once when the Godot engine connects to the instance of the class. + */ + void _init(); + + /** + * @brief Code to be run when ready. + * @details This method is run when all the children of this node are ready. + */ + void _ready(); + + void setup(); + + bool is_current(); + + bool is_current(const String state); + + bool has(const String state); + + void restart(const String state, const Array& args = Array()); + + void change(const String state, const Array &args = Array()); + + Variant call(const String method, const Array &args = Array()); + + Variant _call(const String method, const Array &args = Array()); + + template Variant restart(Args ...args) + { + return restart(Array::make(args...)); + } + + template Variant change(const String state, Args ...args) + { + return change(state, Array::make(args...)); + } + + template Variant call(const String method, Args ...args) + { + return call(method, Array::make(args...)); + } + + template Variant _call(const String method, Args ...args) + { + return _call(method, Array::make(args...)); + } + + void set_default_state(const String new_default_state); + + String get_default_state(); + + void set_debug(bool debug); + + bool get_debug(); + + void set_current_state(const String new_current_state); + + String get_current_state(); + + void _on_StateMachine_tree_entered(); + + void _on_StateMachine_tree_exiting(); + }; +} + +#endif From 219b277e5c43bcaf2b99c9c062af84842ce7a3e0 Mon Sep 17 00:00:00 2001 From: Chris Cromer Date: Tue, 12 Apr 2022 11:33:22 -0400 Subject: [PATCH 16/42] some cleanup of the code --- src/Main.cpp | 20 +++++++++---------- src/Main.h | 12 +++++------ src/player/Player.cpp | 32 +++++++++++++++--------------- src/player/Player.h | 20 +++++++++---------- src/state_machine/State.cpp | 10 +++++----- src/state_machine/State.h | 4 ++-- src/state_machine/StateMachine.cpp | 12 +++++------ src/state_machine/StateMachine.h | 4 ++-- 8 files changed, 57 insertions(+), 57 deletions(-) diff --git a/src/Main.cpp b/src/Main.cpp index ef0fe55..387ff6e 100644 --- a/src/Main.cpp +++ b/src/Main.cpp @@ -55,39 +55,39 @@ void Main::_physics_process(float delta) } } -void Main::set_full_screen(bool new_full_screen) +void Main::set_full_screen(bool full_screen) { - full_screen = new_full_screen; + this->full_screen = full_screen; } bool Main::get_full_screen() { - return full_screen; + return this->full_screen; } -void Main::set_window_size(Vector2 new_window_size) +void Main::set_window_size(Vector2 window_size) { - window_size = new_window_size; + this-> window_size = window_size; } Vector2 Main::get_window_size() { - return window_size; + return this->window_size; } -void Main::set_launch_screen(int8_t new_launch_screen) +void Main::set_launch_screen(int8_t launch_screen) { - launch_screen = new_launch_screen; + this->launch_screen = launch_screen; } int8_t Main::get_launch_screen() { - if (launch_screen == -1) + if (this->launch_screen == -1) { return _os->get_current_screen(); } else { - return launch_screen; + return this->launch_screen; } } diff --git a/src/Main.h b/src/Main.h index 3a65398..af61ec8 100644 --- a/src/Main.h +++ b/src/Main.h @@ -89,9 +89,9 @@ namespace godot /** * @brief Set the full screen object. * - * @param[in] new_full_screen The new full screen state. + * @param[in] full_screen The new full screen state. */ - void set_full_screen(bool new_full_screen); + void set_full_screen(bool full_screen); /** * @brief Get the full screen object. @@ -104,9 +104,9 @@ namespace godot /** * @brief Set the window size object. * - * @param[in] new_window_size The new window size. + * @param[in] window_size The new window size. */ - void set_window_size(Vector2 new_window_size); + void set_window_size(Vector2 window_size); /** * @brief Get the window size object. @@ -118,9 +118,9 @@ namespace godot /** * @brief Set the launch screen object. * - * @param[in] new_launch_screen The launch screen to use. + * @param[in] launch_screen The launch screen to use. */ - void set_launch_screen(int8_t new_launch_screen); + void set_launch_screen(int8_t launch_screen); /** * @brief Get the launch screen object. diff --git a/src/player/Player.cpp b/src/player/Player.cpp index 30c801d..843043b 100644 --- a/src/player/Player.cpp +++ b/src/player/Player.cpp @@ -1,4 +1,4 @@ -#include "Player.h" +#include "player/Player.h" #include #include @@ -112,54 +112,54 @@ void Player::_physics_process(float delta) } } -void Player::set_sprite_frames(Ref new_sprite_frames) +void Player::set_sprite_frames(Ref sprite_frames) { - sprite_frames = new_sprite_frames; + this->sprite_frames = sprite_frames; } Ref Player::get_sprite_frames() { - return sprite_frames; + return this->sprite_frames; } -void Player::set_speed(float new_speed) +void Player::set_speed(float speed) { - speed = new_speed; + this->speed = speed; } float Player::get_speed() { - return speed; + return this->speed; } -void Player::set_jump_force(float new_jump_force) +void Player::set_jump_force(float jump_force) { - jump_force = new_jump_force; + this->jump_force = jump_force; } float Player::get_jump_force() { - return jump_force; + return this->jump_force; } -void Player::set_gravity(float new_gravity) +void Player::set_gravity(float gravity) { - gravity = new_gravity; + this->gravity = gravity; } float Player::get_gravity() { - return gravity; + return this->gravity; } -void Player::set_run_speed(float new_run_speed) +void Player::set_run_speed(float run_speed) { - run_speed = new_run_speed; + this->run_speed = run_speed; } float Player::get_run_speed() { - return run_speed; + return this->run_speed; } void Player::set_double_jump(bool double_jump) diff --git a/src/player/Player.h b/src/player/Player.h index 67ff8c4..78bc986 100644 --- a/src/player/Player.h +++ b/src/player/Player.h @@ -112,9 +112,9 @@ namespace godot /** * @brief Set the sprite frames object. * - * @param[in] new_sprite_frames The new sprite frame. + * @param[in] sprite_frames The new sprite frame. */ - void set_sprite_frames(Ref new_sprite_frames); + void set_sprite_frames(Ref sprite_frames); /** * @brief Get the sprite frames object. @@ -126,9 +126,9 @@ namespace godot /** * @brief Set the speed object. * - * @param[in] new_speed The new speed. + * @param[in] speed The new speed. */ - void set_speed(float new_speed); + void set_speed(float speed); /** * @brief Get the speed object. @@ -140,9 +140,9 @@ namespace godot /** * @brief Set the jump force object. * - * @param[in] new_jump_force The new force applied to the player to make him jump. + * @param[in] jump_force The new force applied to the player to make him jump. */ - void set_jump_force(float new_jump_force); + void set_jump_force(float jump_force); /** * @brief Get the jump force object. @@ -154,9 +154,9 @@ namespace godot /** * @brief Set the gravity object. * - * @param[in] new_gravity The new gravity to apply to the player. + * @param[in] gravity The new gravity to apply to the player. */ - void set_gravity(float new_gravity); + void set_gravity(float gravity); /** * @brief Get the gravity object. @@ -168,9 +168,9 @@ namespace godot /** * @brief Set the run speed object. * - * @param[in] new_run_speed The new speed for running. + * @param[in] run_speed The new speed for running. */ - void set_run_speed(float new_run_speed); + void set_run_speed(float run_speed); /** * @brief Get the run speed object. diff --git a/src/state_machine/State.cpp b/src/state_machine/State.cpp index 6e53a52..24d8b6d 100644 --- a/src/state_machine/State.cpp +++ b/src/state_machine/State.cpp @@ -33,9 +33,9 @@ void State::_state_exit(const String state, const Array args) WARN_PRINT("State " + state + " is missing its _state_exit method!"); } -void State::set_parent(Node *new_parent) +void State::set_parent(Node *parent) { - parent = new_parent; + this->parent = parent; } Node *State::get_parent() @@ -43,12 +43,12 @@ Node *State::get_parent() return parent; } -void State::set_state_machine(StateMachine *new_state_machine) +void State::set_state_machine(StateMachine *state_machine) { - state_machine = new_state_machine; + this->state_machine = state_machine; } StateMachine *State::get_state_machine() { - return state_machine; + return this->state_machine; } diff --git a/src/state_machine/State.h b/src/state_machine/State.h index 5ae0db8..bd8d787 100644 --- a/src/state_machine/State.h +++ b/src/state_machine/State.h @@ -33,11 +33,11 @@ namespace godot virtual void _state_exit(const String state, const Array args = Array()); - virtual void set_parent(Node *new_parent) final; + virtual void set_parent(Node *parent) final; virtual Node *get_parent() final; - virtual void set_state_machine(StateMachine *new_state_machine) final; + virtual void set_state_machine(StateMachine *state_machine) final; virtual StateMachine *get_state_machine() final; }; diff --git a/src/state_machine/StateMachine.cpp b/src/state_machine/StateMachine.cpp index 200883b..6556431 100644 --- a/src/state_machine/StateMachine.cpp +++ b/src/state_machine/StateMachine.cpp @@ -155,24 +155,24 @@ Variant StateMachine::_call(const String method, const Array &args) return this->call(method, args); } -void StateMachine::set_default_state(const String new_default_state) +void StateMachine::set_default_state(const String default_state) { - default_state = new_default_state; + this->default_state = default_state; } String StateMachine::get_default_state() { - return default_state; + return this->default_state; } -void StateMachine::set_current_state(const String new_current_sate) +void StateMachine::set_current_state(const String current_sate) { - current_state = new_current_sate; + this->current_state = current_sate; } String StateMachine::get_current_state() { - return current_state; + return this->current_state; } void StateMachine::set_debug(bool debug) diff --git a/src/state_machine/StateMachine.h b/src/state_machine/StateMachine.h index 66920e3..5f0cea5 100644 --- a/src/state_machine/StateMachine.h +++ b/src/state_machine/StateMachine.h @@ -74,7 +74,7 @@ namespace godot return _call(method, Array::make(args...)); } - void set_default_state(const String new_default_state); + void set_default_state(const String default_state); String get_default_state(); @@ -82,7 +82,7 @@ namespace godot bool get_debug(); - void set_current_state(const String new_current_state); + void set_current_state(const String current_state); String get_current_state(); From 1c24ba0cd15a5d8e64ff8594e2a85cbeefedfa03 Mon Sep 17 00:00:00 2001 From: Chris Cromer Date: Wed, 13 Apr 2022 00:59:23 -0400 Subject: [PATCH 17/42] add documentation --- src/Main.h | 30 +++++ src/godot.cpp | 12 ++ src/player/Player.h | 73 ++++++++++- src/player/states/PlayerFall.h | 45 +++++++ src/player/states/PlayerIdle.h | 39 ++++++ src/player/states/PlayerJump.h | 46 +++++++ src/player/states/PlayerMove.cpp | 2 +- src/player/states/PlayerMove.h | 43 +++++- src/state_machine/State.cpp | 2 +- src/state_machine/State.h | 60 ++++++++- src/state_machine/StateMachine.cpp | 4 +- src/state_machine/StateMachine.h | 203 ++++++++++++++++++++++++++--- 12 files changed, 529 insertions(+), 30 deletions(-) diff --git a/src/Main.h b/src/Main.h index af61ec8..4d86783 100644 --- a/src/Main.h +++ b/src/Main.h @@ -8,18 +8,37 @@ /** * @brief This is the godot namespace for all the code included in the library. + * * @details This namespace is used a prefix when the Godot engine looks for classes, methods, and properties. */ namespace godot { + /** + * @brief This namespace houses some global variables and the main class. + * + */ namespace main { + /** + * @brief The default value for if the game should start in full screen. + * + */ const bool full_screen = false; + /** + * @brief The default resolution for the game window. + * + */ const Vector2 window_size = Vector2(1280, 720); + /** + * @brief The default screen the the game should open on. + * + * @details -1 opens it on the currently active screen. And 0 and above are the screens to use. + */ const int8_t launch_screen = -1; /** * @brief This class controls the Main node. + * * @details The main node is responsible for controling the window and the game iteself is a child of it. */ class Main : public Node @@ -29,57 +48,68 @@ namespace godot private: /** * @brief OS singleton. + * */ OS *_os; /** * @brief Input singleton. + * */ Input *_input; /** * @brief If the window is full screen or not. + * */ bool full_screen; /** * @brief The size of the window. + * */ Vector2 window_size; /** * @brief The screen to launch the game on. + * */ int8_t launch_screen; public: /** * @brief This method registers classes with Godot. + * * @details This method registers methods, properties, and signals with the Godot engine. */ static void _register_methods(); /** * @brief Construct a new Main object. + * */ Main(); /** * @brief Destroy the Main object. + * */ ~Main(); /** * @brief Initialize the class from Godot. + * * @details This method is called just once when the Godot engine connects to the instance of the class. */ void _init(); /** * @brief Code to be run when ready. + * * @details This method is run when all the children of this node are ready. */ void _ready(); /** * @brief This class handles the physics processing. + * * @details Every delta time, this function is called to check for input and update positioning. * * @param[in] delta The difference in time that passed since the last call to this method. diff --git a/src/godot.cpp b/src/godot.cpp index b449e46..76e07ec 100644 --- a/src/godot.cpp +++ b/src/godot.cpp @@ -11,11 +11,19 @@ using namespace godot; +/** + * @brief This function connects the gdnative init function. + * + */ extern "C" void GDN_EXPORT godot_gdnative_init(godot_gdnative_init_options *o) { Godot::gdnative_init(o); } +/** + * @brief This function connects the gdnative terminate function. + * + */ extern "C" void GDN_EXPORT godot_gdnative_terminate(godot_gdnative_terminate_options *o) { // This next line is a workaround to fix bug: @@ -24,6 +32,10 @@ extern "C" void GDN_EXPORT godot_gdnative_terminate(godot_gdnative_terminate_opt Godot::gdnative_terminate(o); } +/** + * @brief This function connects the init methods in the classes to godot's gdnative. + * + */ extern "C" void GDN_EXPORT godot_nativescript_init(void *handle) { Godot::nativescript_init(handle); diff --git a/src/player/Player.h b/src/player/Player.h index 78bc986..fd2474a 100644 --- a/src/player/Player.h +++ b/src/player/Player.h @@ -10,21 +10,51 @@ /** * @brief This is the godot namespace for all the code included in the library. + * * @details This namespace is used a prefix when the Godot engine looks for classes, methods, and properties. */ namespace godot { + /** + * @brief This namespace contains the global variables related to the player and its states. + * + */ namespace player { + /** + * @brief The default sprite resource of the player. + * + */ const char player_sprite_frames[] = "res://characters/player/sprites/green.tres"; + /** + * @brief The default speed of the player. + * + */ const float speed = 60.0; + /** + * @brief The default jump force applied when jumping. + * + */ const float jump_force = 300.0; + /** + * @brief The default gravity applied to the player. + * + */ const float gravity = 9.81; + /** + * @brief The default run speed multiplier. + * + */ const float run_speed = 2.0; + /** + * @brief The default double jump activation state. + * + */ const bool double_jump = true; /** * @brief This class is used to control the player. + * * @details This class allows the player to move, run, and jump as well as controls the sprite displayed for those actions. */ class Player : public KinematicBody2D @@ -34,75 +64,93 @@ namespace godot private: /** * @brief ResourceLoader singleton. + * */ ResourceLoader *_resource_loader; /** * @brief The animated sprite connected to the KinematicBody2D. + * */ AnimatedSprite *animated_sprite; /** * @brief The sprite frames used in the animated sprite. + * */ Ref sprite_frames; /** * @brief The coins the player has collected. + * */ uint8_t coins; /** * @brief The velocity at which moves the player moves. + * */ Vector2 velocity; /** * @brief The speed that the player moves in. + * */ float speed; /** * @brief The force applied to the player when jumping. + * */ float jump_force; /** * @brief The gravity applied to the player. + * */ float gravity; /** * @brief The speed multiplier used to make the player move faster. + * */ float run_speed; - + /** + * @brief If double jump is enabled or not. + * + */ bool double_jump; public: /** * @brief This method registers classes with Godot. + * * @details This method registers methods, properties, and signals with the Godot engine. */ static void _register_methods(); /** * @brief Construct a new Player object. + * */ Player(); /** * @brief Destroy the Player object. + * */ ~Player(); /** * @brief Initialize the class from Godot. + * * @details This method is called just once when the Godot engine connects to the instance of the class. */ void _init(); /** * @brief Code to be run when ready. + * * @details This method is run when all the children of this node are ready. */ void _ready(); /** * @brief This class handles the physics processing. + * * @details Every delta time, this function is called to check for input and update positioning. * * @param[in] delta The difference in time that passed since the last call to this method. @@ -179,10 +227,33 @@ namespace godot */ float get_run_speed(); + /** + * @brief Set the double jump object. + * + * @param[in] double_jump The new double dump value. + */ void set_double_jump(bool double_jump); + + /** + * @brief Get the double jump object. + * + * @return true If double jump is enabled. + * @return false If double jump is disabled. + */ bool get_double_jump(); + /** + * @brief Set the velocity object. + * + * @param[in] velocity The new velocity of the player. + */ void set_velocity(Vector2 velocity); + + /** + * @brief Get the velocity object. + * + * @return Vector2 Returns the velocity of the player. + */ Vector2 get_velocity(); }; } diff --git a/src/player/states/PlayerFall.h b/src/player/states/PlayerFall.h index 4fcbf83..d53fd4f 100644 --- a/src/player/states/PlayerFall.h +++ b/src/player/states/PlayerFall.h @@ -7,35 +7,80 @@ #include #include +/** + * @brief This is the godot namespace for all the code included in the library. + * + * @details This namespace is used a prefix when the Godot engine looks for classes, methods, and properties. + */ namespace godot { namespace player { + /** + * @brief This class controls what happens when the player is in a falling state. + * + */ class PlayerFall : public State { GODOT_CLASS(PlayerFall, State) private: + /** + * @brief Input singleton. + * + */ Input *_input; + + /** + * @brief The animated sprite connected to the player. + * + */ AnimatedSprite *animated_sprite; public: + /** + * @brief This method registers classes with Godot. + * + * @details This method registers methods, properties, and signals with the Godot engine. + */ static void _register_methods(); + /** + * @brief Construct a new Player Fall object. + * + */ PlayerFall(); + /** + * @brief Destroy the Player Fall object. + * + */ ~PlayerFall(); /** * @brief Initialize the class from Godot. + * * @details This method is called just once when the Godot engine connects to the instance of the class. */ void _init(); + /** + * @brief Called when the fall state is entered. + * + */ void _state_enter(); + /** + * @brief Called when the fall state is exited. + * + */ void _state_exit(); + /** + * @brief The physics processed every delta time. + * + * @param[in] delta The time since the method was last run. + */ void _physics_process(float delta); }; } diff --git a/src/player/states/PlayerIdle.h b/src/player/states/PlayerIdle.h index 631aef4..76e4685 100644 --- a/src/player/states/PlayerIdle.h +++ b/src/player/states/PlayerIdle.h @@ -12,31 +12,70 @@ namespace godot { namespace player { + /** + * @brief This class controls what happens when the player is in the idle state. + * + */ class PlayerIdle : public State { GODOT_CLASS(PlayerIdle, State) private: + /** + * @brief Input singleton. + * + */ Input *_input; + /** + * @brief The animated sprite of the player. + * + */ AnimatedSprite *animated_sprite; public: + /** + * @brief This method registers classes with Godot. + * + * @details This method registers methods, properties, and signals with the Godot engine. + */ static void _register_methods(); + /** + * @brief Construct a new Player Idle object. + * + */ PlayerIdle(); + /** + * @brief Destroy the Player Idle object. + * + */ ~PlayerIdle(); /** * @brief Initialize the class from Godot. + * * @details This method is called just once when the Godot engine connects to the instance of the class. */ void _init(); + /** + * @brief Called when the idle state is entered. + * + */ void _state_enter(); + /** + * @brief Called when the idle state is exited. + * + */ void _state_exit(); + /** + * @brief The physics processed every delta time. + * + * @param[in] delta The time since the method was last run. + */ void _physics_process(float delta); }; } diff --git a/src/player/states/PlayerJump.h b/src/player/states/PlayerJump.h index 7458832..aee1059 100644 --- a/src/player/states/PlayerJump.h +++ b/src/player/states/PlayerJump.h @@ -11,32 +11,78 @@ namespace godot { namespace player { + /** + * @brief This class control what happens when the player is in the jump state. + * + */ class PlayerJump : public State { GODOT_CLASS(PlayerJump, State) private: + /** + * @brief Input singleton. + * + */ Input *_input; + /** + * @brief The animated sprite connected to the player. + * + */ AnimatedSprite *animated_sprite; + /** + * @brief If the player has already performed a double jump or not. + * + */ bool double_jumped; public: + /** + * @brief This method registers classes with Godot. + * + * @details This method registers methods, properties, and signals with the Godot engine. + */ static void _register_methods(); + /** + * @brief Construct a new Player Jump object. + * + */ PlayerJump(); + /** + * @brief Destroy the Player Jump object. + * + */ ~PlayerJump(); /** * @brief Initialize the class from Godot. + * * @details This method is called just once when the Godot engine connects to the instance of the class. */ void _init(); + /** + * @brief Called when the player enters the jump state. + * + * @details If the previous state was the jump state, a double jump was performed. + * + * @param[in] state The previous state before this one was entered. + */ void _state_enter(const String state); + /** + * @brief Called when the player exits the jump state. + * + */ void _state_exit(); + /** + * @brief The physics processed every delta time. + * + * @param[in] delta The time since the method was last run. + */ void _physics_process(float delta); }; } diff --git a/src/player/states/PlayerMove.cpp b/src/player/states/PlayerMove.cpp index 787db1d..77df13e 100644 --- a/src/player/states/PlayerMove.cpp +++ b/src/player/states/PlayerMove.cpp @@ -24,7 +24,7 @@ void PlayerMove::_init() _input = Input::get_singleton(); } -void PlayerMove::_state_enter(String state, Array args) +void PlayerMove::_state_enter() { animated_sprite = get_parent()->get_node("AnimatedSprite"); animated_sprite->set_animation("move"); diff --git a/src/player/states/PlayerMove.h b/src/player/states/PlayerMove.h index a41e6d4..0df3078 100644 --- a/src/player/states/PlayerMove.h +++ b/src/player/states/PlayerMove.h @@ -11,34 +11,71 @@ namespace godot { namespace player { + /** + * @brief This class controls what happens when the player is in the move state. + * + */ class PlayerMove : public State { GODOT_CLASS(PlayerMove, State) private: + /** + * @brief Input singleton. + * + */ Input *_input; + /** + * @brief The animated sprite of the player. + * + */ AnimatedSprite *animated_sprite; public: + /** + * @brief This method registers classes with Godot. + * + * @details This method registers methods, properties, and signals with the Godot engine. + */ static void _register_methods(); + /** + * @brief Construct a new Player Move object. + * + */ PlayerMove(); + /** + * @brief Destroy the Player Move object. + * + */ ~PlayerMove(); /** * @brief Initialize the class from Godot. + * * @details This method is called just once when the Godot engine connects to the instance of the class. */ void _init(); - void _state_enter(String state, Array args); + /** + * @brief Called when the player enters the move state. + * + */ + void _state_enter(); + /** + * @brief Called when the player exists the move state. + * + */ void _state_exit(); + /** + * @brief The physics processed every delta time. + * + * @param[in] delta The time since the method was last run. + */ void _physics_process(float delta); - - Vector2 move_player(Vector2 velocity); }; } } diff --git a/src/state_machine/State.cpp b/src/state_machine/State.cpp index 24d8b6d..29efa48 100644 --- a/src/state_machine/State.cpp +++ b/src/state_machine/State.cpp @@ -1,4 +1,4 @@ -#include "State.h" +#include "state_machine/State.h" using namespace godot; diff --git a/src/state_machine/State.h b/src/state_machine/State.h index bd8d787..46ebe38 100644 --- a/src/state_machine/State.h +++ b/src/state_machine/State.h @@ -8,37 +8,95 @@ namespace godot { + /** + * @brief This class provides a virtual template state that real states should extend from and override. + * + */ class State : public StateMachine { GODOT_CLASS(State, Node) private: + /** + * @brief The state's parent, this is the node 1 level above the state machine. + * + */ + Node *parent; + /** + * @brief The state machine itself, used to handle all state related work. + * + */ StateMachine *state_machine; public: - Node *parent; + /** + * @brief This method registers classes with Godot. + * + * @details This method registers methods, properties, and signals with the Godot engine. + */ static void _register_methods(); + /** + * @brief Construct a new State object. + * + */ State(); + /** + * @brief Destroy the State object. + * + */ ~State(); /** * @brief Initialize the class from Godot. + * * @details This method is called just once when the Godot engine connects to the instance of the class. */ virtual void _init(); + /** + * @brief This is called when a state is entered. + * + * @param[in] state This will contain the previous state. + * @param[in] args The arguments passed to the state. + */ virtual void _state_enter(const String state, const Array args = Array()); + /** + * @brief This is called when a state is exited. + * + * @param[in] state The state we are going to. + * @param[in] args The arguments passed to the state. + */ virtual void _state_exit(const String state, const Array args = Array()); + /** + * @brief Set the parent object. + * + * @param[in] parent The parent of the state. + */ virtual void set_parent(Node *parent) final; + /** + * @brief Get the parent object. + * + * @return Node* The parent of the state. + */ virtual Node *get_parent() final; + /** + * @brief Set the state machine object. + * + * @param[in] state_machine The state machine. + */ virtual void set_state_machine(StateMachine *state_machine) final; + /** + * @brief Get the state machine object. + * + * @return StateMachine* The state machine. + */ virtual StateMachine *get_state_machine() final; }; } diff --git a/src/state_machine/StateMachine.cpp b/src/state_machine/StateMachine.cpp index 6556431..4370842 100644 --- a/src/state_machine/StateMachine.cpp +++ b/src/state_machine/StateMachine.cpp @@ -1,5 +1,5 @@ -#include "StateMachine.h" -#include "State.h" +#include "state_machine/StateMachine.h" +#include "state_machine/State.h" using namespace godot; diff --git a/src/state_machine/StateMachine.h b/src/state_machine/StateMachine.h index 5f0cea5..02789ba 100644 --- a/src/state_machine/StateMachine.h +++ b/src/state_machine/StateMachine.h @@ -6,89 +6,250 @@ namespace godot { + /** + * @brief This class provides a finite state machine that can be used with any scene and node. + * + */ class StateMachine : public Node { GODOT_CLASS(StateMachine, Node) private: + /** + * @brief The parent node which is one level above the state machine. + * + */ Node *parent; + /** + * @brief The default state for the state machine to run. + * + * @details If this is not set, the state machine will try to run the first state node. + * If no state nodes are present, an error will be printed and the state machine will not work. + */ String default_state; + /** + * @brief If set to true the state machine will print a message showing when it enters or exits a state. + * + */ bool debug; + /** + * @brief The current state the machine is in. + * + */ String current_state; + /** + * @brief A list of the states in the state machine. + * + */ Dictionary states; + /** + * @brief This adds a state to the list of states in the state machine. + * + * @param[in] state The new state. + * @param[in] child The godot node which represents the state. + */ void add_state(const String state, Node *child); public: + /** + * @brief This method registers classes with Godot. + * + * @details This method registers methods, properties, and signals with the Godot engine. + */ static void _register_methods(); + /** + * @brief Construct a new State Machine object. + */ StateMachine(); + /** + * @brief Destroy the State Machine object. + */ ~StateMachine(); /** * @brief Initialize the class from Godot. + * * @details This method is called just once when the Godot engine connects to the instance of the class. */ void _init(); /** * @brief Code to be run when ready. + * * @details This method is run when all the children of this node are ready. */ void _ready(); + /** + * @brief This method will remove all no default states from the scene tree and start the default state. + * + */ void setup(); - bool is_current(); - + /** + * @brief Check if the given state is the current running state. + * + * @param[in] state The state to compare with the running state. + * @return true If the running state and given state are the same. + * @return false If the running state and given state are not the same. + */ bool is_current(const String state); + /** + * @brief Check if the state machine has a given state. + * + * @param[in] state The state to check for. + * @return true If the state exists. + * @return false If the state doesn't exist. + */ bool has(const String state); + /** + * @brief Restar the running state by calling its enter and exit methods. + * + * @param[in] state The state that is being restarted. + * @param[in] args The arguments to pass to the state on exit and enter. + */ void restart(const String state, const Array& args = Array()); + /** + * @brief Change to a different state. + * + * @details If the running state is the same as the state it will restart it. + * + * @param[in] state The state to change to. + * @param[in] args The arguments to pass to the exiting state and the entering state. + */ void change(const String state, const Array &args = Array()); + /** + * @brief Call a registered godot method in the class. + * + * @param[in] method The method name to call. + * @param[in] args The arguments to pass to the method. + * @return Variant Returns a Variant based off what the method returns. + */ Variant call(const String method, const Array &args = Array()); + /** + * @brief This method is to link up a signal call back. + * + * @param[in] method The method to call for the signal. + * @param[in] args The arguments to pass to the method. + * @return Variant Returns a Variant based off what the method returns. + */ Variant _call(const String method, const Array &args = Array()); - template Variant restart(Args ...args) + /** + * @brief Set the default state object. + * + * @param[in] default_state The new default state. + */ + void set_default_state(const String default_state); + + /** + * @brief Get the default state object. + * + * @return String The default state. + */ + String get_default_state(); + + /** + * @brief Set the debug object. + * + * @param[in] debug Whether or not to debug. + */ + void set_debug(bool debug); + + /** + * @brief Get the debug object. + * + * @return true If debugging is enabled. + * @return false If debugging is disabled. + */ + bool get_debug(); + + /** + * @brief Set the current state object. + * + * @param[in] current_state The current state that is running. + */ + void set_current_state(const String current_state); + + /** + * @brief Get the current state object. + * + * @return String The current running state. + */ + String get_current_state(); + + /** + * @brief This method is called when the signal tree_entered is emitted. + * + * @details This will run the setup method to prepare the state machine for use. + */ + void _on_StateMachine_tree_entered(); + + /** + * @brief This method is called when the signal tree_exiting is emitted. + * + * @details If the tree is in the exiting state readd all the removed state nodes to the scene tree. + * This is important because the memory won't be freed if they are no longer in the scene tree. + */ + void _on_StateMachine_tree_exiting(); + + /** + * @brief Restarts the running state. + * + * @tparam Args Variable number of arguments to pass to restart. + * @param[in] state The state being restarted. + * @param[in] args The arguments to pass when restarting. + */ + template void restart(const String state, Args ...args) { - return restart(Array::make(args...)); + return restart(state, Array::make(args...)); } - template Variant change(const String state, Args ...args) + /** + * @brief Changes to a new state. + * + * @tparam Args Variable number of arguments to pass when chaning states. + * @param[in] state The state to change to. + * @param[in] args The arguments to pass to the new state. + */ + template void change(const String state, Args ...args) { return change(state, Array::make(args...)); } + /** + * @brief Call a registered godot method in the class. + * + * @tparam Args The variable arguments to pass to the method. + * @param[in] method The method to call. + * @param[in] args The arguments to pass to it. + * @return Variant The Variant object returned by the method called. + */ template Variant call(const String method, Args ...args) { return call(method, Array::make(args...)); } + /** + * @brief This is used to connect a callback from a signal. + * + * @tparam Args The arguments to pass to the callback method. + * @param[in] method The method to call. + * @param[in] args The arguments to pass. + * @return Variant The Variant object returned by the method called. + */ template Variant _call(const String method, Args ...args) { return _call(method, Array::make(args...)); } - - void set_default_state(const String default_state); - - String get_default_state(); - - void set_debug(bool debug); - - bool get_debug(); - - void set_current_state(const String current_state); - - String get_current_state(); - - void _on_StateMachine_tree_entered(); - - void _on_StateMachine_tree_exiting(); }; } From 8bbf3942cdcb4887578a0fa9da612c91fc407338 Mon Sep 17 00:00:00 2001 From: Chris Cromer Date: Wed, 13 Apr 2022 01:10:40 -0400 Subject: [PATCH 18/42] fix incorrect gdnative resource --- godot/state_machine/State.gdns | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/godot/state_machine/State.gdns b/godot/state_machine/State.gdns index dad8e97..757946d 100644 --- a/godot/state_machine/State.gdns +++ b/godot/state_machine/State.gdns @@ -1,6 +1,6 @@ [gd_resource type="NativeScript" load_steps=2 format=2] -[ext_resource path="res://gdnative/libalai.tres" type="GDNativeLibrary" id=1] +[ext_resource path="res://gdnative/alai.tres" type="GDNativeLibrary" id=1] [resource] resource_name = "State" From 5a644d78c3c64140dcb77846388d74186a3a88f5 Mon Sep 17 00:00:00 2001 From: Chris Cromer Date: Wed, 13 Apr 2022 11:23:20 -0400 Subject: [PATCH 19/42] rename tiled file name --- ...juego.tiled-project => alai.tiled-project} | 0 godot/juego.tiled-session | 285 ------------------ 2 files changed, 285 deletions(-) rename godot/{juego.tiled-project => alai.tiled-project} (100%) delete mode 100644 godot/juego.tiled-session diff --git a/godot/juego.tiled-project b/godot/alai.tiled-project similarity index 100% rename from godot/juego.tiled-project rename to godot/alai.tiled-project diff --git a/godot/juego.tiled-session b/godot/juego.tiled-session deleted file mode 100644 index 9b2b07d..0000000 --- a/godot/juego.tiled-session +++ /dev/null @@ -1,285 +0,0 @@ -{ - "Map/SizeTest": { - "height": 4300, - "width": 2 - }, - "activeFile": "levels/level01.tmx", - "expandedProjectPaths": [ - "tilesets", - "levels", - ".", - "parallax" - ], - "exportAsImage.useCurrentScale": false, - "file.lastUsedOpenFilter": "All Files (*)", - "fileStates": { - "": { - "scaleInDock": 1 - }, - "#backgrounds": { - "scaleInDock": 1 - }, - "/home/cromer/projects/edx/games/azaraka/misc/new-graphics/tf_darkdimension_updated2020/RMMV/tf_dd_B_3.tsx": { - "scaleInDock": 1, - "scaleInEditor": 1 - }, - "/home/cromer/projects/edx/games/azaraka/misc/new-graphics/tf_darkdimension_updated2020/dd_waterfall_sheet.tsx": { - "scaleInDock": 1, - "scaleInEditor": 2 - }, - "/home/cromer/projects/edx/games/azaraka/misc/new-graphics/tf_darkdimension_updated2020/tf_darkdimension_sheet.tsx": { - "scaleInDock": 2, - "scaleInEditor": 2 - }, - "/home/cromer/projects/edx/games/azaraka/misc/new-graphics/tf_darkdimension_updated2020/untitled.tmx": { - "scale": 2, - "selectedLayer": 3, - "viewCenter": { - "x": 465.75, - "y": 233.5 - } - }, - "/home/cromer/tilemaps/Dungeon.tsx": { - "scaleInDock": 1, - "scaleInEditor": 1 - }, - "/home/cromer/tilemaps/Grassland.tsx": { - "scaleInDock": 1, - "scaleInEditor": 1 - }, - "/home/cromer/tilemaps/dungeon_entrance.tmx": { - "scale": 0.53140625, - "selectedLayer": 0, - "viewCenter": { - "x": 902.3228462216996, - "y": 825.1690679211997 - } - }, - "/home/cromer/tilemaps/untitled.tmx": { - "scale": 0.53140625, - "selectedLayer": 1, - "viewCenter": { - "x": 798.8238753307851, - "y": 798.8238753307851 - } - }, - "/mnt/data/godot/projects/Azaraka/maps/cloud_city.tsx": { - "scaleInDock": 0.5 - }, - "/mnt/data/godot/projects/Azaraka/maps/dungeon1.tmx": { - "scale": 0.75, - "selectedLayer": 0, - "viewCenter": { - "x": 1209.3333333333333, - "y": 672 - } - }, - "/mnt/data/godot/projects/Azaraka/maps/shadowset.tsx": { - "scaleInDock": 1 - }, - "/mnt/data/godot/projects/Azaraka/maps/terrain.tsx": { - "scaleInDock": 0.75 - }, - "/mnt/data/godot/projects/Azaraka/maps/worldmap.tmx": { - "scale": 0.03125, - "selectedLayer": 0, - "viewCenter": { - "x": 10496, - "y": 2592 - } - }, - "/mnt/data/godot/projects/Azaraka/maps/worldmap.tsx": { - "scaleInDock": 0.33 - }, - "/mnt/data/godot/projects/Platformer/asset/spritesheet_ground.tsx": { - "scaleInDock": 0.125, - "scaleInEditor": 0.75 - }, - "/mnt/data/godot/projects/Platformer/asset/world.tmx": { - "scale": 0.5, - "selectedLayer": 0, - "viewCenter": { - "x": 1326, - "y": 1210 - } - }, - "/mnt/data/godot/projects/Platformer/asset/world1.tmx": { - "scale": 0.5714843749999999, - "selectedLayer": 0, - "viewCenter": { - "x": 640.4374572795626, - "y": 640.4374572795626 - } - }, - "/mnt/data/projects/edx/games/azaraka/maps/tilesets/grassland_shadows.tsx": { - "scaleInDock": 1 - }, - "/mnt/data/projects/edx/games/azaraka/maps/tilesets/grassland_spring.tsx": { - "scaleInDock": 1 - }, - "/mnt/data/projects/edx/games/azaraka/maps/tilesets/grassland_spring_water.tsx": { - "scaleInDock": 1 - }, - "/mnt/data/projects/edx/games/azaraka/maps/tilesets/grassland_spring_waterfall.tsx": { - "scaleInDock": 1 - }, - "/mnt/data/projects/edx/games/project/graphics/dungeon.tsx": { - "scaleInDock": 1, - "scaleInEditor": 1.5 - }, - "/mnt/data/projects/edx/games/project/graphics/dungeon_entrance.tmx": { - "scale": 1, - "selectedLayer": 3, - "viewCenter": { - "x": 320, - "y": 175.5 - } - }, - "/mnt/data/projects/edx/games/project/graphics/flame.tsx": { - "scaleInDock": 1, - "scaleInEditor": 1 - }, - "/mnt/data/projects/edx/games/project/graphics/grassland.tsx": { - "scaleInDock": 1, - "scaleInEditor": 1 - }, - "/mnt/data/projects/edx/games/project/graphics/house.tsx": { - "scaleInDock": 1, - "scaleInEditor": 1 - }, - "/mnt/data/projects/edx/games/project/graphics/town.tsx": { - "scaleInDock": 1, - "scaleInEditor": 1 - }, - "/mnt/data/projects/edx/games/project/maps/dungeon.tsx": { - "scaleInDock": 1, - "scaleInEditor": 1 - }, - "/mnt/data/projects/edx/games/project/maps/dungeon/dungeon.tsx": { - "scaleInDock": 1 - }, - "/mnt/data/projects/edx/games/project/maps/dungeon/entrance.tmx": { - "scale": 1.3329687499999998, - "selectedLayer": 4, - "viewCenter": { - "x": 320.3375923103974, - "y": 176.67330910795923 - } - }, - "/mnt/data/projects/edx/games/project/maps/dungeon/entrance.tmx#dungeon": { - "scaleInDock": 1, - "scaleInEditor": 1 - }, - "/mnt/data/projects/edx/games/project/maps/entrance.tmx": { - "scale": 1.3332386363636362, - "selectedLayer": 4, - "viewCenter": { - "x": 292.89580225868315, - "y": 116.25825697847861 - } - }, - "/mnt/data/projects/edx/games/project/maps/grassland.tsx": { - "scaleInDock": 1, - "scaleInEditor": 1.5 - }, - "/mnt/data/projects/edx/games/project/maps/outside_entrance.tmx": { - "scale": 1.3332386363636362, - "selectedLayer": 0, - "viewCenter": { - "x": 320.64777327935224, - "y": -69.00490091625824 - } - }, - "/mnt/data/projects/edx/games/project/maps/tilesets/dungeon.tsx": { - "scaleInDock": 1, - "scaleInEditor": 1 - }, - "/mnt/data/projects/edx/games/project/maps/tilesets/grassland.tsx": { - "scaleInDock": 1, - "scaleInEditor": 1 - }, - "levels/level01.tmx": { - "scale": 0.75, - "selectedLayer": 1, - "viewCenter": { - "x": 544, - "y": 248 - } - }, - "parallax/clouds.tmx": { - "scale": 0.9252604166666667, - "selectedLayer": 0, - "viewCenter": { - "x": 264.790318041092, - "y": 384.7565437658316 - } - }, - "parallax/hills.tmx": { - "scale": 0.9252604166666667, - "selectedLayer": 0, - "viewCenter": { - "x": 264.790318041092, - "y": 384.7565437658316 - } - }, - "parallax/snow.tmx": { - "scale": 0.9252604166666667, - "selectedLayer": 0, - "viewCenter": { - "x": 264.790318041092, - "y": 384.7565437658316 - } - }, - "tilesets/backgrounds.tsx": { - "scaleInDock": 3, - "scaleInEditor": 4 - }, - "tilesets/tiles.tsx": { - "scaleInDock": 2, - "scaleInEditor": 2 - } - }, - "frame.defaultDuration": 300, - "last.exportedFilePath": "/mnt/data/godot/projects/Platformer", - "last.imagePath": "/mnt/data/godot/projects/juego/godot/assets/backgrounds", - "lastUsedTilesetExportFilter": "Godot Tileset format (*.tres)", - "loadedWorlds": [ - "/home/cromer/projects/edx/games/project/maps/azaraka" - ], - "map.fixedSize": true, - "map.height": 12, - "map.lastUsedExportFilter": "Godot Tilemap format (*.tscn)", - "map.lastUsedFormat": "tmx", - "map.tileHeight": 24, - "map.tileWidth": 24, - "map.width": 22, - "openFiles": [ - "tilesets/tiles.tsx", - "levels/level01.tmx" - ], - "project": "juego.tiled-project", - "property.type": "int", - "recentFiles": [ - "tilesets/tiles.tsx", - "levels/level01.tmx", - "tilesets/backgrounds.tsx", - "parallax/snow.tmx", - "parallax/hills.tmx", - "/mnt/data/godot/projects/Azaraka/maps/worldmap.tsx", - "/mnt/data/godot/projects/Azaraka/maps/worldmap.tmx", - "/mnt/data/godot/projects/Platformer/asset/world1.tmx", - "/mnt/data/godot/projects/Platformer/asset/spritesheet_ground.tsx", - "/mnt/data/godot/projects/Platformer/asset/world.tmx", - "/mnt/data/godot/projects/Azaraka/maps/dungeon1.tmx", - "/mnt/data/projects/edx/games/azaraka/maps/outside_entrance.tmx" - ], - "tileset.embedInMap": false, - "tileset.lastUsedFilter": "Tiled tileset files (*.tsx *.xml)", - "tileset.lastUsedFormat": "tsx", - "tileset.tileSize": { - "height": 24, - "width": 24 - }, - "tileset.transparentColor": "#000000", - "tileset.useTransparentColor": false -} From 4f4d6b0a03f470b266357af0c094be4e5ed47e15 Mon Sep 17 00:00:00 2001 From: Chris Cromer Date: Wed, 13 Apr 2022 11:23:59 -0400 Subject: [PATCH 20/42] ignore tiled session files --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index b2b3eca..420d650 100644 --- a/.gitignore +++ b/.gitignore @@ -40,3 +40,5 @@ compile_commands.json # docs docs/ +# tiled session files +*.tiled-session From 9b0102ee447b7067260830c8ca260fa16c4d472b Mon Sep 17 00:00:00 2001 From: Chris Cromer Date: Sat, 16 Apr 2022 14:19:59 -0400 Subject: [PATCH 21/42] add zstd support and fix a bug --- .../tiled_import_plugin.gd | 5 ++ .../vnen.tiled_importer/tiled_map_reader.gd | 49 +++++++++++-------- .../vnen.tiled_importer/tiled_xml_to_dict.gd | 4 +- 3 files changed, 35 insertions(+), 23 deletions(-) diff --git a/godot/addons/vnen.tiled_importer/tiled_import_plugin.gd b/godot/addons/vnen.tiled_importer/tiled_import_plugin.gd index 4c5ee10..2612766 100644 --- a/godot/addons/vnen.tiled_importer/tiled_import_plugin.gd +++ b/godot/addons/vnen.tiled_importer/tiled_import_plugin.gd @@ -84,6 +84,11 @@ func get_import_options(preset): "default_value": 1, "property_hint": PROPERTY_HINT_LAYERS_2D_PHYSICS }, + { + "name": "collision_mask", + "default_value": 1, + "property_hint": PROPERTY_HINT_LAYERS_2D_PHYSICS + }, { "name": "embed_internal_images", "default_value": true if preset == PRESET_PIXEL_ART else false diff --git a/godot/addons/vnen.tiled_importer/tiled_map_reader.gd b/godot/addons/vnen.tiled_importer/tiled_map_reader.gd index 7a279a7..e488456 100644 --- a/godot/addons/vnen.tiled_importer/tiled_map_reader.gd +++ b/godot/addons/vnen.tiled_importer/tiled_map_reader.gd @@ -211,12 +211,12 @@ func make_layer(layer, parent, root, data): var opacity = float(layer.opacity) if "opacity" in layer else 1.0 var visible = bool(layer.visible) if "visible" in layer else true - + var z_index = 0 - + if "properties" in layer and "z_index" in layer.properties: z_index = layer.properties.z_index - + if layer.type == "tilelayer": var layer_size = Vector2(int(layer.width), int(layer.height)) var tilemap = TileMap.new() @@ -231,6 +231,7 @@ func make_layer(layer, parent, root, data): tilemap.cell_y_sort = true tilemap.cell_tile_origin = TileMap.TILE_ORIGIN_BOTTOM_LEFT tilemap.collision_layer = options.collision_layer + tilemap.collision_mask = options.collision_mask tilemap.z_index = z_index var offset = Vector2() @@ -280,7 +281,7 @@ func make_layer(layer, parent, root, data): var gid = int_id & ~(FLIPPED_HORIZONTALLY_FLAG | FLIPPED_VERTICALLY_FLAG | FLIPPED_DIAGONALLY_FLAG) var cell_x = cell_offset.x + chunk.x + (count % int(chunk.width)) - var cell_y = cell_offset.y + chunk.y + int(count / chunk.width) + var cell_y = cell_offset.y + chunk.y + int(count / chunk.width) + 1 tilemap.set_cell(cell_x, cell_y, gid, flipped_h, flipped_v, flipped_d) count += 1 @@ -702,26 +703,26 @@ func build_tileset_for_scene(tilesets, source_path, options): var i = 0 var column = 0 - + # Needed to look up textures for animations var tileRegions = [] while i < tilecount: var tilepos = Vector2(x, y) var region = Rect2(tilepos, tilesize) - + tileRegions.push_back(region) - + column += 1 i += 1 - + x += int(tilesize.x) + spacing if (columns > 0 and column >= columns) or x >= int(imagesize.x) - margin or (x + int(tilesize.x)) > int(imagesize.x): x = margin y += int(tilesize.y) + spacing column = 0 - + i = 0 - + while i < tilecount: var region = tileRegions[i] @@ -778,7 +779,7 @@ func build_tileset_for_scene(tilesets, source_path, options): result.tile_set_texture(gid, image) if options.apply_offset: result.tile_set_texture_offset(gid, Vector2(0, -image.get_height())) - + if "tiles" in ts and rel_id in ts.tiles and "objectgroup" in ts.tiles[rel_id] \ and "objects" in ts.tiles[rel_id].objectgroup: for object in ts.tiles[rel_id].objectgroup.objects: @@ -803,10 +804,10 @@ func build_tileset_for_scene(tilesets, source_path, options): result.tile_set_occluder_offset(gid, offset) else: result.tile_add_shape(gid, shape, Transform2D(0, offset), object.type == "one-way") - + if "properties" in ts and "custom_material" in ts.properties: result.tile_set_material(gid, load(ts.properties.custom_material)) - + if options.custom_properties and options.tile_metadata and "tileproperties" in ts \ and "tilepropertytypes" in ts and rel_id in ts.tileproperties and rel_id in ts.tilepropertytypes: tile_meta[gid] = get_custom_properties(ts.tileproperties[rel_id], ts.tilepropertytypes[rel_id]) @@ -815,7 +816,7 @@ func build_tileset_for_scene(tilesets, source_path, options): if property in ts.tiles[rel_id]: if not gid in tile_meta: tile_meta[gid] = {} tile_meta[gid][property] = ts.tiles[rel_id][property] - + gid += 1 i += 1 @@ -1047,13 +1048,19 @@ func is_convex(vertices): return true # Decompress the data of the layer -# Compression argument is a string, either "gzip" or "zlib" +# Compression argument is a string, either "gzip", "zlib", or "zstd" func decompress_layer_data(layer_data, compression, map_size): - if compression != "gzip" and compression != "zlib": - print_error("Unrecognized compression format: %s" % [compression]) - return ERR_INVALID_DATA - - var compression_type = File.COMPRESSION_DEFLATE if compression == "zlib" else File.COMPRESSION_GZIP + var compression_type = -1 + match compression: + "zlib": + compression_type = File.COMPRESSION_DEFLATE + "gzip": + compression_type = File.COMPRESSION_GZIP + "zstd": + compression_type = File.COMPRESSION_ZSTD + _: + print_error("Unrecognized compression format: %s" % [compression]) + return ERR_INVALID_DATA var expected_size = int(map_size.x) * int(map_size.y) * 4 var raw_data = Marshalls.base64_to_raw(layer_data).decompress(expected_size, compression_type) @@ -1220,7 +1227,7 @@ func validate_layer(layer): print_error("Invalid data layer property.") return ERR_INVALID_DATA if "compression" in layer: - if layer.compression != "gzip" and layer.compression != "zlib": + if layer.compression != "gzip" and layer.compression != "zlib" and layer.compression != "zstd": print_error("Invalid compression type.") return ERR_INVALID_DATA "imagelayer": diff --git a/godot/addons/vnen.tiled_importer/tiled_xml_to_dict.gd b/godot/addons/vnen.tiled_importer/tiled_xml_to_dict.gd index 9064b90..a800f0b 100644 --- a/godot/addons/vnen.tiled_importer/tiled_xml_to_dict.gd +++ b/godot/addons/vnen.tiled_importer/tiled_xml_to_dict.gd @@ -247,7 +247,7 @@ func parse_tile_data(parser): var prop_data = parse_properties(parser) data["properties"] = prop_data.properties data["propertytypes"] = prop_data.propertytypes - + elif parser.get_node_name() == "animation": var frame_list = [] var err2 = parser.read() @@ -265,7 +265,7 @@ func parse_tile_data(parser): if parser.get_node_name() == "animation": break err2 = parser.read() - + data["animation"] = frame_list err = parser.read() From a11370c7847edba068bd7e0be3821b73864e54de Mon Sep 17 00:00:00 2001 From: Chris Cromer Date: Sat, 16 Apr 2022 14:21:15 -0400 Subject: [PATCH 22/42] update maps and tilesets --- godot/Main.tscn | 4 +- godot/camera_fix.gd | 10 + godot/characters/player/Player.tscn | 1 + godot/levels/Level2.tmx | 32 +++ .../{level01.tmx.import => Level2.tmx.import} | 9 +- godot/levels/Level2.tscn | 41 ++++ godot/levels/Prototype.tmx | 32 +++ godot/levels/Prototype.tmx.import | 23 +++ godot/{Level1.tscn => levels/Prototype.tscn} | 28 +-- godot/levels/level01.tmx | 112 ----------- godot/parallax/clouds.tmx | 29 +-- godot/parallax/hills.tmx | 29 +-- godot/parallax/mountains.tmx | 29 +-- godot/parallax/snow.tmx | 29 +-- godot/project.godot | 16 +- godot/tilesets/backgrounds.tsx | 1 + godot/tilesets/tiles.tsx | 189 ++++++++++++++++++ 17 files changed, 376 insertions(+), 238 deletions(-) create mode 100644 godot/camera_fix.gd create mode 100644 godot/levels/Level2.tmx rename godot/levels/{level01.tmx.import => Level2.tmx.import} (52%) create mode 100644 godot/levels/Level2.tscn create mode 100644 godot/levels/Prototype.tmx create mode 100644 godot/levels/Prototype.tmx.import rename godot/{Level1.tscn => levels/Prototype.tscn} (59%) delete mode 100644 godot/levels/level01.tmx diff --git a/godot/Main.tscn b/godot/Main.tscn index d264a5c..84d446d 100644 --- a/godot/Main.tscn +++ b/godot/Main.tscn @@ -1,9 +1,9 @@ [gd_scene load_steps=3 format=2] [ext_resource path="res://Main.gdns" type="Script" id=1] -[ext_resource path="res://Level1.tscn" type="PackedScene" id=2] +[ext_resource path="res://levels/Level2.tscn" type="PackedScene" id=2] [node name="Main" type="Node"] script = ExtResource( 1 ) -[node name="Level1" parent="." instance=ExtResource( 2 )] +[node name="Level2" parent="." instance=ExtResource( 2 )] diff --git a/godot/camera_fix.gd b/godot/camera_fix.gd new file mode 100644 index 0000000..31ad05f --- /dev/null +++ b/godot/camera_fix.gd @@ -0,0 +1,10 @@ +extends Node2D + + +# Called when the node enters the scene tree for the first time. +func _ready() -> void: + var used_rect = get_node("Middleground").get_used_rect() + var bounds = Vector2(used_rect.position.x + used_rect.size.x, used_rect.position.y + used_rect.size.y - 1) + var camera : Camera2D = $"../../Player/Camera2D" + camera.limit_right = bounds.x * get_node("Middleground").cell_size.x + camera.limit_bottom = bounds.y * get_node("Middleground").cell_size.y diff --git a/godot/characters/player/Player.tscn b/godot/characters/player/Player.tscn index fd71fe2..fd14612 100644 --- a/godot/characters/player/Player.tscn +++ b/godot/characters/player/Player.tscn @@ -12,6 +12,7 @@ extents = Vector2( 7, 12 ) [node name="Player" type="KinematicBody2D"] +collision_mask = 2 script = ExtResource( 5 ) [node name="AnimatedSprite" type="AnimatedSprite" parent="."] diff --git a/godot/levels/Level2.tmx b/godot/levels/Level2.tmx new file mode 100644 index 0000000..4a5f162 --- /dev/null +++ b/godot/levels/Level2.tmx @@ -0,0 +1,32 @@ + + + + + + KLUv/WCARXUAABgAdQACAH8FesSH8I4N + + + + + KLUv/WCAReUHAMJFERyAa1oDcI3yNgxLrJADMYGMt1VK3WqlViu1WtMUj4khBhdcZJCFAKFxxnPnTUDFDzcs6dEhpRLMlytV2+7O8VvXySWPBFSgUI9lOjCDESmJ0wEFUDBH6aMKnaYbqE3TeZHUEB8pcQNNOxDfKqik4dIamYl9N6jbSwMvVRqDzrlB7c8GUWKOC6sUzQEVzzPO4IgxtKAog6tu1FTgDVN/nN++tBeZA0EN5xk1db0sksKmrmbykTr0A63DDawOgUagB0qpvyBVq4CeYFVHe3t5wv3BM1Ta3X7RbDSyulEpRUiNZjBlQK7pDf62ajznrSAe+evSQvunzakrBQ== + + + + + KLUv/WCARRUIANIEDhigRa0BQ/Q7R/1PsR/MPm2z0rW2E5CaSAF3bMIsV1J77ry5tED4oDjxQam7jR15GE8B0aFV8PXATaBgbbV0gAIUiIjIcQ60HM0oqqweBdaQKlwM1t8qpJZ8tB1EMyqotCNCvamRnuRifF+MubDcIJ1XDxT2Dk2sGSCCbmjVF90Y3KEoKuyI0JoBkXSjVCsddwC1S4ocQUr6N/Q3mAJ9d6or3KrVk3AMw9j/AKvg1Qj5Vxzki1QZxqrbTl1K3FCJ/5Lc4JzPwKsSN+cBgD8c4+5imZRt4gscA6U5ZtMLqm/ED7qsETDJqarCYgqXJ/PkyFVHIrHjagYEG3EVjOLjEQ== + + + + + KLUv/WCARXUAABgANwACALtARV6C3bEB + + + + + KLUv/WCARRUCAHgAa2sjADcAIzdLIiIiSkoUoMD4AUCDbgcmhQw6tZMClhqiTQoZdCqUCkMFg6qbwA28Xqj2RbVDFeykwP8N4YEe+Q== + + + + + + diff --git a/godot/levels/level01.tmx.import b/godot/levels/Level2.tmx.import similarity index 52% rename from godot/levels/level01.tmx.import rename to godot/levels/Level2.tmx.import index b5b61e8..b3d3559 100644 --- a/godot/levels/level01.tmx.import +++ b/godot/levels/Level2.tmx.import @@ -2,12 +2,12 @@ importer="vnen.tiled_importer" type="PackedScene" -path="res://.import/level01.tmx-65e129bada03d3bf56997e5be6fa923f.scn" +path="res://.import/Level2.tmx-357d8ae9edfbc85f5abb1db3655640e1.scn" [deps] -source_file="res://levels/level01.tmx" -dest_files=[ "res://.import/level01.tmx-65e129bada03d3bf56997e5be6fa923f.scn" ] +source_file="res://levels/Level2.tmx" +dest_files=[ "res://.import/Level2.tmx-357d8ae9edfbc85f5abb1db3655640e1.scn" ] [params] @@ -15,7 +15,8 @@ custom_properties=true tile_metadata=false uv_clip=true image_flags=7 -collision_layer=1 +collision_layer=2 +collision_mask=0 embed_internal_images=false save_tiled_properties=false add_background=true diff --git a/godot/levels/Level2.tscn b/godot/levels/Level2.tscn new file mode 100644 index 0000000..13c3651 --- /dev/null +++ b/godot/levels/Level2.tscn @@ -0,0 +1,41 @@ +[gd_scene load_steps=5 format=2] + +[ext_resource path="res://camera_fix.gd" type="Script" id=1] +[ext_resource path="res://characters/player/Player.tscn" type="PackedScene" id=2] +[ext_resource path="res://assets/backgrounds/hills.png" type="Texture" id=3] +[ext_resource path="res://levels/Level2.tmx" type="PackedScene" id=4] + +[node name="Level2" type="Node2D"] + +[node name="Player" parent="." instance=ExtResource( 2 )] + +[node name="Camera2D" type="Camera2D" parent="Player"] +current = true +limit_left = 0 +limit_top = 0 +limit_right = 512 +limit_bottom = 288 +drag_margin_h_enabled = true +drag_margin_v_enabled = true +__meta__ = { +"_edit_bone_": true +} + +[node name="VisibilityNotifier2D" type="VisibilityNotifier2D" parent="Player/Camera2D"] +rect = Rect2( 0, 0, 24, 24 ) + +[node name="ParallaxBackground" type="ParallaxBackground" parent="."] + +[node name="ParallaxLayer" type="ParallaxLayer" parent="ParallaxBackground"] +motion_scale = Vector2( 0.2, 0.2 ) +motion_offset = Vector2( 0, -288 ) +motion_mirroring = Vector2( 528, 0 ) + +[node name="Sprite" type="Sprite" parent="ParallaxBackground/ParallaxLayer"] +texture = ExtResource( 3 ) +centered = false + +[node name="Map" type="Node2D" parent="."] + +[node name="Level2" parent="Map" instance=ExtResource( 4 )] +script = ExtResource( 1 ) diff --git a/godot/levels/Prototype.tmx b/godot/levels/Prototype.tmx new file mode 100644 index 0000000..f6fb3da --- /dev/null +++ b/godot/levels/Prototype.tmx @@ -0,0 +1,32 @@ + + + + + + KLUv/WAAP20GABJGERuQO3NNu/20rYOLBoDnsuAchA019DLxK+U5sBQXD6KYaA0XcxunI957cDBeOKEgOvTBn4dTNWcCdwc09eUKY6XJJY9c1zqg8NKSVMsBUEOFKdYBV6kkVDgVA3BBilMak5J1yoCMyj0pTslLSkdK+RTnkpnQVQNN3T4TMjcjhShwR5/KA0g5Y6hH5+zqPVRmKBFAXiWeXJ0jZMyAqV8hipb7ZS4Q7Kw8YFMCM6KKE9kOxg3OyikJ6rgpHUBFzquSdsAeB1W/S8WFGjA= + + + + + KLUv/WAAP00AAAgAAQD8H94JAQ== + + + + + KLUv/WAAP9UGAOIFEhyATVoDNMAhoPa22NTIGBKFNDIfHSIibyz03jMFm0ZJqPYRgbwFLkD8oBwO4LnaOOOxiaGTxBy9dyG5Yq3rvWsonHDwcssrATmgsFSmmgPAghTIiNpiJ4TqJc3SkwwJSg4APcRRfoOY1+s638xXEGVPdnihL1eyJmtrQfPoHCMEfDPBmKjZJOrT0aRrOHTPcMrOgmgE3lIzpHNOkOISUo0XouICnd+xyONUZ5iiAWnlRZv3ePaAQqUFU3r41eAPSOWeqo3U6/kpdKqp6QP0j4t4prLz73kK + + + + + KLUv/WAAP3UAABgAOAACABtBhdwc3rEB + + + + + KLUv/WAAP+UCAHgAIwA3AGtGNzgAWjduIkoioGD5EAMMXLoGfShQn+oDTEcRNepUmq0wC6aVCsZisJoIqwOgVkFZmtHmGW5aSpVU0I02zg9VHyYlztrUaaKrOaDf/arsQw06wA8U + + + + + + diff --git a/godot/levels/Prototype.tmx.import b/godot/levels/Prototype.tmx.import new file mode 100644 index 0000000..01f4b39 --- /dev/null +++ b/godot/levels/Prototype.tmx.import @@ -0,0 +1,23 @@ +[remap] + +importer="vnen.tiled_importer" +type="PackedScene" +path="res://.import/Prototype.tmx-1674122a110386791b767b1f6628b68b.scn" + +[deps] + +source_file="res://levels/Prototype.tmx" +dest_files=[ "res://.import/Prototype.tmx-1674122a110386791b767b1f6628b68b.scn" ] + +[params] + +custom_properties=true +tile_metadata=false +uv_clip=true +image_flags=7 +collision_layer=2 +collision_mask=0 +embed_internal_images=false +save_tiled_properties=false +add_background=true +post_import_script="" diff --git a/godot/Level1.tscn b/godot/levels/Prototype.tscn similarity index 59% rename from godot/Level1.tscn rename to godot/levels/Prototype.tscn index 4c3cddc..d33d09c 100644 --- a/godot/Level1.tscn +++ b/godot/levels/Prototype.tscn @@ -1,23 +1,22 @@ -[gd_scene load_steps=4 format=2] +[gd_scene load_steps=5 format=2] -[ext_resource path="res://assets/backgrounds/mountains.png" type="Texture" id=1] -[ext_resource path="res://levels/level01.tmx" type="PackedScene" id=3] -[ext_resource path="res://characters/player/Player.tscn" type="PackedScene" id=4] +[ext_resource path="res://camera_fix.gd" type="Script" id=1] +[ext_resource path="res://characters/player/Player.tscn" type="PackedScene" id=2] +[ext_resource path="res://levels/Prototype.tmx" type="PackedScene" id=3] +[ext_resource path="res://assets/backgrounds/mountains.png" type="Texture" id=4] -[node name="Level1" type="Node2D"] +[node name="Prototype" type="Node2D"] -[node name="Player" parent="." instance=ExtResource( 4 )] +[node name="Player" parent="." instance=ExtResource( 2 )] [node name="Camera2D" type="Camera2D" parent="Player"] current = true limit_left = 0 limit_top = 0 -limit_right = 2304 -limit_bottom = 576 +limit_right = 512 +limit_bottom = 288 drag_margin_h_enabled = true drag_margin_v_enabled = true -editor_draw_limits = true -editor_draw_drag_margin = true __meta__ = { "_edit_bone_": true } @@ -28,14 +27,15 @@ rect = Rect2( 0, 0, 24, 24 ) [node name="ParallaxBackground" type="ParallaxBackground" parent="."] [node name="ParallaxLayer" type="ParallaxLayer" parent="ParallaxBackground"] -motion_scale = Vector2( 0.2, 1 ) +motion_scale = Vector2( 0.2, 0.1 ) +motion_offset = Vector2( 0, -288 ) motion_mirroring = Vector2( 528, 0 ) [node name="Sprite" type="Sprite" parent="ParallaxBackground/ParallaxLayer"] -texture = ExtResource( 1 ) +texture = ExtResource( 4 ) centered = false [node name="Map" type="Node2D" parent="."] -position = Vector2( 0, 18 ) -[node name="level01" parent="Map" instance=ExtResource( 3 )] +[node name="Prototype" parent="Map" instance=ExtResource( 3 )] +script = ExtResource( 1 ) diff --git a/godot/levels/level01.tmx b/godot/levels/level01.tmx deleted file mode 100644 index 9bc5967..0000000 --- a/godot/levels/level01.tmx +++ /dev/null @@ -1,112 +0,0 @@ - - - - - -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0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,23,23,23,23,23,24,0,21,0,0,2,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,22,23,23,23,23,23,23,23,23,24,0,0,0,2,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,4, -122,123,123,123,123,123,123,123,123,123,123,123,123,123,123,123,123,123,124,0,121,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,122,123,123,123,123,123,123,123,123,124,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -122,123,123,123,123,123,123,123,123,123,123,123,123,123,123,123,123,123,124,69,121,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,122,123,123,123,123,123,123,123,123,124,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 - - - - -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0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f732ab..5373dbb 100644 --- a/godot/parallax/hills.tmx +++ b/godot/parallax/hills.tmx @@ -2,31 +2,8 @@ - -10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10, -10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10, -10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10, -10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10, -10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10, -10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10, -10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10, -10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10, -10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10, -10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10, -10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10, -10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10, -10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10, -10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10, -10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10, -10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10, -11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11, -12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, -12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, -12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, -12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, -12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, -12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, -12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12 - + + KLUv/WBAB50AADAKAAAACwwDAGRAJQSmm9e/IwI= + diff --git a/godot/parallax/mountains.tmx b/godot/parallax/mountains.tmx index e963695..968553e 100644 --- a/godot/parallax/mountains.tmx +++ b/godot/parallax/mountains.tmx @@ -2,31 +2,8 @@ - -4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4, -4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4, -4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4, -4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4, -4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4, -4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4, -4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4, -4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4, -4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4, -4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4, -4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4, -4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4, -4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4, -4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4, -4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4, -4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4, -5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,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7,7,7,7,7,7,7,7,7,7,7,7, -7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7, -7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7, -7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7, -8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8, -9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9, -9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9, -9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9, -9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9, -9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9, -9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9, -9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9 - + + KLUv/WBAB50AADAHAAAACAkDAGRAJQSmm9e/IwI= + diff --git a/godot/project.godot b/godot/project.godot index e1b9eb4..52b2be8 100644 --- a/godot/project.godot +++ b/godot/project.godot @@ -53,6 +53,18 @@ texture={ "stream": false, "svg/scale": 1.0 } +vnen.tiled_importer={ +"add_background": true, +"collision_layer": 2, +"collision_mask": 0, +"custom_properties": true, +"embed_internal_images": false, +"image_flags": 7, +"post_import_script": "", +"save_tiled_properties": false, +"tile_metadata": false, +"uv_clip": true +} [input] @@ -81,8 +93,8 @@ right={ [layer_names] -2d_physics/layer_1="Tiles" -2d_physics/layer_2="Player" +2d_physics/layer_1="Player" +2d_physics/layer_2="Tiles" [physics] diff --git a/godot/tilesets/backgrounds.tsx b/godot/tilesets/backgrounds.tsx index 1635d01..5e4097e 100644 --- a/godot/tilesets/backgrounds.tsx +++ b/godot/tilesets/backgrounds.tsx @@ -1,4 +1,5 @@ + diff --git a/godot/tilesets/tiles.tsx b/godot/tilesets/tiles.tsx index 7eb103a..547a5ff 100644 --- a/godot/tilesets/tiles.tsx +++ b/godot/tilesets/tiles.tsx @@ -1,5 +1,6 @@ + @@ -21,11 +22,56 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -46,11 +92,48 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -91,6 +174,12 @@ + + + + + + @@ -111,6 +200,17 @@ + + + + + + + + + + + @@ -131,6 +231,38 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -156,6 +288,27 @@ + + + + + + + + + + + + + + + + + + + + + @@ -176,6 +329,26 @@ + + + + + + + + + + + + + + + + + + + + @@ -196,4 +369,20 @@ + + + + + + + + + + + + + + + + From 53ce0bd1ff0ba6fe76897c1a541fe08640afabff Mon Sep 17 00:00:00 2001 From: Chris Cromer Date: Sat, 16 Apr 2022 15:54:05 -0400 Subject: [PATCH 23/42] improve error messages and checking --- src/state_machine/State.cpp | 4 +- src/state_machine/StateMachine.cpp | 102 +++++++++++++++++++++++++---- src/state_machine/StateMachine.h | 34 ++++++---- 3 files changed, 113 insertions(+), 27 deletions(-) diff --git a/src/state_machine/State.cpp b/src/state_machine/State.cpp index 29efa48..2763449 100644 --- a/src/state_machine/State.cpp +++ b/src/state_machine/State.cpp @@ -25,12 +25,12 @@ void State::_init() void State::_state_enter(const String state, const Array args) { - WARN_PRINT("State " + state + " is missing its _state_enter method!"); + WARN_PRINT("State " + get_state_machine()->get_current_state() + " is missing its _state_enter method!"); } void State::_state_exit(const String state, const Array args) { - WARN_PRINT("State " + state + " is missing its _state_exit method!"); + WARN_PRINT("State " + get_state_machine()->get_current_state() + " is missing its _state_exit method!"); } void State::set_parent(Node *parent) diff --git a/src/state_machine/StateMachine.cpp b/src/state_machine/StateMachine.cpp index 4370842..73b1f9d 100644 --- a/src/state_machine/StateMachine.cpp +++ b/src/state_machine/StateMachine.cpp @@ -34,7 +34,15 @@ void StateMachine::_ready() connect("tree_entered", this, "_on_StateMachine_tree_entered"); connect("tree_exiting", this, "_on_StateMachine_tree_exiting"); parent = get_parent(); - set_current_state(get_default_state()); + add_states(); + if (has(get_default_state())) + { + set_current_state(get_default_state()); + } + else + { + WARN_PRINT("The selected default state " + get_default_state() + " doesn't exist!"); + } setup(); } @@ -46,13 +54,13 @@ void StateMachine::setup() { if (children.size() > 0) { - WARN_PRINT("State machine doesn't have a default state set, using first child!"); + WARN_PRINT("The state machine doesn't have a default state set, using first child!"); auto child = Object::cast_to(children[0].operator Object*()); set_current_state(child->get_name()); } else { - ERR_PRINT("State machine doesn't have a default state set and has no child states!"); + ERR_PRINT("The state machine doesn't have a default state set and has no child states!"); return; } } @@ -60,7 +68,6 @@ void StateMachine::setup() for (uint8_t i = 0; i < children.size(); i++) { auto child = Object::cast_to(children[i].operator Object*()); - add_state(child->get_name(), child); child->call("set_state_machine", this); @@ -72,7 +79,24 @@ void StateMachine::setup() } } - this->call("_state_enter", get_current_state()); + Node *state_node = Object::cast_to(this->states[get_current_state()]); + if (state_node->has_method("_state_enter")) + { + this->call("_state_enter", get_current_state()); + } + else { + WARN_PRINT("The state " + get_current_state() + " doesn't have a _state_enter method!"); + } +} + +void StateMachine::add_states() +{ + auto children = get_children(); + for (uint8_t i = 0; i < children.size(); i++) + { + auto child = Object::cast_to(children[i].operator Object*()); + add_state(child->get_name(), child); + } } void StateMachine::add_state(const String state, Node *child) @@ -111,8 +135,31 @@ void StateMachine::change(const String state, const Array &args) return this->restart(state, args); } + if (!has(state)) + { + WARN_PRINT("The state " + state + " does not exist, called from state " + get_current_state() + "!"); + return; + } + auto previous_state = get_current_state(); - auto exiting = this->call("_state_exit", state, args); + + Variant exiting; + Node *state_node = Object::cast_to(this->states[previous_state]); + if (state_node) + { + if (state_node->has_method("_state_exit")) + { + exiting = this->call("_state_exit", state, args); + } + else + { + WARN_PRINT("The state " + get_current_state() + " doesn't have a _state_exit method!"); + } + } + else + { + ERR_PRINT("Could not get current state node for " + get_current_state() + "!"); + } if (get_current_state() != "") { @@ -132,7 +179,23 @@ void StateMachine::change(const String state, const Array &args) auto child = Object::cast_to(states[get_current_state()].operator Object*()); this->add_child(child); - this->call("_state_enter", previous_state, args); + state_node = Object::cast_to(this->states[get_current_state()]); + if (state_node) + { + if (state_node->has_method("_state_enter")) + { + this->call("_state_enter", previous_state, args); + } + else + { + WARN_PRINT("The state " + get_current_state() + " doesn't have a _state_enter method!"); + } + } + else + { + ERR_PRINT("Could not get current state node for " + get_current_state() + "!"); + } + this->emit_signal("state_entered", get_current_state()); if (debug) { @@ -143,11 +206,23 @@ void StateMachine::change(const String state, const Array &args) Variant StateMachine::call(const String method, const Array &args) { auto node = Object::cast_to(states[get_current_state()].operator Object*()); - if (node != nullptr) + if (node) { - return node->call(method, args); + if (node->has_method(method)) + { + return node->call(method, args); + } + else + { + WARN_PRINT("The state " + get_current_state() + " doesn't contain the method " + method + "!"); + return Variant(); + } + } + else + { + ERR_PRINT("Could not get current state node for " + get_current_state() + "!"); + return Variant(); } - return Variant(); } Variant StateMachine::_call(const String method, const Array &args) @@ -196,7 +271,7 @@ void StateMachine::_on_StateMachine_tree_exiting() for (uint8_t i = 0; i < keys.size(); i++) { auto child = Object::cast_to(states[keys[i]].operator Object*()); - if (child != nullptr) + if (child) { auto children = get_children(); if (!children.has(child)) @@ -204,5 +279,10 @@ void StateMachine::_on_StateMachine_tree_exiting() this->add_child(child); } } + else + { + ERR_PRINT("Could not get child node!"); + return; + } } } diff --git a/src/state_machine/StateMachine.h b/src/state_machine/StateMachine.h index 02789ba..0fdb8d7 100644 --- a/src/state_machine/StateMachine.h +++ b/src/state_machine/StateMachine.h @@ -43,6 +43,12 @@ namespace godot */ Dictionary states; + /** + * @brief This adds all nodes of the states machine as states in the machine. + * + */ + void add_states(); + /** * @brief This adds a state to the list of states in the state machine. * @@ -51,6 +57,13 @@ namespace godot */ void add_state(const String state, Node *child); + /** + * @brief Set the current state object. + * + * @param[in] current_state The current state that is running. + */ + void set_current_state(const String current_state); + public: /** * @brief This method registers classes with Godot. @@ -157,6 +170,13 @@ namespace godot */ String get_default_state(); + /** + * @brief Get the current state object. + * + * @return String The current running state. + */ + String get_current_state(); + /** * @brief Set the debug object. * @@ -172,20 +192,6 @@ namespace godot */ bool get_debug(); - /** - * @brief Set the current state object. - * - * @param[in] current_state The current state that is running. - */ - void set_current_state(const String current_state); - - /** - * @brief Get the current state object. - * - * @return String The current running state. - */ - String get_current_state(); - /** * @brief This method is called when the signal tree_entered is emitted. * From cdaa32ce1762586801a641664afb66eb20d767c7 Mon Sep 17 00:00:00 2001 From: Chris Cromer Date: Sat, 16 Apr 2022 16:03:41 -0400 Subject: [PATCH 24/42] remove object layer --- godot/levels/Level2.tmx | 3 --- godot/levels/Level2.tmx.import | 1 - 2 files changed, 4 deletions(-) diff --git a/godot/levels/Level2.tmx b/godot/levels/Level2.tmx index 4a5f162..5ba4922 100644 --- a/godot/levels/Level2.tmx +++ b/godot/levels/Level2.tmx @@ -26,7 +26,4 @@ KLUv/WCARRUCAHgAa2sjADcAIzdLIiIiSkoUoMD4AUCDbgcmhQw6tZMClhqiTQoZdCqUCkMFg6qbwA28Xqj2RbVDFeykwP8N4YEe+Q== - - - diff --git a/godot/levels/Level2.tmx.import b/godot/levels/Level2.tmx.import index b3d3559..0f2e4aa 100644 --- a/godot/levels/Level2.tmx.import +++ b/godot/levels/Level2.tmx.import @@ -16,7 +16,6 @@ tile_metadata=false uv_clip=true image_flags=7 collision_layer=2 -collision_mask=0 embed_internal_images=false save_tiled_properties=false add_background=true From dab20270beae4d8fa775525da4c4bb22366c70ef Mon Sep 17 00:00:00 2001 From: Chris Cromer Date: Sat, 16 Apr 2022 17:20:45 -0400 Subject: [PATCH 25/42] make level dynamic from main --- godot/Main.tscn | 5 ++--- src/Main.cpp | 16 ++++++++++++++++ src/Main.h | 21 +++++++++++++++++++++ 3 files changed, 39 insertions(+), 3 deletions(-) diff --git a/godot/Main.tscn b/godot/Main.tscn index 84d446d..0b5ed2e 100644 --- a/godot/Main.tscn +++ b/godot/Main.tscn @@ -1,9 +1,8 @@ [gd_scene load_steps=3 format=2] [ext_resource path="res://Main.gdns" type="Script" id=1] -[ext_resource path="res://levels/Level2.tscn" type="PackedScene" id=2] +[ext_resource path="res://levels/Prototype.tscn" type="PackedScene" id=2] [node name="Main" type="Node"] script = ExtResource( 1 ) - -[node name="Level2" parent="." instance=ExtResource( 2 )] +level = ExtResource( 2 ) diff --git a/src/Main.cpp b/src/Main.cpp index 387ff6e..4f91c0c 100644 --- a/src/Main.cpp +++ b/src/Main.cpp @@ -9,6 +9,7 @@ void Main::_register_methods() { register_method("_ready", &Main::_ready); register_method("_physics_process", &Main::_physics_process); + register_property>("level", &Main::set_level, &Main::get_level, NULL, GODOT_METHOD_RPC_MODE_DISABLED, GODOT_PROPERTY_USAGE_DEFAULT, GODOT_PROPERTY_HINT_RESOURCE_TYPE, String("PackedScene")); register_property("full_screen", &Main::set_full_screen, &Main::get_full_screen, main::full_screen); register_property("window_size", &Main::set_window_size, &Main::get_window_size, main::window_size); register_property("launch_screen", &Main::set_launch_screen, &Main::get_launch_screen, main::launch_screen); @@ -45,6 +46,11 @@ void Main::_ready() _os->get_screen_position(get_launch_screen()) + _os->get_screen_size() * 0.5 - _os->get_window_size() * 0.5 ); } + + if (level != NULL) + { + add_child(level->instance()); + } } void Main::_physics_process(float delta) @@ -55,6 +61,16 @@ void Main::_physics_process(float delta) } } +void Main::set_level(Ref level) +{ + this->level = level; +} + +Ref Main::get_level() +{ + return this->level; +} + void Main::set_full_screen(bool full_screen) { this->full_screen = full_screen; diff --git a/src/Main.h b/src/Main.h index 4d86783..d89c5c9 100644 --- a/src/Main.h +++ b/src/Main.h @@ -5,6 +5,8 @@ #include #include #include +#include +#include /** * @brief This is the godot namespace for all the code included in the library. @@ -57,6 +59,11 @@ namespace godot */ Input *_input; + /** + * @brief The first level to load + * + */ + Ref level; /** * @brief If the window is full screen or not. * @@ -116,6 +123,20 @@ namespace godot */ void _physics_process(float delta); + /** + * @brief Set the level object. + * + * @param[in] level The new level to load when starting. + */ + void set_level(Ref level); + + /** + * @brief Get the level object. + * + * @return Ref The level scene to load. + */ + Ref get_level(); + /** * @brief Set the full screen object. * From a89283ea3621b8b15607d35ca3f552b522bb8c25 Mon Sep 17 00:00:00 2001 From: Chris Cromer Date: Wed, 13 Apr 2022 11:23:20 -0400 Subject: [PATCH 26/42] rename tiled file name --- ...juego.tiled-project => alai.tiled-project} | 0 godot/juego.tiled-session | 285 ------------------ 2 files changed, 285 deletions(-) rename godot/{juego.tiled-project => alai.tiled-project} (100%) delete mode 100644 godot/juego.tiled-session diff --git a/godot/juego.tiled-project b/godot/alai.tiled-project similarity index 100% rename from godot/juego.tiled-project rename to godot/alai.tiled-project diff --git a/godot/juego.tiled-session b/godot/juego.tiled-session deleted file mode 100644 index 9b2b07d..0000000 --- a/godot/juego.tiled-session +++ /dev/null @@ -1,285 +0,0 @@ -{ - "Map/SizeTest": { - "height": 4300, - "width": 2 - }, - "activeFile": "levels/level01.tmx", - "expandedProjectPaths": [ - "tilesets", - "levels", - ".", - "parallax" - ], - "exportAsImage.useCurrentScale": false, - "file.lastUsedOpenFilter": "All Files (*)", - "fileStates": { - "": { - "scaleInDock": 1 - }, - "#backgrounds": { - "scaleInDock": 1 - }, - "/home/cromer/projects/edx/games/azaraka/misc/new-graphics/tf_darkdimension_updated2020/RMMV/tf_dd_B_3.tsx": { - "scaleInDock": 1, - "scaleInEditor": 1 - }, - "/home/cromer/projects/edx/games/azaraka/misc/new-graphics/tf_darkdimension_updated2020/dd_waterfall_sheet.tsx": { - "scaleInDock": 1, - "scaleInEditor": 2 - }, - "/home/cromer/projects/edx/games/azaraka/misc/new-graphics/tf_darkdimension_updated2020/tf_darkdimension_sheet.tsx": { - "scaleInDock": 2, - "scaleInEditor": 2 - }, - "/home/cromer/projects/edx/games/azaraka/misc/new-graphics/tf_darkdimension_updated2020/untitled.tmx": { - "scale": 2, - "selectedLayer": 3, - "viewCenter": { - "x": 465.75, - "y": 233.5 - } - }, - "/home/cromer/tilemaps/Dungeon.tsx": { - "scaleInDock": 1, - "scaleInEditor": 1 - }, - "/home/cromer/tilemaps/Grassland.tsx": { - "scaleInDock": 1, - "scaleInEditor": 1 - }, - "/home/cromer/tilemaps/dungeon_entrance.tmx": { - "scale": 0.53140625, - "selectedLayer": 0, - "viewCenter": { - "x": 902.3228462216996, - "y": 825.1690679211997 - } - }, - "/home/cromer/tilemaps/untitled.tmx": { - "scale": 0.53140625, - "selectedLayer": 1, - "viewCenter": { - "x": 798.8238753307851, - "y": 798.8238753307851 - } - }, - "/mnt/data/godot/projects/Azaraka/maps/cloud_city.tsx": { - "scaleInDock": 0.5 - }, - "/mnt/data/godot/projects/Azaraka/maps/dungeon1.tmx": { - "scale": 0.75, - "selectedLayer": 0, - "viewCenter": { - "x": 1209.3333333333333, - "y": 672 - } - }, - "/mnt/data/godot/projects/Azaraka/maps/shadowset.tsx": { - "scaleInDock": 1 - }, - "/mnt/data/godot/projects/Azaraka/maps/terrain.tsx": { - "scaleInDock": 0.75 - }, - "/mnt/data/godot/projects/Azaraka/maps/worldmap.tmx": { - "scale": 0.03125, - "selectedLayer": 0, - "viewCenter": { - "x": 10496, - "y": 2592 - } - }, - "/mnt/data/godot/projects/Azaraka/maps/worldmap.tsx": { - "scaleInDock": 0.33 - }, - "/mnt/data/godot/projects/Platformer/asset/spritesheet_ground.tsx": { - "scaleInDock": 0.125, - "scaleInEditor": 0.75 - }, - "/mnt/data/godot/projects/Platformer/asset/world.tmx": { - "scale": 0.5, - "selectedLayer": 0, - "viewCenter": { - "x": 1326, - "y": 1210 - } - }, - "/mnt/data/godot/projects/Platformer/asset/world1.tmx": { - "scale": 0.5714843749999999, - "selectedLayer": 0, - "viewCenter": { - "x": 640.4374572795626, - "y": 640.4374572795626 - } - }, - "/mnt/data/projects/edx/games/azaraka/maps/tilesets/grassland_shadows.tsx": { - "scaleInDock": 1 - }, - "/mnt/data/projects/edx/games/azaraka/maps/tilesets/grassland_spring.tsx": { - "scaleInDock": 1 - }, - "/mnt/data/projects/edx/games/azaraka/maps/tilesets/grassland_spring_water.tsx": { - "scaleInDock": 1 - }, - "/mnt/data/projects/edx/games/azaraka/maps/tilesets/grassland_spring_waterfall.tsx": { - "scaleInDock": 1 - }, - "/mnt/data/projects/edx/games/project/graphics/dungeon.tsx": { - "scaleInDock": 1, - "scaleInEditor": 1.5 - }, - "/mnt/data/projects/edx/games/project/graphics/dungeon_entrance.tmx": { - "scale": 1, - "selectedLayer": 3, - "viewCenter": { - "x": 320, - "y": 175.5 - } - }, - "/mnt/data/projects/edx/games/project/graphics/flame.tsx": { - "scaleInDock": 1, - "scaleInEditor": 1 - }, - "/mnt/data/projects/edx/games/project/graphics/grassland.tsx": { - "scaleInDock": 1, - "scaleInEditor": 1 - }, - "/mnt/data/projects/edx/games/project/graphics/house.tsx": { - "scaleInDock": 1, - "scaleInEditor": 1 - }, - "/mnt/data/projects/edx/games/project/graphics/town.tsx": { - "scaleInDock": 1, - "scaleInEditor": 1 - }, - "/mnt/data/projects/edx/games/project/maps/dungeon.tsx": { - "scaleInDock": 1, - "scaleInEditor": 1 - }, - "/mnt/data/projects/edx/games/project/maps/dungeon/dungeon.tsx": { - "scaleInDock": 1 - }, - "/mnt/data/projects/edx/games/project/maps/dungeon/entrance.tmx": { - "scale": 1.3329687499999998, - "selectedLayer": 4, - "viewCenter": { - "x": 320.3375923103974, - "y": 176.67330910795923 - } - }, - "/mnt/data/projects/edx/games/project/maps/dungeon/entrance.tmx#dungeon": { - "scaleInDock": 1, - "scaleInEditor": 1 - }, - "/mnt/data/projects/edx/games/project/maps/entrance.tmx": { - "scale": 1.3332386363636362, - "selectedLayer": 4, - "viewCenter": { - "x": 292.89580225868315, - "y": 116.25825697847861 - } - }, - "/mnt/data/projects/edx/games/project/maps/grassland.tsx": { - "scaleInDock": 1, - "scaleInEditor": 1.5 - }, - "/mnt/data/projects/edx/games/project/maps/outside_entrance.tmx": { - "scale": 1.3332386363636362, - "selectedLayer": 0, - "viewCenter": { - "x": 320.64777327935224, - "y": -69.00490091625824 - } - }, - "/mnt/data/projects/edx/games/project/maps/tilesets/dungeon.tsx": { - "scaleInDock": 1, - "scaleInEditor": 1 - }, - "/mnt/data/projects/edx/games/project/maps/tilesets/grassland.tsx": { - "scaleInDock": 1, - "scaleInEditor": 1 - }, - "levels/level01.tmx": { - "scale": 0.75, - "selectedLayer": 1, - "viewCenter": { - "x": 544, - "y": 248 - } - }, - "parallax/clouds.tmx": { - "scale": 0.9252604166666667, - "selectedLayer": 0, - "viewCenter": { - "x": 264.790318041092, - "y": 384.7565437658316 - } - }, - "parallax/hills.tmx": { - "scale": 0.9252604166666667, - "selectedLayer": 0, - "viewCenter": { - "x": 264.790318041092, - "y": 384.7565437658316 - } - }, - "parallax/snow.tmx": { - "scale": 0.9252604166666667, - "selectedLayer": 0, - "viewCenter": { - "x": 264.790318041092, - "y": 384.7565437658316 - } - }, - "tilesets/backgrounds.tsx": { - "scaleInDock": 3, - "scaleInEditor": 4 - }, - "tilesets/tiles.tsx": { - "scaleInDock": 2, - "scaleInEditor": 2 - } - }, - "frame.defaultDuration": 300, - "last.exportedFilePath": "/mnt/data/godot/projects/Platformer", - "last.imagePath": "/mnt/data/godot/projects/juego/godot/assets/backgrounds", - "lastUsedTilesetExportFilter": "Godot Tileset format (*.tres)", - "loadedWorlds": [ - "/home/cromer/projects/edx/games/project/maps/azaraka" - ], - "map.fixedSize": true, - "map.height": 12, - "map.lastUsedExportFilter": "Godot Tilemap format (*.tscn)", - "map.lastUsedFormat": "tmx", - "map.tileHeight": 24, - "map.tileWidth": 24, - "map.width": 22, - "openFiles": [ - "tilesets/tiles.tsx", - "levels/level01.tmx" - ], - "project": "juego.tiled-project", - "property.type": "int", - "recentFiles": [ - "tilesets/tiles.tsx", - "levels/level01.tmx", - "tilesets/backgrounds.tsx", - "parallax/snow.tmx", - "parallax/hills.tmx", - "/mnt/data/godot/projects/Azaraka/maps/worldmap.tsx", - "/mnt/data/godot/projects/Azaraka/maps/worldmap.tmx", - "/mnt/data/godot/projects/Platformer/asset/world1.tmx", - "/mnt/data/godot/projects/Platformer/asset/spritesheet_ground.tsx", - "/mnt/data/godot/projects/Platformer/asset/world.tmx", - "/mnt/data/godot/projects/Azaraka/maps/dungeon1.tmx", - "/mnt/data/projects/edx/games/azaraka/maps/outside_entrance.tmx" - ], - "tileset.embedInMap": false, - "tileset.lastUsedFilter": "Tiled tileset files (*.tsx *.xml)", - "tileset.lastUsedFormat": "tsx", - "tileset.tileSize": { - "height": 24, - "width": 24 - }, - "tileset.transparentColor": "#000000", - "tileset.useTransparentColor": false -} From b791768ec1f6be7b10d7352319807545b3dd8c58 Mon Sep 17 00:00:00 2001 From: Chris Cromer Date: Wed, 13 Apr 2022 11:23:59 -0400 Subject: [PATCH 27/42] ignore tiled session files --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index b2b3eca..420d650 100644 --- a/.gitignore +++ b/.gitignore @@ -40,3 +40,5 @@ compile_commands.json # docs docs/ +# tiled session files +*.tiled-session From 73e4e442c3f64005deb6eb67600a41133e08ff2a Mon Sep 17 00:00:00 2001 From: Chris Cromer Date: Sat, 16 Apr 2022 14:19:59 -0400 Subject: [PATCH 28/42] add zstd support and fix a bug --- .../tiled_import_plugin.gd | 5 ++ .../vnen.tiled_importer/tiled_map_reader.gd | 49 +++++++++++-------- .../vnen.tiled_importer/tiled_xml_to_dict.gd | 4 +- 3 files changed, 35 insertions(+), 23 deletions(-) diff --git a/godot/addons/vnen.tiled_importer/tiled_import_plugin.gd b/godot/addons/vnen.tiled_importer/tiled_import_plugin.gd index 4c5ee10..2612766 100644 --- a/godot/addons/vnen.tiled_importer/tiled_import_plugin.gd +++ b/godot/addons/vnen.tiled_importer/tiled_import_plugin.gd @@ -84,6 +84,11 @@ func get_import_options(preset): "default_value": 1, "property_hint": PROPERTY_HINT_LAYERS_2D_PHYSICS }, + { + "name": "collision_mask", + "default_value": 1, + "property_hint": PROPERTY_HINT_LAYERS_2D_PHYSICS + }, { "name": "embed_internal_images", "default_value": true if preset == PRESET_PIXEL_ART else false diff --git a/godot/addons/vnen.tiled_importer/tiled_map_reader.gd b/godot/addons/vnen.tiled_importer/tiled_map_reader.gd index 7a279a7..e488456 100644 --- a/godot/addons/vnen.tiled_importer/tiled_map_reader.gd +++ b/godot/addons/vnen.tiled_importer/tiled_map_reader.gd @@ -211,12 +211,12 @@ func make_layer(layer, parent, root, data): var opacity = float(layer.opacity) if "opacity" in layer else 1.0 var visible = bool(layer.visible) if "visible" in layer else true - + var z_index = 0 - + if "properties" in layer and "z_index" in layer.properties: z_index = layer.properties.z_index - + if layer.type == "tilelayer": var layer_size = Vector2(int(layer.width), int(layer.height)) var tilemap = TileMap.new() @@ -231,6 +231,7 @@ func make_layer(layer, parent, root, data): tilemap.cell_y_sort = true tilemap.cell_tile_origin = TileMap.TILE_ORIGIN_BOTTOM_LEFT tilemap.collision_layer = options.collision_layer + tilemap.collision_mask = options.collision_mask tilemap.z_index = z_index var offset = Vector2() @@ -280,7 +281,7 @@ func make_layer(layer, parent, root, data): var gid = int_id & ~(FLIPPED_HORIZONTALLY_FLAG | FLIPPED_VERTICALLY_FLAG | FLIPPED_DIAGONALLY_FLAG) var cell_x = cell_offset.x + chunk.x + (count % int(chunk.width)) - var cell_y = cell_offset.y + chunk.y + int(count / chunk.width) + var cell_y = cell_offset.y + chunk.y + int(count / chunk.width) + 1 tilemap.set_cell(cell_x, cell_y, gid, flipped_h, flipped_v, flipped_d) count += 1 @@ -702,26 +703,26 @@ func build_tileset_for_scene(tilesets, source_path, options): var i = 0 var column = 0 - + # Needed to look up textures for animations var tileRegions = [] while i < tilecount: var tilepos = Vector2(x, y) var region = Rect2(tilepos, tilesize) - + tileRegions.push_back(region) - + column += 1 i += 1 - + x += int(tilesize.x) + spacing if (columns > 0 and column >= columns) or x >= int(imagesize.x) - margin or (x + int(tilesize.x)) > int(imagesize.x): x = margin y += int(tilesize.y) + spacing column = 0 - + i = 0 - + while i < tilecount: var region = tileRegions[i] @@ -778,7 +779,7 @@ func build_tileset_for_scene(tilesets, source_path, options): result.tile_set_texture(gid, image) if options.apply_offset: result.tile_set_texture_offset(gid, Vector2(0, -image.get_height())) - + if "tiles" in ts and rel_id in ts.tiles and "objectgroup" in ts.tiles[rel_id] \ and "objects" in ts.tiles[rel_id].objectgroup: for object in ts.tiles[rel_id].objectgroup.objects: @@ -803,10 +804,10 @@ func build_tileset_for_scene(tilesets, source_path, options): result.tile_set_occluder_offset(gid, offset) else: result.tile_add_shape(gid, shape, Transform2D(0, offset), object.type == "one-way") - + if "properties" in ts and "custom_material" in ts.properties: result.tile_set_material(gid, load(ts.properties.custom_material)) - + if options.custom_properties and options.tile_metadata and "tileproperties" in ts \ and "tilepropertytypes" in ts and rel_id in ts.tileproperties and rel_id in ts.tilepropertytypes: tile_meta[gid] = get_custom_properties(ts.tileproperties[rel_id], ts.tilepropertytypes[rel_id]) @@ -815,7 +816,7 @@ func build_tileset_for_scene(tilesets, source_path, options): if property in ts.tiles[rel_id]: if not gid in tile_meta: tile_meta[gid] = {} tile_meta[gid][property] = ts.tiles[rel_id][property] - + gid += 1 i += 1 @@ -1047,13 +1048,19 @@ func is_convex(vertices): return true # Decompress the data of the layer -# Compression argument is a string, either "gzip" or "zlib" +# Compression argument is a string, either "gzip", "zlib", or "zstd" func decompress_layer_data(layer_data, compression, map_size): - if compression != "gzip" and compression != "zlib": - print_error("Unrecognized compression format: %s" % [compression]) - return ERR_INVALID_DATA - - var compression_type = File.COMPRESSION_DEFLATE if compression == "zlib" else File.COMPRESSION_GZIP + var compression_type = -1 + match compression: + "zlib": + compression_type = File.COMPRESSION_DEFLATE + "gzip": + compression_type = File.COMPRESSION_GZIP + "zstd": + compression_type = File.COMPRESSION_ZSTD + _: + print_error("Unrecognized compression format: %s" % [compression]) + return ERR_INVALID_DATA var expected_size = int(map_size.x) * int(map_size.y) * 4 var raw_data = Marshalls.base64_to_raw(layer_data).decompress(expected_size, compression_type) @@ -1220,7 +1227,7 @@ func validate_layer(layer): print_error("Invalid data layer property.") return ERR_INVALID_DATA if "compression" in layer: - if layer.compression != "gzip" and layer.compression != "zlib": + if layer.compression != "gzip" and layer.compression != "zlib" and layer.compression != "zstd": print_error("Invalid compression type.") return ERR_INVALID_DATA "imagelayer": diff --git a/godot/addons/vnen.tiled_importer/tiled_xml_to_dict.gd b/godot/addons/vnen.tiled_importer/tiled_xml_to_dict.gd index 9064b90..a800f0b 100644 --- a/godot/addons/vnen.tiled_importer/tiled_xml_to_dict.gd +++ b/godot/addons/vnen.tiled_importer/tiled_xml_to_dict.gd @@ -247,7 +247,7 @@ func parse_tile_data(parser): var prop_data = parse_properties(parser) data["properties"] = prop_data.properties data["propertytypes"] = prop_data.propertytypes - + elif parser.get_node_name() == "animation": var frame_list = [] var err2 = parser.read() @@ -265,7 +265,7 @@ func parse_tile_data(parser): if parser.get_node_name() == "animation": break err2 = parser.read() - + data["animation"] = frame_list err = parser.read() From 50df0a7865f9a0661a0a132d7d334e6792874d9e Mon Sep 17 00:00:00 2001 From: Chris Cromer Date: Sat, 16 Apr 2022 14:21:15 -0400 Subject: [PATCH 29/42] update maps and tilesets --- godot/Main.tscn | 4 +- godot/camera_fix.gd | 10 + godot/characters/player/Player.tscn | 1 + godot/levels/Level2.tmx | 32 +++ .../{level01.tmx.import => Level2.tmx.import} | 9 +- godot/levels/Level2.tscn | 41 ++++ godot/levels/Prototype.tmx | 32 +++ godot/levels/Prototype.tmx.import | 23 +++ godot/{Level1.tscn => levels/Prototype.tscn} | 28 +-- godot/levels/level01.tmx | 112 ----------- godot/parallax/clouds.tmx | 29 +-- godot/parallax/hills.tmx | 29 +-- godot/parallax/mountains.tmx | 29 +-- godot/parallax/snow.tmx | 29 +-- godot/project.godot | 16 +- godot/tilesets/backgrounds.tsx | 1 + godot/tilesets/tiles.tsx | 189 ++++++++++++++++++ 17 files changed, 376 insertions(+), 238 deletions(-) create mode 100644 godot/camera_fix.gd create mode 100644 godot/levels/Level2.tmx rename godot/levels/{level01.tmx.import => Level2.tmx.import} (52%) create mode 100644 godot/levels/Level2.tscn create mode 100644 godot/levels/Prototype.tmx create mode 100644 godot/levels/Prototype.tmx.import rename godot/{Level1.tscn => levels/Prototype.tscn} (59%) delete mode 100644 godot/levels/level01.tmx diff --git a/godot/Main.tscn b/godot/Main.tscn index d264a5c..84d446d 100644 --- a/godot/Main.tscn +++ b/godot/Main.tscn @@ -1,9 +1,9 @@ [gd_scene load_steps=3 format=2] [ext_resource path="res://Main.gdns" type="Script" id=1] -[ext_resource path="res://Level1.tscn" type="PackedScene" id=2] +[ext_resource path="res://levels/Level2.tscn" type="PackedScene" id=2] [node name="Main" type="Node"] script = ExtResource( 1 ) -[node name="Level1" parent="." instance=ExtResource( 2 )] +[node name="Level2" parent="." instance=ExtResource( 2 )] diff --git a/godot/camera_fix.gd b/godot/camera_fix.gd new file mode 100644 index 0000000..31ad05f --- /dev/null +++ b/godot/camera_fix.gd @@ -0,0 +1,10 @@ +extends Node2D + + +# Called when the node enters the scene tree for the first time. +func _ready() -> void: + var used_rect = get_node("Middleground").get_used_rect() + var bounds = Vector2(used_rect.position.x + used_rect.size.x, used_rect.position.y + used_rect.size.y - 1) + var camera : Camera2D = $"../../Player/Camera2D" + camera.limit_right = bounds.x * get_node("Middleground").cell_size.x + camera.limit_bottom = bounds.y * get_node("Middleground").cell_size.y diff --git a/godot/characters/player/Player.tscn b/godot/characters/player/Player.tscn index fd71fe2..fd14612 100644 --- a/godot/characters/player/Player.tscn +++ b/godot/characters/player/Player.tscn @@ -12,6 +12,7 @@ extents = Vector2( 7, 12 ) [node name="Player" type="KinematicBody2D"] +collision_mask = 2 script = ExtResource( 5 ) [node name="AnimatedSprite" type="AnimatedSprite" parent="."] diff --git a/godot/levels/Level2.tmx b/godot/levels/Level2.tmx new file mode 100644 index 0000000..4a5f162 --- /dev/null +++ b/godot/levels/Level2.tmx @@ -0,0 +1,32 @@ + + + + + + KLUv/WCARXUAABgAdQACAH8FesSH8I4N + + + + + KLUv/WCAReUHAMJFERyAa1oDcI3yNgxLrJADMYGMt1VK3WqlViu1WtMUj4khBhdcZJCFAKFxxnPnTUDFDzcs6dEhpRLMlytV2+7O8VvXySWPBFSgUI9lOjCDESmJ0wEFUDBH6aMKnaYbqE3TeZHUEB8pcQNNOxDfKqik4dIamYl9N6jbSwMvVRqDzrlB7c8GUWKOC6sUzQEVzzPO4IgxtKAog6tu1FTgDVN/nN++tBeZA0EN5xk1db0sksKmrmbykTr0A63DDawOgUagB0qpvyBVq4CeYFVHe3t5wv3BM1Ta3X7RbDSyulEpRUiNZjBlQK7pDf62ajznrSAe+evSQvunzakrBQ== + + + + + KLUv/WCARRUIANIEDhigRa0BQ/Q7R/1PsR/MPm2z0rW2E5CaSAF3bMIsV1J77ry5tED4oDjxQam7jR15GE8B0aFV8PXATaBgbbV0gAIUiIjIcQ60HM0oqqweBdaQKlwM1t8qpJZ8tB1EMyqotCNCvamRnuRifF+MubDcIJ1XDxT2Dk2sGSCCbmjVF90Y3KEoKuyI0JoBkXSjVCsddwC1S4ocQUr6N/Q3mAJ9d6or3KrVk3AMw9j/AKvg1Qj5Vxzki1QZxqrbTl1K3FCJ/5Lc4JzPwKsSN+cBgD8c4+5imZRt4gscA6U5ZtMLqm/ED7qsETDJqarCYgqXJ/PkyFVHIrHjagYEG3EVjOLjEQ== + + + + + KLUv/WCARXUAABgANwACALtARV6C3bEB + + + + + KLUv/WCARRUCAHgAa2sjADcAIzdLIiIiSkoUoMD4AUCDbgcmhQw6tZMClhqiTQoZdCqUCkMFg6qbwA28Xqj2RbVDFeykwP8N4YEe+Q== + + + + + + diff --git a/godot/levels/level01.tmx.import b/godot/levels/Level2.tmx.import similarity index 52% rename from godot/levels/level01.tmx.import rename to godot/levels/Level2.tmx.import index b5b61e8..b3d3559 100644 --- a/godot/levels/level01.tmx.import +++ b/godot/levels/Level2.tmx.import @@ -2,12 +2,12 @@ importer="vnen.tiled_importer" type="PackedScene" -path="res://.import/level01.tmx-65e129bada03d3bf56997e5be6fa923f.scn" +path="res://.import/Level2.tmx-357d8ae9edfbc85f5abb1db3655640e1.scn" [deps] -source_file="res://levels/level01.tmx" -dest_files=[ "res://.import/level01.tmx-65e129bada03d3bf56997e5be6fa923f.scn" ] +source_file="res://levels/Level2.tmx" +dest_files=[ "res://.import/Level2.tmx-357d8ae9edfbc85f5abb1db3655640e1.scn" ] [params] @@ -15,7 +15,8 @@ custom_properties=true tile_metadata=false uv_clip=true image_flags=7 -collision_layer=1 +collision_layer=2 +collision_mask=0 embed_internal_images=false save_tiled_properties=false add_background=true diff --git a/godot/levels/Level2.tscn b/godot/levels/Level2.tscn new file mode 100644 index 0000000..13c3651 --- /dev/null +++ b/godot/levels/Level2.tscn @@ -0,0 +1,41 @@ +[gd_scene load_steps=5 format=2] + +[ext_resource path="res://camera_fix.gd" type="Script" id=1] +[ext_resource path="res://characters/player/Player.tscn" type="PackedScene" id=2] +[ext_resource path="res://assets/backgrounds/hills.png" type="Texture" id=3] +[ext_resource path="res://levels/Level2.tmx" type="PackedScene" id=4] + +[node name="Level2" type="Node2D"] + +[node name="Player" parent="." instance=ExtResource( 2 )] + +[node name="Camera2D" type="Camera2D" parent="Player"] +current = true +limit_left = 0 +limit_top = 0 +limit_right = 512 +limit_bottom = 288 +drag_margin_h_enabled = true +drag_margin_v_enabled = true +__meta__ = { +"_edit_bone_": true +} + +[node name="VisibilityNotifier2D" type="VisibilityNotifier2D" parent="Player/Camera2D"] +rect = Rect2( 0, 0, 24, 24 ) + +[node name="ParallaxBackground" type="ParallaxBackground" parent="."] + +[node name="ParallaxLayer" type="ParallaxLayer" parent="ParallaxBackground"] +motion_scale = Vector2( 0.2, 0.2 ) +motion_offset = Vector2( 0, -288 ) +motion_mirroring = Vector2( 528, 0 ) + +[node name="Sprite" type="Sprite" parent="ParallaxBackground/ParallaxLayer"] +texture = ExtResource( 3 ) +centered = false + +[node name="Map" type="Node2D" parent="."] + +[node name="Level2" parent="Map" instance=ExtResource( 4 )] +script = ExtResource( 1 ) diff --git a/godot/levels/Prototype.tmx b/godot/levels/Prototype.tmx new file mode 100644 index 0000000..f6fb3da --- /dev/null +++ b/godot/levels/Prototype.tmx @@ -0,0 +1,32 @@ + + + + + + KLUv/WAAP20GABJGERuQO3NNu/20rYOLBoDnsuAchA019DLxK+U5sBQXD6KYaA0XcxunI957cDBeOKEgOvTBn4dTNWcCdwc09eUKY6XJJY9c1zqg8NKSVMsBUEOFKdYBV6kkVDgVA3BBilMak5J1yoCMyj0pTslLSkdK+RTnkpnQVQNN3T4TMjcjhShwR5/KA0g5Y6hH5+zqPVRmKBFAXiWeXJ0jZMyAqV8hipb7ZS4Q7Kw8YFMCM6KKE9kOxg3OyikJ6rgpHUBFzquSdsAeB1W/S8WFGjA= + + + + + KLUv/WAAP00AAAgAAQD8H94JAQ== + + + + + KLUv/WAAP9UGAOIFEhyATVoDNMAhoPa22NTIGBKFNDIfHSIibyz03jMFm0ZJqPYRgbwFLkD8oBwO4LnaOOOxiaGTxBy9dyG5Yq3rvWsonHDwcssrATmgsFSmmgPAghTIiNpiJ4TqJc3SkwwJSg4APcRRfoOY1+s638xXEGVPdnihL1eyJmtrQfPoHCMEfDPBmKjZJOrT0aRrOHTPcMrOgmgE3lIzpHNOkOISUo0XouICnd+xyONUZ5iiAWnlRZv3ePaAQqUFU3r41eAPSOWeqo3U6/kpdKqp6QP0j4t4prLz73kK + + + + + KLUv/WAAP3UAABgAOAACABtBhdwc3rEB + + + + + KLUv/WAAP+UCAHgAIwA3AGtGNzgAWjduIkoioGD5EAMMXLoGfShQn+oDTEcRNepUmq0wC6aVCsZisJoIqwOgVkFZmtHmGW5aSpVU0I02zg9VHyYlztrUaaKrOaDf/arsQw06wA8U + + + + + + diff --git a/godot/levels/Prototype.tmx.import b/godot/levels/Prototype.tmx.import new file mode 100644 index 0000000..01f4b39 --- /dev/null +++ b/godot/levels/Prototype.tmx.import @@ -0,0 +1,23 @@ +[remap] + +importer="vnen.tiled_importer" +type="PackedScene" +path="res://.import/Prototype.tmx-1674122a110386791b767b1f6628b68b.scn" + +[deps] + +source_file="res://levels/Prototype.tmx" +dest_files=[ "res://.import/Prototype.tmx-1674122a110386791b767b1f6628b68b.scn" ] + +[params] + +custom_properties=true +tile_metadata=false +uv_clip=true +image_flags=7 +collision_layer=2 +collision_mask=0 +embed_internal_images=false +save_tiled_properties=false +add_background=true +post_import_script="" diff --git a/godot/Level1.tscn b/godot/levels/Prototype.tscn similarity index 59% rename from godot/Level1.tscn rename to godot/levels/Prototype.tscn index 4c3cddc..d33d09c 100644 --- a/godot/Level1.tscn +++ b/godot/levels/Prototype.tscn @@ -1,23 +1,22 @@ -[gd_scene load_steps=4 format=2] +[gd_scene load_steps=5 format=2] -[ext_resource path="res://assets/backgrounds/mountains.png" type="Texture" id=1] -[ext_resource path="res://levels/level01.tmx" type="PackedScene" id=3] -[ext_resource path="res://characters/player/Player.tscn" type="PackedScene" id=4] +[ext_resource path="res://camera_fix.gd" type="Script" id=1] +[ext_resource path="res://characters/player/Player.tscn" type="PackedScene" id=2] +[ext_resource path="res://levels/Prototype.tmx" type="PackedScene" id=3] +[ext_resource path="res://assets/backgrounds/mountains.png" type="Texture" id=4] -[node name="Level1" type="Node2D"] +[node name="Prototype" type="Node2D"] -[node name="Player" parent="." instance=ExtResource( 4 )] +[node name="Player" parent="." instance=ExtResource( 2 )] [node name="Camera2D" type="Camera2D" parent="Player"] current = true limit_left = 0 limit_top = 0 -limit_right = 2304 -limit_bottom = 576 +limit_right = 512 +limit_bottom = 288 drag_margin_h_enabled = true drag_margin_v_enabled = true -editor_draw_limits = true -editor_draw_drag_margin = true __meta__ = { "_edit_bone_": true } @@ -28,14 +27,15 @@ rect = Rect2( 0, 0, 24, 24 ) [node name="ParallaxBackground" type="ParallaxBackground" parent="."] [node name="ParallaxLayer" type="ParallaxLayer" parent="ParallaxBackground"] -motion_scale = Vector2( 0.2, 1 ) +motion_scale = Vector2( 0.2, 0.1 ) +motion_offset = Vector2( 0, -288 ) motion_mirroring = Vector2( 528, 0 ) [node name="Sprite" type="Sprite" parent="ParallaxBackground/ParallaxLayer"] -texture = ExtResource( 1 ) +texture = ExtResource( 4 ) centered = false [node name="Map" type="Node2D" parent="."] -position = Vector2( 0, 18 ) -[node name="level01" parent="Map" instance=ExtResource( 3 )] +[node name="Prototype" parent="Map" instance=ExtResource( 3 )] +script = ExtResource( 1 ) diff --git a/godot/levels/level01.tmx b/godot/levels/level01.tmx deleted file mode 100644 index 9bc5967..0000000 --- a/godot/levels/level01.tmx +++ /dev/null @@ -1,112 +0,0 @@ - - - - - -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0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,1,1,1,1,1,1,1,1,1, -1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, -1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, -1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, -1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, -1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, -2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, -3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3, -3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3, -3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3, -3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3, -3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3, -3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3, -3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3 - + + KLUv/WBAB50AADABAAAAAgMDAGRAJQSmm9e/IwI= + diff --git a/godot/parallax/hills.tmx b/godot/parallax/hills.tmx index bf732ab..5373dbb 100644 --- a/godot/parallax/hills.tmx +++ b/godot/parallax/hills.tmx @@ -2,31 +2,8 @@ - -10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10, -10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10, -10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10, -10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10, -10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10, -10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10, -10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10, -10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10, -10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10, -10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10, -10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10, -10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10, -10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10, -10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10, -10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10, -10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10, -11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11, -12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, -12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, -12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, -12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, -12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, -12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, -12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12 - + + KLUv/WBAB50AADAKAAAACwwDAGRAJQSmm9e/IwI= + diff --git a/godot/parallax/mountains.tmx b/godot/parallax/mountains.tmx index e963695..968553e 100644 --- a/godot/parallax/mountains.tmx +++ b/godot/parallax/mountains.tmx @@ -2,31 +2,8 @@ - -4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4, -4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,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,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9, -9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9, -9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9, -9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9 - + + KLUv/WBAB50AADAHAAAACAkDAGRAJQSmm9e/IwI= + diff --git a/godot/project.godot b/godot/project.godot index e1b9eb4..52b2be8 100644 --- a/godot/project.godot +++ b/godot/project.godot @@ -53,6 +53,18 @@ texture={ "stream": false, "svg/scale": 1.0 } +vnen.tiled_importer={ +"add_background": true, +"collision_layer": 2, +"collision_mask": 0, +"custom_properties": true, +"embed_internal_images": false, +"image_flags": 7, +"post_import_script": "", +"save_tiled_properties": false, +"tile_metadata": false, +"uv_clip": true +} [input] @@ -81,8 +93,8 @@ right={ [layer_names] -2d_physics/layer_1="Tiles" -2d_physics/layer_2="Player" +2d_physics/layer_1="Player" +2d_physics/layer_2="Tiles" [physics] diff --git a/godot/tilesets/backgrounds.tsx b/godot/tilesets/backgrounds.tsx index 1635d01..5e4097e 100644 --- a/godot/tilesets/backgrounds.tsx +++ b/godot/tilesets/backgrounds.tsx @@ -1,4 +1,5 @@ + diff --git a/godot/tilesets/tiles.tsx b/godot/tilesets/tiles.tsx index 7eb103a..547a5ff 100644 --- a/godot/tilesets/tiles.tsx +++ b/godot/tilesets/tiles.tsx @@ -1,5 +1,6 @@ + @@ -21,11 +22,56 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -46,11 +92,48 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -91,6 +174,12 @@ + + + + + + @@ -111,6 +200,17 @@ + + + + + + + + + + + @@ -131,6 +231,38 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -156,6 +288,27 @@ + + + + + + + + + + + + + + + + + + + + + @@ -176,6 +329,26 @@ + + + + + + + + + + + + + + + + + + + + @@ -196,4 +369,20 @@ + + + + + + + + + + + + + + + + From bc33004f7d03cd5f4830489d6ea190d5b007bcf0 Mon Sep 17 00:00:00 2001 From: Chris Cromer Date: Sat, 16 Apr 2022 16:03:41 -0400 Subject: [PATCH 30/42] remove object layer --- godot/levels/Level2.tmx | 3 --- godot/levels/Level2.tmx.import | 1 - 2 files changed, 4 deletions(-) diff --git a/godot/levels/Level2.tmx b/godot/levels/Level2.tmx index 4a5f162..5ba4922 100644 --- a/godot/levels/Level2.tmx +++ b/godot/levels/Level2.tmx @@ -26,7 +26,4 @@ KLUv/WCARRUCAHgAa2sjADcAIzdLIiIiSkoUoMD4AUCDbgcmhQw6tZMClhqiTQoZdCqUCkMFg6qbwA28Xqj2RbVDFeykwP8N4YEe+Q== - - - diff --git a/godot/levels/Level2.tmx.import b/godot/levels/Level2.tmx.import index b3d3559..0f2e4aa 100644 --- a/godot/levels/Level2.tmx.import +++ b/godot/levels/Level2.tmx.import @@ -16,7 +16,6 @@ tile_metadata=false uv_clip=true image_flags=7 collision_layer=2 -collision_mask=0 embed_internal_images=false save_tiled_properties=false add_background=true From 6c1ee2c12b62f538150c155766b7d8b6ec215ee7 Mon Sep 17 00:00:00 2001 From: Chris Cromer Date: Sat, 16 Apr 2022 17:20:45 -0400 Subject: [PATCH 31/42] make level dynamic from main --- godot/Main.tscn | 5 ++--- src/Main.cpp | 16 ++++++++++++++++ src/Main.h | 21 +++++++++++++++++++++ 3 files changed, 39 insertions(+), 3 deletions(-) diff --git a/godot/Main.tscn b/godot/Main.tscn index 84d446d..0b5ed2e 100644 --- a/godot/Main.tscn +++ b/godot/Main.tscn @@ -1,9 +1,8 @@ [gd_scene load_steps=3 format=2] [ext_resource path="res://Main.gdns" type="Script" id=1] -[ext_resource path="res://levels/Level2.tscn" type="PackedScene" id=2] +[ext_resource path="res://levels/Prototype.tscn" type="PackedScene" id=2] [node name="Main" type="Node"] script = ExtResource( 1 ) - -[node name="Level2" parent="." instance=ExtResource( 2 )] +level = ExtResource( 2 ) diff --git a/src/Main.cpp b/src/Main.cpp index 387ff6e..4f91c0c 100644 --- a/src/Main.cpp +++ b/src/Main.cpp @@ -9,6 +9,7 @@ void Main::_register_methods() { register_method("_ready", &Main::_ready); register_method("_physics_process", &Main::_physics_process); + register_property>("level", &Main::set_level, &Main::get_level, NULL, GODOT_METHOD_RPC_MODE_DISABLED, GODOT_PROPERTY_USAGE_DEFAULT, GODOT_PROPERTY_HINT_RESOURCE_TYPE, String("PackedScene")); register_property("full_screen", &Main::set_full_screen, &Main::get_full_screen, main::full_screen); register_property("window_size", &Main::set_window_size, &Main::get_window_size, main::window_size); register_property("launch_screen", &Main::set_launch_screen, &Main::get_launch_screen, main::launch_screen); @@ -45,6 +46,11 @@ void Main::_ready() _os->get_screen_position(get_launch_screen()) + _os->get_screen_size() * 0.5 - _os->get_window_size() * 0.5 ); } + + if (level != NULL) + { + add_child(level->instance()); + } } void Main::_physics_process(float delta) @@ -55,6 +61,16 @@ void Main::_physics_process(float delta) } } +void Main::set_level(Ref level) +{ + this->level = level; +} + +Ref Main::get_level() +{ + return this->level; +} + void Main::set_full_screen(bool full_screen) { this->full_screen = full_screen; diff --git a/src/Main.h b/src/Main.h index 4d86783..d89c5c9 100644 --- a/src/Main.h +++ b/src/Main.h @@ -5,6 +5,8 @@ #include #include #include +#include +#include /** * @brief This is the godot namespace for all the code included in the library. @@ -57,6 +59,11 @@ namespace godot */ Input *_input; + /** + * @brief The first level to load + * + */ + Ref level; /** * @brief If the window is full screen or not. * @@ -116,6 +123,20 @@ namespace godot */ void _physics_process(float delta); + /** + * @brief Set the level object. + * + * @param[in] level The new level to load when starting. + */ + void set_level(Ref level); + + /** + * @brief Get the level object. + * + * @return Ref The level scene to load. + */ + Ref get_level(); + /** * @brief Set the full screen object. * From db51a218ec2766939b84f4d31e28a1666671ca93 Mon Sep 17 00:00:00 2001 From: Chris Cromer Date: Sat, 16 Apr 2022 15:54:05 -0400 Subject: [PATCH 32/42] improve error messages and checking --- src/state_machine/State.cpp | 4 +- src/state_machine/StateMachine.cpp | 102 +++++++++++++++++++++++++---- src/state_machine/StateMachine.h | 34 ++++++---- 3 files changed, 113 insertions(+), 27 deletions(-) diff --git a/src/state_machine/State.cpp b/src/state_machine/State.cpp index 29efa48..2763449 100644 --- a/src/state_machine/State.cpp +++ b/src/state_machine/State.cpp @@ -25,12 +25,12 @@ void State::_init() void State::_state_enter(const String state, const Array args) { - WARN_PRINT("State " + state + " is missing its _state_enter method!"); + WARN_PRINT("State " + get_state_machine()->get_current_state() + " is missing its _state_enter method!"); } void State::_state_exit(const String state, const Array args) { - WARN_PRINT("State " + state + " is missing its _state_exit method!"); + WARN_PRINT("State " + get_state_machine()->get_current_state() + " is missing its _state_exit method!"); } void State::set_parent(Node *parent) diff --git a/src/state_machine/StateMachine.cpp b/src/state_machine/StateMachine.cpp index 4370842..73b1f9d 100644 --- a/src/state_machine/StateMachine.cpp +++ b/src/state_machine/StateMachine.cpp @@ -34,7 +34,15 @@ void StateMachine::_ready() connect("tree_entered", this, "_on_StateMachine_tree_entered"); connect("tree_exiting", this, "_on_StateMachine_tree_exiting"); parent = get_parent(); - set_current_state(get_default_state()); + add_states(); + if (has(get_default_state())) + { + set_current_state(get_default_state()); + } + else + { + WARN_PRINT("The selected default state " + get_default_state() + " doesn't exist!"); + } setup(); } @@ -46,13 +54,13 @@ void StateMachine::setup() { if (children.size() > 0) { - WARN_PRINT("State machine doesn't have a default state set, using first child!"); + WARN_PRINT("The state machine doesn't have a default state set, using first child!"); auto child = Object::cast_to(children[0].operator Object*()); set_current_state(child->get_name()); } else { - ERR_PRINT("State machine doesn't have a default state set and has no child states!"); + ERR_PRINT("The state machine doesn't have a default state set and has no child states!"); return; } } @@ -60,7 +68,6 @@ void StateMachine::setup() for (uint8_t i = 0; i < children.size(); i++) { auto child = Object::cast_to(children[i].operator Object*()); - add_state(child->get_name(), child); child->call("set_state_machine", this); @@ -72,7 +79,24 @@ void StateMachine::setup() } } - this->call("_state_enter", get_current_state()); + Node *state_node = Object::cast_to(this->states[get_current_state()]); + if (state_node->has_method("_state_enter")) + { + this->call("_state_enter", get_current_state()); + } + else { + WARN_PRINT("The state " + get_current_state() + " doesn't have a _state_enter method!"); + } +} + +void StateMachine::add_states() +{ + auto children = get_children(); + for (uint8_t i = 0; i < children.size(); i++) + { + auto child = Object::cast_to(children[i].operator Object*()); + add_state(child->get_name(), child); + } } void StateMachine::add_state(const String state, Node *child) @@ -111,8 +135,31 @@ void StateMachine::change(const String state, const Array &args) return this->restart(state, args); } + if (!has(state)) + { + WARN_PRINT("The state " + state + " does not exist, called from state " + get_current_state() + "!"); + return; + } + auto previous_state = get_current_state(); - auto exiting = this->call("_state_exit", state, args); + + Variant exiting; + Node *state_node = Object::cast_to(this->states[previous_state]); + if (state_node) + { + if (state_node->has_method("_state_exit")) + { + exiting = this->call("_state_exit", state, args); + } + else + { + WARN_PRINT("The state " + get_current_state() + " doesn't have a _state_exit method!"); + } + } + else + { + ERR_PRINT("Could not get current state node for " + get_current_state() + "!"); + } if (get_current_state() != "") { @@ -132,7 +179,23 @@ void StateMachine::change(const String state, const Array &args) auto child = Object::cast_to(states[get_current_state()].operator Object*()); this->add_child(child); - this->call("_state_enter", previous_state, args); + state_node = Object::cast_to(this->states[get_current_state()]); + if (state_node) + { + if (state_node->has_method("_state_enter")) + { + this->call("_state_enter", previous_state, args); + } + else + { + WARN_PRINT("The state " + get_current_state() + " doesn't have a _state_enter method!"); + } + } + else + { + ERR_PRINT("Could not get current state node for " + get_current_state() + "!"); + } + this->emit_signal("state_entered", get_current_state()); if (debug) { @@ -143,11 +206,23 @@ void StateMachine::change(const String state, const Array &args) Variant StateMachine::call(const String method, const Array &args) { auto node = Object::cast_to(states[get_current_state()].operator Object*()); - if (node != nullptr) + if (node) { - return node->call(method, args); + if (node->has_method(method)) + { + return node->call(method, args); + } + else + { + WARN_PRINT("The state " + get_current_state() + " doesn't contain the method " + method + "!"); + return Variant(); + } + } + else + { + ERR_PRINT("Could not get current state node for " + get_current_state() + "!"); + return Variant(); } - return Variant(); } Variant StateMachine::_call(const String method, const Array &args) @@ -196,7 +271,7 @@ void StateMachine::_on_StateMachine_tree_exiting() for (uint8_t i = 0; i < keys.size(); i++) { auto child = Object::cast_to(states[keys[i]].operator Object*()); - if (child != nullptr) + if (child) { auto children = get_children(); if (!children.has(child)) @@ -204,5 +279,10 @@ void StateMachine::_on_StateMachine_tree_exiting() this->add_child(child); } } + else + { + ERR_PRINT("Could not get child node!"); + return; + } } } diff --git a/src/state_machine/StateMachine.h b/src/state_machine/StateMachine.h index 02789ba..0fdb8d7 100644 --- a/src/state_machine/StateMachine.h +++ b/src/state_machine/StateMachine.h @@ -43,6 +43,12 @@ namespace godot */ Dictionary states; + /** + * @brief This adds all nodes of the states machine as states in the machine. + * + */ + void add_states(); + /** * @brief This adds a state to the list of states in the state machine. * @@ -51,6 +57,13 @@ namespace godot */ void add_state(const String state, Node *child); + /** + * @brief Set the current state object. + * + * @param[in] current_state The current state that is running. + */ + void set_current_state(const String current_state); + public: /** * @brief This method registers classes with Godot. @@ -157,6 +170,13 @@ namespace godot */ String get_default_state(); + /** + * @brief Get the current state object. + * + * @return String The current running state. + */ + String get_current_state(); + /** * @brief Set the debug object. * @@ -172,20 +192,6 @@ namespace godot */ bool get_debug(); - /** - * @brief Set the current state object. - * - * @param[in] current_state The current state that is running. - */ - void set_current_state(const String current_state); - - /** - * @brief Get the current state object. - * - * @return String The current running state. - */ - String get_current_state(); - /** * @brief This method is called when the signal tree_entered is emitted. * From c803a62a01393a2957ef32f04a97ccddba02db16 Mon Sep 17 00:00:00 2001 From: Chris Cromer Date: Wed, 13 Apr 2022 11:23:20 -0400 Subject: [PATCH 33/42] rename tiled file name --- ...juego.tiled-project => alai.tiled-project} | 0 godot/juego.tiled-session | 285 ------------------ 2 files changed, 285 deletions(-) rename godot/{juego.tiled-project => alai.tiled-project} (100%) delete mode 100644 godot/juego.tiled-session diff --git a/godot/juego.tiled-project b/godot/alai.tiled-project similarity index 100% rename from godot/juego.tiled-project rename to godot/alai.tiled-project diff --git a/godot/juego.tiled-session b/godot/juego.tiled-session deleted file mode 100644 index 9b2b07d..0000000 --- a/godot/juego.tiled-session +++ /dev/null @@ -1,285 +0,0 @@ -{ - "Map/SizeTest": { - "height": 4300, - "width": 2 - }, - "activeFile": "levels/level01.tmx", - "expandedProjectPaths": [ - "tilesets", - "levels", - ".", - "parallax" - ], - "exportAsImage.useCurrentScale": false, - "file.lastUsedOpenFilter": "All Files (*)", - "fileStates": { - "": { - "scaleInDock": 1 - }, - "#backgrounds": { - "scaleInDock": 1 - }, - "/home/cromer/projects/edx/games/azaraka/misc/new-graphics/tf_darkdimension_updated2020/RMMV/tf_dd_B_3.tsx": { - "scaleInDock": 1, - "scaleInEditor": 1 - }, - "/home/cromer/projects/edx/games/azaraka/misc/new-graphics/tf_darkdimension_updated2020/dd_waterfall_sheet.tsx": { - "scaleInDock": 1, - "scaleInEditor": 2 - }, - "/home/cromer/projects/edx/games/azaraka/misc/new-graphics/tf_darkdimension_updated2020/tf_darkdimension_sheet.tsx": { - "scaleInDock": 2, - "scaleInEditor": 2 - }, - "/home/cromer/projects/edx/games/azaraka/misc/new-graphics/tf_darkdimension_updated2020/untitled.tmx": { - "scale": 2, - "selectedLayer": 3, - "viewCenter": { - "x": 465.75, - "y": 233.5 - } - }, - "/home/cromer/tilemaps/Dungeon.tsx": { - "scaleInDock": 1, - "scaleInEditor": 1 - }, - "/home/cromer/tilemaps/Grassland.tsx": { - "scaleInDock": 1, - "scaleInEditor": 1 - }, - "/home/cromer/tilemaps/dungeon_entrance.tmx": { - "scale": 0.53140625, - "selectedLayer": 0, - "viewCenter": { - "x": 902.3228462216996, - "y": 825.1690679211997 - } - }, - "/home/cromer/tilemaps/untitled.tmx": { - "scale": 0.53140625, - "selectedLayer": 1, - "viewCenter": { - "x": 798.8238753307851, - "y": 798.8238753307851 - } - }, - "/mnt/data/godot/projects/Azaraka/maps/cloud_city.tsx": { - "scaleInDock": 0.5 - }, - "/mnt/data/godot/projects/Azaraka/maps/dungeon1.tmx": { - "scale": 0.75, - "selectedLayer": 0, - "viewCenter": { - "x": 1209.3333333333333, - "y": 672 - } - }, - "/mnt/data/godot/projects/Azaraka/maps/shadowset.tsx": { - "scaleInDock": 1 - }, - "/mnt/data/godot/projects/Azaraka/maps/terrain.tsx": { - "scaleInDock": 0.75 - }, - "/mnt/data/godot/projects/Azaraka/maps/worldmap.tmx": { - "scale": 0.03125, - "selectedLayer": 0, - "viewCenter": { - "x": 10496, - "y": 2592 - } - }, - "/mnt/data/godot/projects/Azaraka/maps/worldmap.tsx": { - "scaleInDock": 0.33 - }, - "/mnt/data/godot/projects/Platformer/asset/spritesheet_ground.tsx": { - "scaleInDock": 0.125, - "scaleInEditor": 0.75 - }, - "/mnt/data/godot/projects/Platformer/asset/world.tmx": { - "scale": 0.5, - "selectedLayer": 0, - "viewCenter": { - "x": 1326, - "y": 1210 - } - }, - "/mnt/data/godot/projects/Platformer/asset/world1.tmx": { - "scale": 0.5714843749999999, - "selectedLayer": 0, - "viewCenter": { - "x": 640.4374572795626, - "y": 640.4374572795626 - } - }, - "/mnt/data/projects/edx/games/azaraka/maps/tilesets/grassland_shadows.tsx": { - "scaleInDock": 1 - }, - "/mnt/data/projects/edx/games/azaraka/maps/tilesets/grassland_spring.tsx": { - "scaleInDock": 1 - }, - "/mnt/data/projects/edx/games/azaraka/maps/tilesets/grassland_spring_water.tsx": { - "scaleInDock": 1 - }, - "/mnt/data/projects/edx/games/azaraka/maps/tilesets/grassland_spring_waterfall.tsx": { - "scaleInDock": 1 - }, - "/mnt/data/projects/edx/games/project/graphics/dungeon.tsx": { - "scaleInDock": 1, - "scaleInEditor": 1.5 - }, - "/mnt/data/projects/edx/games/project/graphics/dungeon_entrance.tmx": { - "scale": 1, - "selectedLayer": 3, - "viewCenter": { - "x": 320, - "y": 175.5 - } - }, - "/mnt/data/projects/edx/games/project/graphics/flame.tsx": { - "scaleInDock": 1, - "scaleInEditor": 1 - }, - "/mnt/data/projects/edx/games/project/graphics/grassland.tsx": { - "scaleInDock": 1, - "scaleInEditor": 1 - }, - "/mnt/data/projects/edx/games/project/graphics/house.tsx": { - "scaleInDock": 1, - "scaleInEditor": 1 - }, - "/mnt/data/projects/edx/games/project/graphics/town.tsx": { - "scaleInDock": 1, - "scaleInEditor": 1 - }, - "/mnt/data/projects/edx/games/project/maps/dungeon.tsx": { - "scaleInDock": 1, - "scaleInEditor": 1 - }, - "/mnt/data/projects/edx/games/project/maps/dungeon/dungeon.tsx": { - "scaleInDock": 1 - }, - "/mnt/data/projects/edx/games/project/maps/dungeon/entrance.tmx": { - "scale": 1.3329687499999998, - "selectedLayer": 4, - "viewCenter": { - "x": 320.3375923103974, - "y": 176.67330910795923 - } - }, - "/mnt/data/projects/edx/games/project/maps/dungeon/entrance.tmx#dungeon": { - "scaleInDock": 1, - "scaleInEditor": 1 - }, - "/mnt/data/projects/edx/games/project/maps/entrance.tmx": { - "scale": 1.3332386363636362, - "selectedLayer": 4, - "viewCenter": { - "x": 292.89580225868315, - "y": 116.25825697847861 - } - }, - "/mnt/data/projects/edx/games/project/maps/grassland.tsx": { - "scaleInDock": 1, - "scaleInEditor": 1.5 - }, - "/mnt/data/projects/edx/games/project/maps/outside_entrance.tmx": { - "scale": 1.3332386363636362, - "selectedLayer": 0, - "viewCenter": { - "x": 320.64777327935224, - "y": -69.00490091625824 - } - }, - "/mnt/data/projects/edx/games/project/maps/tilesets/dungeon.tsx": { - "scaleInDock": 1, - "scaleInEditor": 1 - }, - "/mnt/data/projects/edx/games/project/maps/tilesets/grassland.tsx": { - "scaleInDock": 1, - "scaleInEditor": 1 - }, - "levels/level01.tmx": { - "scale": 0.75, - "selectedLayer": 1, - "viewCenter": { - "x": 544, - "y": 248 - } - }, - "parallax/clouds.tmx": { - "scale": 0.9252604166666667, - "selectedLayer": 0, - "viewCenter": { - "x": 264.790318041092, - "y": 384.7565437658316 - } - }, - "parallax/hills.tmx": { - "scale": 0.9252604166666667, - "selectedLayer": 0, - "viewCenter": { - "x": 264.790318041092, - "y": 384.7565437658316 - } - }, - "parallax/snow.tmx": { - "scale": 0.9252604166666667, - "selectedLayer": 0, - "viewCenter": { - "x": 264.790318041092, - "y": 384.7565437658316 - } - }, - "tilesets/backgrounds.tsx": { - "scaleInDock": 3, - "scaleInEditor": 4 - }, - "tilesets/tiles.tsx": { - "scaleInDock": 2, - "scaleInEditor": 2 - } - }, - "frame.defaultDuration": 300, - "last.exportedFilePath": "/mnt/data/godot/projects/Platformer", - "last.imagePath": "/mnt/data/godot/projects/juego/godot/assets/backgrounds", - "lastUsedTilesetExportFilter": "Godot Tileset format (*.tres)", - "loadedWorlds": [ - "/home/cromer/projects/edx/games/project/maps/azaraka" - ], - "map.fixedSize": true, - "map.height": 12, - "map.lastUsedExportFilter": "Godot Tilemap format (*.tscn)", - "map.lastUsedFormat": "tmx", - "map.tileHeight": 24, - "map.tileWidth": 24, - "map.width": 22, - "openFiles": [ - "tilesets/tiles.tsx", - "levels/level01.tmx" - ], - "project": "juego.tiled-project", - "property.type": "int", - "recentFiles": [ - "tilesets/tiles.tsx", - "levels/level01.tmx", - "tilesets/backgrounds.tsx", - "parallax/snow.tmx", - "parallax/hills.tmx", - "/mnt/data/godot/projects/Azaraka/maps/worldmap.tsx", - "/mnt/data/godot/projects/Azaraka/maps/worldmap.tmx", - "/mnt/data/godot/projects/Platformer/asset/world1.tmx", - "/mnt/data/godot/projects/Platformer/asset/spritesheet_ground.tsx", - "/mnt/data/godot/projects/Platformer/asset/world.tmx", - "/mnt/data/godot/projects/Azaraka/maps/dungeon1.tmx", - "/mnt/data/projects/edx/games/azaraka/maps/outside_entrance.tmx" - ], - "tileset.embedInMap": false, - "tileset.lastUsedFilter": "Tiled tileset files (*.tsx *.xml)", - "tileset.lastUsedFormat": "tsx", - "tileset.tileSize": { - "height": 24, - "width": 24 - }, - "tileset.transparentColor": "#000000", - "tileset.useTransparentColor": false -} From dff7c7b78bb3d215b87cc7f1de0f46c7c507c1e9 Mon Sep 17 00:00:00 2001 From: Chris Cromer Date: Wed, 13 Apr 2022 11:23:59 -0400 Subject: [PATCH 34/42] ignore tiled session files --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index b2b3eca..420d650 100644 --- a/.gitignore +++ b/.gitignore @@ -40,3 +40,5 @@ compile_commands.json # docs docs/ +# tiled session files +*.tiled-session From 825e3093727f5408cb5657516fb11a3c56df3cd3 Mon Sep 17 00:00:00 2001 From: Chris Cromer Date: Sat, 16 Apr 2022 14:19:59 -0400 Subject: [PATCH 35/42] add zstd support and fix a bug --- .../tiled_import_plugin.gd | 5 ++ .../vnen.tiled_importer/tiled_map_reader.gd | 49 +++++++++++-------- .../vnen.tiled_importer/tiled_xml_to_dict.gd | 4 +- 3 files changed, 35 insertions(+), 23 deletions(-) diff --git a/godot/addons/vnen.tiled_importer/tiled_import_plugin.gd b/godot/addons/vnen.tiled_importer/tiled_import_plugin.gd index 4c5ee10..2612766 100644 --- a/godot/addons/vnen.tiled_importer/tiled_import_plugin.gd +++ b/godot/addons/vnen.tiled_importer/tiled_import_plugin.gd @@ -84,6 +84,11 @@ func get_import_options(preset): "default_value": 1, "property_hint": PROPERTY_HINT_LAYERS_2D_PHYSICS }, + { + "name": "collision_mask", + "default_value": 1, + "property_hint": PROPERTY_HINT_LAYERS_2D_PHYSICS + }, { "name": "embed_internal_images", "default_value": true if preset == PRESET_PIXEL_ART else false diff --git a/godot/addons/vnen.tiled_importer/tiled_map_reader.gd b/godot/addons/vnen.tiled_importer/tiled_map_reader.gd index 7a279a7..e488456 100644 --- a/godot/addons/vnen.tiled_importer/tiled_map_reader.gd +++ b/godot/addons/vnen.tiled_importer/tiled_map_reader.gd @@ -211,12 +211,12 @@ func make_layer(layer, parent, root, data): var opacity = float(layer.opacity) if "opacity" in layer else 1.0 var visible = bool(layer.visible) if "visible" in layer else true - + var z_index = 0 - + if "properties" in layer and "z_index" in layer.properties: z_index = layer.properties.z_index - + if layer.type == "tilelayer": var layer_size = Vector2(int(layer.width), int(layer.height)) var tilemap = TileMap.new() @@ -231,6 +231,7 @@ func make_layer(layer, parent, root, data): tilemap.cell_y_sort = true tilemap.cell_tile_origin = TileMap.TILE_ORIGIN_BOTTOM_LEFT tilemap.collision_layer = options.collision_layer + tilemap.collision_mask = options.collision_mask tilemap.z_index = z_index var offset = Vector2() @@ -280,7 +281,7 @@ func make_layer(layer, parent, root, data): var gid = int_id & ~(FLIPPED_HORIZONTALLY_FLAG | FLIPPED_VERTICALLY_FLAG | FLIPPED_DIAGONALLY_FLAG) var cell_x = cell_offset.x + chunk.x + (count % int(chunk.width)) - var cell_y = cell_offset.y + chunk.y + int(count / chunk.width) + var cell_y = cell_offset.y + chunk.y + int(count / chunk.width) + 1 tilemap.set_cell(cell_x, cell_y, gid, flipped_h, flipped_v, flipped_d) count += 1 @@ -702,26 +703,26 @@ func build_tileset_for_scene(tilesets, source_path, options): var i = 0 var column = 0 - + # Needed to look up textures for animations var tileRegions = [] while i < tilecount: var tilepos = Vector2(x, y) var region = Rect2(tilepos, tilesize) - + tileRegions.push_back(region) - + column += 1 i += 1 - + x += int(tilesize.x) + spacing if (columns > 0 and column >= columns) or x >= int(imagesize.x) - margin or (x + int(tilesize.x)) > int(imagesize.x): x = margin y += int(tilesize.y) + spacing column = 0 - + i = 0 - + while i < tilecount: var region = tileRegions[i] @@ -778,7 +779,7 @@ func build_tileset_for_scene(tilesets, source_path, options): result.tile_set_texture(gid, image) if options.apply_offset: result.tile_set_texture_offset(gid, Vector2(0, -image.get_height())) - + if "tiles" in ts and rel_id in ts.tiles and "objectgroup" in ts.tiles[rel_id] \ and "objects" in ts.tiles[rel_id].objectgroup: for object in ts.tiles[rel_id].objectgroup.objects: @@ -803,10 +804,10 @@ func build_tileset_for_scene(tilesets, source_path, options): result.tile_set_occluder_offset(gid, offset) else: result.tile_add_shape(gid, shape, Transform2D(0, offset), object.type == "one-way") - + if "properties" in ts and "custom_material" in ts.properties: result.tile_set_material(gid, load(ts.properties.custom_material)) - + if options.custom_properties and options.tile_metadata and "tileproperties" in ts \ and "tilepropertytypes" in ts and rel_id in ts.tileproperties and rel_id in ts.tilepropertytypes: tile_meta[gid] = get_custom_properties(ts.tileproperties[rel_id], ts.tilepropertytypes[rel_id]) @@ -815,7 +816,7 @@ func build_tileset_for_scene(tilesets, source_path, options): if property in ts.tiles[rel_id]: if not gid in tile_meta: tile_meta[gid] = {} tile_meta[gid][property] = ts.tiles[rel_id][property] - + gid += 1 i += 1 @@ -1047,13 +1048,19 @@ func is_convex(vertices): return true # Decompress the data of the layer -# Compression argument is a string, either "gzip" or "zlib" +# Compression argument is a string, either "gzip", "zlib", or "zstd" func decompress_layer_data(layer_data, compression, map_size): - if compression != "gzip" and compression != "zlib": - print_error("Unrecognized compression format: %s" % [compression]) - return ERR_INVALID_DATA - - var compression_type = File.COMPRESSION_DEFLATE if compression == "zlib" else File.COMPRESSION_GZIP + var compression_type = -1 + match compression: + "zlib": + compression_type = File.COMPRESSION_DEFLATE + "gzip": + compression_type = File.COMPRESSION_GZIP + "zstd": + compression_type = File.COMPRESSION_ZSTD + _: + print_error("Unrecognized compression format: %s" % [compression]) + return ERR_INVALID_DATA var expected_size = int(map_size.x) * int(map_size.y) * 4 var raw_data = Marshalls.base64_to_raw(layer_data).decompress(expected_size, compression_type) @@ -1220,7 +1227,7 @@ func validate_layer(layer): print_error("Invalid data layer property.") return ERR_INVALID_DATA if "compression" in layer: - if layer.compression != "gzip" and layer.compression != "zlib": + if layer.compression != "gzip" and layer.compression != "zlib" and layer.compression != "zstd": print_error("Invalid compression type.") return ERR_INVALID_DATA "imagelayer": diff --git a/godot/addons/vnen.tiled_importer/tiled_xml_to_dict.gd b/godot/addons/vnen.tiled_importer/tiled_xml_to_dict.gd index 9064b90..a800f0b 100644 --- a/godot/addons/vnen.tiled_importer/tiled_xml_to_dict.gd +++ b/godot/addons/vnen.tiled_importer/tiled_xml_to_dict.gd @@ -247,7 +247,7 @@ func parse_tile_data(parser): var prop_data = parse_properties(parser) data["properties"] = prop_data.properties data["propertytypes"] = prop_data.propertytypes - + elif parser.get_node_name() == "animation": var frame_list = [] var err2 = parser.read() @@ -265,7 +265,7 @@ func parse_tile_data(parser): if parser.get_node_name() == "animation": break err2 = parser.read() - + data["animation"] = frame_list err = parser.read() From ef4ec86071c5adcec3fc33bc2317daa114e74370 Mon Sep 17 00:00:00 2001 From: Chris Cromer Date: Sat, 16 Apr 2022 14:21:15 -0400 Subject: [PATCH 36/42] update maps and tilesets --- godot/Main.tscn | 4 +- godot/camera_fix.gd | 10 + godot/characters/player/Player.tscn | 1 + godot/levels/Level2.tmx | 32 +++ .../{level01.tmx.import => Level2.tmx.import} | 9 +- godot/levels/Level2.tscn | 41 ++++ godot/levels/Prototype.tmx | 32 +++ godot/levels/Prototype.tmx.import | 23 +++ godot/{Level1.tscn => levels/Prototype.tscn} | 28 +-- godot/levels/level01.tmx | 112 ----------- godot/parallax/clouds.tmx | 29 +-- godot/parallax/hills.tmx | 29 +-- godot/parallax/mountains.tmx | 29 +-- godot/parallax/snow.tmx | 29 +-- godot/project.godot | 16 +- godot/tilesets/backgrounds.tsx | 1 + godot/tilesets/tiles.tsx | 189 ++++++++++++++++++ 17 files changed, 376 insertions(+), 238 deletions(-) create mode 100644 godot/camera_fix.gd create mode 100644 godot/levels/Level2.tmx rename godot/levels/{level01.tmx.import => Level2.tmx.import} (52%) create mode 100644 godot/levels/Level2.tscn create mode 100644 godot/levels/Prototype.tmx create mode 100644 godot/levels/Prototype.tmx.import rename godot/{Level1.tscn => levels/Prototype.tscn} (59%) delete mode 100644 godot/levels/level01.tmx diff --git a/godot/Main.tscn b/godot/Main.tscn index d264a5c..84d446d 100644 --- a/godot/Main.tscn +++ b/godot/Main.tscn @@ -1,9 +1,9 @@ [gd_scene load_steps=3 format=2] [ext_resource path="res://Main.gdns" type="Script" id=1] -[ext_resource path="res://Level1.tscn" type="PackedScene" id=2] +[ext_resource path="res://levels/Level2.tscn" type="PackedScene" id=2] [node name="Main" type="Node"] script = ExtResource( 1 ) -[node name="Level1" parent="." instance=ExtResource( 2 )] +[node name="Level2" parent="." instance=ExtResource( 2 )] diff --git a/godot/camera_fix.gd b/godot/camera_fix.gd new file mode 100644 index 0000000..31ad05f --- /dev/null +++ b/godot/camera_fix.gd @@ -0,0 +1,10 @@ +extends Node2D + + +# Called when the node enters the scene tree for the first time. +func _ready() -> void: + var used_rect = get_node("Middleground").get_used_rect() + var bounds = Vector2(used_rect.position.x + used_rect.size.x, used_rect.position.y + used_rect.size.y - 1) + var camera : Camera2D = $"../../Player/Camera2D" + camera.limit_right = bounds.x * get_node("Middleground").cell_size.x + camera.limit_bottom = bounds.y * get_node("Middleground").cell_size.y diff --git a/godot/characters/player/Player.tscn b/godot/characters/player/Player.tscn index fd71fe2..fd14612 100644 --- a/godot/characters/player/Player.tscn +++ b/godot/characters/player/Player.tscn @@ -12,6 +12,7 @@ extents = Vector2( 7, 12 ) [node name="Player" type="KinematicBody2D"] +collision_mask = 2 script = ExtResource( 5 ) [node name="AnimatedSprite" type="AnimatedSprite" parent="."] diff --git a/godot/levels/Level2.tmx b/godot/levels/Level2.tmx new file mode 100644 index 0000000..4a5f162 --- /dev/null +++ b/godot/levels/Level2.tmx @@ -0,0 +1,32 @@ + + + + + + KLUv/WCARXUAABgAdQACAH8FesSH8I4N + + + + + KLUv/WCAReUHAMJFERyAa1oDcI3yNgxLrJADMYGMt1VK3WqlViu1WtMUj4khBhdcZJCFAKFxxnPnTUDFDzcs6dEhpRLMlytV2+7O8VvXySWPBFSgUI9lOjCDESmJ0wEFUDBH6aMKnaYbqE3TeZHUEB8pcQNNOxDfKqik4dIamYl9N6jbSwMvVRqDzrlB7c8GUWKOC6sUzQEVzzPO4IgxtKAog6tu1FTgDVN/nN++tBeZA0EN5xk1db0sksKmrmbykTr0A63DDawOgUagB0qpvyBVq4CeYFVHe3t5wv3BM1Ta3X7RbDSyulEpRUiNZjBlQK7pDf62ajznrSAe+evSQvunzakrBQ== + + + + + KLUv/WCARRUIANIEDhigRa0BQ/Q7R/1PsR/MPm2z0rW2E5CaSAF3bMIsV1J77ry5tED4oDjxQam7jR15GE8B0aFV8PXATaBgbbV0gAIUiIjIcQ60HM0oqqweBdaQKlwM1t8qpJZ8tB1EMyqotCNCvamRnuRifF+MubDcIJ1XDxT2Dk2sGSCCbmjVF90Y3KEoKuyI0JoBkXSjVCsddwC1S4ocQUr6N/Q3mAJ9d6or3KrVk3AMw9j/AKvg1Qj5Vxzki1QZxqrbTl1K3FCJ/5Lc4JzPwKsSN+cBgD8c4+5imZRt4gscA6U5ZtMLqm/ED7qsETDJqarCYgqXJ/PkyFVHIrHjagYEG3EVjOLjEQ== + + + + + KLUv/WCARXUAABgANwACALtARV6C3bEB + + + + + KLUv/WCARRUCAHgAa2sjADcAIzdLIiIiSkoUoMD4AUCDbgcmhQw6tZMClhqiTQoZdCqUCkMFg6qbwA28Xqj2RbVDFeykwP8N4YEe+Q== + + + + + + diff --git a/godot/levels/level01.tmx.import b/godot/levels/Level2.tmx.import similarity index 52% rename from godot/levels/level01.tmx.import rename to godot/levels/Level2.tmx.import index b5b61e8..b3d3559 100644 --- a/godot/levels/level01.tmx.import +++ b/godot/levels/Level2.tmx.import @@ -2,12 +2,12 @@ importer="vnen.tiled_importer" type="PackedScene" -path="res://.import/level01.tmx-65e129bada03d3bf56997e5be6fa923f.scn" +path="res://.import/Level2.tmx-357d8ae9edfbc85f5abb1db3655640e1.scn" [deps] -source_file="res://levels/level01.tmx" -dest_files=[ "res://.import/level01.tmx-65e129bada03d3bf56997e5be6fa923f.scn" ] +source_file="res://levels/Level2.tmx" +dest_files=[ "res://.import/Level2.tmx-357d8ae9edfbc85f5abb1db3655640e1.scn" ] [params] @@ -15,7 +15,8 @@ custom_properties=true tile_metadata=false uv_clip=true image_flags=7 -collision_layer=1 +collision_layer=2 +collision_mask=0 embed_internal_images=false save_tiled_properties=false add_background=true diff --git a/godot/levels/Level2.tscn b/godot/levels/Level2.tscn new file mode 100644 index 0000000..13c3651 --- /dev/null +++ b/godot/levels/Level2.tscn @@ -0,0 +1,41 @@ +[gd_scene load_steps=5 format=2] + +[ext_resource path="res://camera_fix.gd" type="Script" id=1] +[ext_resource path="res://characters/player/Player.tscn" type="PackedScene" id=2] +[ext_resource path="res://assets/backgrounds/hills.png" type="Texture" id=3] +[ext_resource path="res://levels/Level2.tmx" type="PackedScene" id=4] + +[node name="Level2" type="Node2D"] + +[node name="Player" parent="." instance=ExtResource( 2 )] + +[node name="Camera2D" type="Camera2D" parent="Player"] +current = true +limit_left = 0 +limit_top = 0 +limit_right = 512 +limit_bottom = 288 +drag_margin_h_enabled = true +drag_margin_v_enabled = true +__meta__ = { +"_edit_bone_": true +} + +[node name="VisibilityNotifier2D" type="VisibilityNotifier2D" parent="Player/Camera2D"] +rect = Rect2( 0, 0, 24, 24 ) + +[node name="ParallaxBackground" type="ParallaxBackground" parent="."] + +[node name="ParallaxLayer" type="ParallaxLayer" parent="ParallaxBackground"] +motion_scale = Vector2( 0.2, 0.2 ) +motion_offset = Vector2( 0, -288 ) +motion_mirroring = Vector2( 528, 0 ) + +[node name="Sprite" type="Sprite" parent="ParallaxBackground/ParallaxLayer"] +texture = ExtResource( 3 ) +centered = false + +[node name="Map" type="Node2D" parent="."] + +[node name="Level2" parent="Map" instance=ExtResource( 4 )] +script = ExtResource( 1 ) diff --git a/godot/levels/Prototype.tmx b/godot/levels/Prototype.tmx new file mode 100644 index 0000000..f6fb3da --- /dev/null +++ b/godot/levels/Prototype.tmx @@ -0,0 +1,32 @@ + + + + + + KLUv/WAAP20GABJGERuQO3NNu/20rYOLBoDnsuAchA019DLxK+U5sBQXD6KYaA0XcxunI957cDBeOKEgOvTBn4dTNWcCdwc09eUKY6XJJY9c1zqg8NKSVMsBUEOFKdYBV6kkVDgVA3BBilMak5J1yoCMyj0pTslLSkdK+RTnkpnQVQNN3T4TMjcjhShwR5/KA0g5Y6hH5+zqPVRmKBFAXiWeXJ0jZMyAqV8hipb7ZS4Q7Kw8YFMCM6KKE9kOxg3OyikJ6rgpHUBFzquSdsAeB1W/S8WFGjA= + + + + + KLUv/WAAP00AAAgAAQD8H94JAQ== + + + + + KLUv/WAAP9UGAOIFEhyATVoDNMAhoPa22NTIGBKFNDIfHSIibyz03jMFm0ZJqPYRgbwFLkD8oBwO4LnaOOOxiaGTxBy9dyG5Yq3rvWsonHDwcssrATmgsFSmmgPAghTIiNpiJ4TqJc3SkwwJSg4APcRRfoOY1+s638xXEGVPdnihL1eyJmtrQfPoHCMEfDPBmKjZJOrT0aRrOHTPcMrOgmgE3lIzpHNOkOISUo0XouICnd+xyONUZ5iiAWnlRZv3ePaAQqUFU3r41eAPSOWeqo3U6/kpdKqp6QP0j4t4prLz73kK + + + + + KLUv/WAAP3UAABgAOAACABtBhdwc3rEB + + + + + KLUv/WAAP+UCAHgAIwA3AGtGNzgAWjduIkoioGD5EAMMXLoGfShQn+oDTEcRNepUmq0wC6aVCsZisJoIqwOgVkFZmtHmGW5aSpVU0I02zg9VHyYlztrUaaKrOaDf/arsQw06wA8U + + + + + + diff --git a/godot/levels/Prototype.tmx.import b/godot/levels/Prototype.tmx.import new file mode 100644 index 0000000..01f4b39 --- /dev/null +++ b/godot/levels/Prototype.tmx.import @@ -0,0 +1,23 @@ +[remap] + +importer="vnen.tiled_importer" +type="PackedScene" +path="res://.import/Prototype.tmx-1674122a110386791b767b1f6628b68b.scn" + +[deps] + +source_file="res://levels/Prototype.tmx" +dest_files=[ "res://.import/Prototype.tmx-1674122a110386791b767b1f6628b68b.scn" ] + +[params] + +custom_properties=true +tile_metadata=false +uv_clip=true +image_flags=7 +collision_layer=2 +collision_mask=0 +embed_internal_images=false +save_tiled_properties=false +add_background=true +post_import_script="" diff --git a/godot/Level1.tscn b/godot/levels/Prototype.tscn similarity index 59% rename from godot/Level1.tscn rename to godot/levels/Prototype.tscn index 4c3cddc..d33d09c 100644 --- a/godot/Level1.tscn +++ b/godot/levels/Prototype.tscn @@ -1,23 +1,22 @@ -[gd_scene load_steps=4 format=2] +[gd_scene load_steps=5 format=2] -[ext_resource path="res://assets/backgrounds/mountains.png" type="Texture" id=1] -[ext_resource path="res://levels/level01.tmx" type="PackedScene" id=3] -[ext_resource path="res://characters/player/Player.tscn" type="PackedScene" id=4] +[ext_resource path="res://camera_fix.gd" type="Script" id=1] +[ext_resource path="res://characters/player/Player.tscn" type="PackedScene" id=2] +[ext_resource path="res://levels/Prototype.tmx" type="PackedScene" id=3] +[ext_resource path="res://assets/backgrounds/mountains.png" type="Texture" id=4] -[node name="Level1" type="Node2D"] +[node name="Prototype" type="Node2D"] -[node name="Player" parent="." instance=ExtResource( 4 )] +[node name="Player" parent="." instance=ExtResource( 2 )] [node name="Camera2D" type="Camera2D" parent="Player"] current = true limit_left = 0 limit_top = 0 -limit_right = 2304 -limit_bottom = 576 +limit_right = 512 +limit_bottom = 288 drag_margin_h_enabled = true drag_margin_v_enabled = true -editor_draw_limits = true -editor_draw_drag_margin = true __meta__ = { "_edit_bone_": true } @@ -28,14 +27,15 @@ rect = Rect2( 0, 0, 24, 24 ) [node name="ParallaxBackground" type="ParallaxBackground" parent="."] [node name="ParallaxLayer" type="ParallaxLayer" parent="ParallaxBackground"] -motion_scale = Vector2( 0.2, 1 ) +motion_scale = Vector2( 0.2, 0.1 ) +motion_offset = Vector2( 0, -288 ) motion_mirroring = Vector2( 528, 0 ) [node name="Sprite" type="Sprite" parent="ParallaxBackground/ParallaxLayer"] -texture = ExtResource( 1 ) +texture = ExtResource( 4 ) centered = false [node name="Map" type="Node2D" parent="."] -position = Vector2( 0, 18 ) -[node name="level01" parent="Map" instance=ExtResource( 3 )] +[node name="Prototype" parent="Map" instance=ExtResource( 3 )] +script = ExtResource( 1 ) diff --git a/godot/levels/level01.tmx b/godot/levels/level01.tmx deleted file mode 100644 index 9bc5967..0000000 --- a/godot/levels/level01.tmx +++ /dev/null @@ -1,112 +0,0 @@ - - - - -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0,0,0,0,0,0,0,0,0,0,48,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -22,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,24,0,21,0,0,2,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,22,23,23,23,23,23,23,23,23,24,0,0,0,2,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,4, -122,123,123,123,123,123,123,123,123,123,123,123,123,123,123,123,123,123,124,0,121,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,122,123,123,123,123,123,123,123,123,124,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -122,123,123,123,123,123,123,123,123,123,123,123,123,123,123,123,123,123,124,69,121,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,122,123,123,123,123,123,123,123,123,124,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,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-3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3, -3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3, -3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3, -3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3, -3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3, -3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3 - + + KLUv/WBAB50AADABAAAAAgMDAGRAJQSmm9e/IwI= + diff --git a/godot/parallax/hills.tmx b/godot/parallax/hills.tmx index bf732ab..5373dbb 100644 --- a/godot/parallax/hills.tmx +++ b/godot/parallax/hills.tmx @@ -2,31 +2,8 @@ - -10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10, -10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10, -10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10, -10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10, -10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10, -10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10, -10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10, -10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10, -10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10, -10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10, -10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10, -10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10, -10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10, -10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10, -10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10, -10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10, -11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11, -12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, -12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, -12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, -12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, -12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, -12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, -12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12 - + + KLUv/WBAB50AADAKAAAACwwDAGRAJQSmm9e/IwI= + diff --git a/godot/parallax/mountains.tmx b/godot/parallax/mountains.tmx index e963695..968553e 100644 --- a/godot/parallax/mountains.tmx +++ b/godot/parallax/mountains.tmx @@ -2,31 +2,8 @@ - -4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4, -4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4, -4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4, -4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4, -4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4, -4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4, -4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4, -4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4, -4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4, -4,4,4,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,7,7,7,7,7, -7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7, -7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7, -7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7, -7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7, -7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7, -7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7, -7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7, -7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7, -7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7, -7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7, -7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7, -8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8, -9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9, -9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9, -9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9, -9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9, -9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9, -9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9, -9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9 - + + KLUv/WBAB50AADAHAAAACAkDAGRAJQSmm9e/IwI= + diff --git a/godot/project.godot b/godot/project.godot index e1b9eb4..52b2be8 100644 --- a/godot/project.godot +++ b/godot/project.godot @@ -53,6 +53,18 @@ texture={ "stream": false, "svg/scale": 1.0 } +vnen.tiled_importer={ +"add_background": true, +"collision_layer": 2, +"collision_mask": 0, +"custom_properties": true, +"embed_internal_images": false, +"image_flags": 7, +"post_import_script": "", +"save_tiled_properties": false, +"tile_metadata": false, +"uv_clip": true +} [input] @@ -81,8 +93,8 @@ right={ [layer_names] -2d_physics/layer_1="Tiles" -2d_physics/layer_2="Player" +2d_physics/layer_1="Player" +2d_physics/layer_2="Tiles" [physics] diff --git a/godot/tilesets/backgrounds.tsx b/godot/tilesets/backgrounds.tsx index 1635d01..5e4097e 100644 --- a/godot/tilesets/backgrounds.tsx +++ b/godot/tilesets/backgrounds.tsx @@ -1,4 +1,5 @@ + diff --git a/godot/tilesets/tiles.tsx b/godot/tilesets/tiles.tsx index 7eb103a..547a5ff 100644 --- a/godot/tilesets/tiles.tsx +++ b/godot/tilesets/tiles.tsx @@ -1,5 +1,6 @@ + @@ -21,11 +22,56 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -46,11 +92,48 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -91,6 +174,12 @@ + + + + + + @@ -111,6 +200,17 @@ + + + + + + + + + + + @@ -131,6 +231,38 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -156,6 +288,27 @@ + + + + + + + + + + + + + + + + + + + + + @@ -176,6 +329,26 @@ + + + + + + + + + + + + + + + + + + + + @@ -196,4 +369,20 @@ + + + + + + + + + + + + + + + + From f3656fe4b47b2ba0af883f200d06f89d5fb03c0c Mon Sep 17 00:00:00 2001 From: Chris Cromer Date: Sat, 16 Apr 2022 16:03:41 -0400 Subject: [PATCH 37/42] remove object layer --- godot/levels/Level2.tmx | 3 --- godot/levels/Level2.tmx.import | 1 - 2 files changed, 4 deletions(-) diff --git a/godot/levels/Level2.tmx b/godot/levels/Level2.tmx index 4a5f162..5ba4922 100644 --- a/godot/levels/Level2.tmx +++ b/godot/levels/Level2.tmx @@ -26,7 +26,4 @@ KLUv/WCARRUCAHgAa2sjADcAIzdLIiIiSkoUoMD4AUCDbgcmhQw6tZMClhqiTQoZdCqUCkMFg6qbwA28Xqj2RbVDFeykwP8N4YEe+Q== - - - diff --git a/godot/levels/Level2.tmx.import b/godot/levels/Level2.tmx.import index b3d3559..0f2e4aa 100644 --- a/godot/levels/Level2.tmx.import +++ b/godot/levels/Level2.tmx.import @@ -16,7 +16,6 @@ tile_metadata=false uv_clip=true image_flags=7 collision_layer=2 -collision_mask=0 embed_internal_images=false save_tiled_properties=false add_background=true From 97d84ef36ab46d754f9f9791c17ed00b926223d5 Mon Sep 17 00:00:00 2001 From: Chris Cromer Date: Sat, 16 Apr 2022 17:20:45 -0400 Subject: [PATCH 38/42] make level dynamic from main --- godot/Main.tscn | 5 ++--- src/Main.cpp | 16 ++++++++++++++++ src/Main.h | 21 +++++++++++++++++++++ 3 files changed, 39 insertions(+), 3 deletions(-) diff --git a/godot/Main.tscn b/godot/Main.tscn index 84d446d..0b5ed2e 100644 --- a/godot/Main.tscn +++ b/godot/Main.tscn @@ -1,9 +1,8 @@ [gd_scene load_steps=3 format=2] [ext_resource path="res://Main.gdns" type="Script" id=1] -[ext_resource path="res://levels/Level2.tscn" type="PackedScene" id=2] +[ext_resource path="res://levels/Prototype.tscn" type="PackedScene" id=2] [node name="Main" type="Node"] script = ExtResource( 1 ) - -[node name="Level2" parent="." instance=ExtResource( 2 )] +level = ExtResource( 2 ) diff --git a/src/Main.cpp b/src/Main.cpp index 387ff6e..4f91c0c 100644 --- a/src/Main.cpp +++ b/src/Main.cpp @@ -9,6 +9,7 @@ void Main::_register_methods() { register_method("_ready", &Main::_ready); register_method("_physics_process", &Main::_physics_process); + register_property>("level", &Main::set_level, &Main::get_level, NULL, GODOT_METHOD_RPC_MODE_DISABLED, GODOT_PROPERTY_USAGE_DEFAULT, GODOT_PROPERTY_HINT_RESOURCE_TYPE, String("PackedScene")); register_property("full_screen", &Main::set_full_screen, &Main::get_full_screen, main::full_screen); register_property("window_size", &Main::set_window_size, &Main::get_window_size, main::window_size); register_property("launch_screen", &Main::set_launch_screen, &Main::get_launch_screen, main::launch_screen); @@ -45,6 +46,11 @@ void Main::_ready() _os->get_screen_position(get_launch_screen()) + _os->get_screen_size() * 0.5 - _os->get_window_size() * 0.5 ); } + + if (level != NULL) + { + add_child(level->instance()); + } } void Main::_physics_process(float delta) @@ -55,6 +61,16 @@ void Main::_physics_process(float delta) } } +void Main::set_level(Ref level) +{ + this->level = level; +} + +Ref Main::get_level() +{ + return this->level; +} + void Main::set_full_screen(bool full_screen) { this->full_screen = full_screen; diff --git a/src/Main.h b/src/Main.h index 4d86783..d89c5c9 100644 --- a/src/Main.h +++ b/src/Main.h @@ -5,6 +5,8 @@ #include #include #include +#include +#include /** * @brief This is the godot namespace for all the code included in the library. @@ -57,6 +59,11 @@ namespace godot */ Input *_input; + /** + * @brief The first level to load + * + */ + Ref level; /** * @brief If the window is full screen or not. * @@ -116,6 +123,20 @@ namespace godot */ void _physics_process(float delta); + /** + * @brief Set the level object. + * + * @param[in] level The new level to load when starting. + */ + void set_level(Ref level); + + /** + * @brief Get the level object. + * + * @return Ref The level scene to load. + */ + Ref get_level(); + /** * @brief Set the full screen object. * From c88a8615b25ae0cc9f5b719ce28afcf5f48bce90 Mon Sep 17 00:00:00 2001 From: Chris Cromer Date: Tue, 19 Apr 2022 23:48:49 -0400 Subject: [PATCH 39/42] update level2 --- godot/Main.tscn | 2 +- godot/levels/Level2.tmx | 8 ++++---- godot/levels/Level2.tmx.import | 1 + godot/tilesets/tiles.tsx | 2 +- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/godot/Main.tscn b/godot/Main.tscn index 0b5ed2e..a9c8579 100644 --- a/godot/Main.tscn +++ b/godot/Main.tscn @@ -1,7 +1,7 @@ [gd_scene load_steps=3 format=2] [ext_resource path="res://Main.gdns" type="Script" id=1] -[ext_resource path="res://levels/Prototype.tscn" type="PackedScene" id=2] +[ext_resource path="res://levels/Level2.tscn" type="PackedScene" id=2] [node name="Main" type="Node"] script = ExtResource( 1 ) diff --git a/godot/levels/Level2.tmx b/godot/levels/Level2.tmx index 5ba4922..1e27b56 100644 --- a/godot/levels/Level2.tmx +++ b/godot/levels/Level2.tmx @@ -1,19 +1,19 @@ - + - KLUv/WCARXUAABgAdQACAH8FesSH8I4N + KLUv/WCARR0BAFgAmgAAAJucAJp1AAYAfwV6TDiADwQeyP/9j6vwLlFiVMcG - KLUv/WCAReUHAMJFERyAa1oDcI3yNgxLrJADMYGMt1VK3WqlViu1WtMUj4khBhdcZJCFAKFxxnPnTUDFDzcs6dEhpRLMlytV2+7O8VvXySWPBFSgUI9lOjCDESmJ0wEFUDBH6aMKnaYbqE3TeZHUEB8pcQNNOxDfKqik4dIamYl9N6jbSwMvVRqDzrlB7c8GUWKOC6sUzQEVzzPO4IgxtKAog6tu1FTgDVN/nN++tBeZA0EN5xk1db0sksKmrmbykTr0A63DDawOgUagB0qpvyBVq4CeYFVHe3t5wv3BM1Ta3X7RbDSyulEpRUiNZjBlQK7pDf62ajznrSAe+evSQvunzakrBQ== + KLUv/WCARdUIAGJGEhyATVoDd0XtKOuQYW4wgYL5HVaKLAO0Ls3IT58UmMKKML5IuTIdigbihxssrwQOeDRxcsgfivDBBSlJoD93Jpbd3eXXVHXzdk1goGBvZTowgxEpidMBBVAwR+2jCpWmG6hNU3mRzDAfqbiBpjuQbxVUUnF5jayJvhtU7aWHlyqNQeXcoMZPClJijgsWFJ0Dap1nnMeRMbRK0QFWye5GSAXeMNWO892X9CIzEFR4nlFTV8sgKWzq6kwGUod+oHe4gdUh0Ah0oCT1F6R6FdAJVuXoai9PuD94hkq72i/ijUZWNyolCKnRDKYRuQz8JXCq7wY1zekAnrN0iMRSqpA2pyoc1rT5RlVbVb7zVjAe+XVpoe+HzKkrBQ== - KLUv/WCARRUIANIEDhigRa0BQ/Q7R/1PsR/MPm2z0rW2E5CaSAF3bMIsV1J77ry5tED4oDjxQam7jR15GE8B0aFV8PXATaBgbbV0gAIUiIjIcQ60HM0oqqweBdaQKlwM1t8qpJZ8tB1EMyqotCNCvamRnuRifF+MubDcIJ1XDxT2Dk2sGSCCbmjVF90Y3KEoKuyI0JoBkXSjVCsddwC1S4ocQUr6N/Q3mAJ9d6or3KrVk3AMw9j/AKvg1Qj5Vxzki1QZxqrbTl1K3FCJ/5Lc4JzPwKsSN+cBgD8c4+5imZRt4gscA6U5ZtMLqm/ED7qsETDJqarCYgqXJ/PkyFVHIrHjagYEG3EVjOLjEQ== + KLUv/WCARWUIAOJEDhiQR60Bj+u7rOyvi/GpHuO2zbgyWjtZC1N3jFmuoPbceTOlQw+GF4wXJ5S629iTyHFUEDhgJXx9MFKgUG+1dJACFIiIiHEOtBTNcAqsPBJYIwoYNNffKuSWfLQdjGYMcGlHhPKmRr4sj20jH4aOcLlBqrcHHu4djKwzRgTdiKrX3RfYoUi0sGOCnRFi0g1UrRTuBW6XFEFClBhXWOAEQXU6FW5UtZsIfXeqFVyF1ZNQDMPYvwCr4NWI+FcI1kVaGcaqm04datxSw91kbnjmc+BUgYtzAKAf7njdL1Nli/gy96w032x64eqF+IGVNYInOW+lsDBli1NbMjI1iCR2pJ4BMUdUhVH8pQM= diff --git a/godot/levels/Level2.tmx.import b/godot/levels/Level2.tmx.import index 0f2e4aa..b3d3559 100644 --- a/godot/levels/Level2.tmx.import +++ b/godot/levels/Level2.tmx.import @@ -16,6 +16,7 @@ tile_metadata=false uv_clip=true image_flags=7 collision_layer=2 +collision_mask=0 embed_internal_images=false save_tiled_properties=false add_background=true diff --git a/godot/tilesets/tiles.tsx b/godot/tilesets/tiles.tsx index 547a5ff..8e80eba 100644 --- a/godot/tilesets/tiles.tsx +++ b/godot/tilesets/tiles.tsx @@ -239,7 +239,7 @@ - + From a314f33b94f194e4dcb4929ccef9222399ce8e5d Mon Sep 17 00:00:00 2001 From: Chris Cromer Date: Wed, 20 Apr 2022 00:37:59 -0400 Subject: [PATCH 40/42] move object art into separate files --- godot/assets/blocks/blocks-coin.png | 3 ++ godot/assets/blocks/blocks-coin.png.import | 35 +++++++++++++++++++ godot/assets/blocks/blocks-exclamation.png | 3 ++ .../blocks/blocks-exclamation.png.import | 35 +++++++++++++++++++ godot/assets/blocks/blocks-lock.png | 3 ++ godot/assets/blocks/blocks-lock.png.import | 35 +++++++++++++++++++ godot/assets/blocks/blocks-normal.png | 3 ++ godot/assets/blocks/blocks-normal.png.import | 35 +++++++++++++++++++ godot/assets/button.png | 3 ++ godot/assets/button.png.import | 35 +++++++++++++++++++ godot/assets/coin.png | 3 ++ godot/assets/coin.png.import | 35 +++++++++++++++++++ godot/assets/flag.png | 3 ++ godot/assets/flag.png.import | 35 +++++++++++++++++++ godot/assets/gems/gem1.png | 3 ++ godot/assets/gems/gem1.png.import | 35 +++++++++++++++++++ godot/assets/gems/gem2.png | 3 ++ godot/assets/gems/gem2.png.import | 35 +++++++++++++++++++ godot/assets/gems/gem3.png | 3 ++ godot/assets/gems/gem3.png.import | 35 +++++++++++++++++++ godot/assets/health.png | 3 ++ godot/assets/health.png.import | 35 +++++++++++++++++++ godot/assets/key.png | 3 ++ godot/assets/key.png.import | 35 +++++++++++++++++++ godot/assets/spring.png | 3 ++ godot/assets/spring.png.import | 35 +++++++++++++++++++ godot/assets/switch.png | 3 ++ godot/assets/switch.png.import | 35 +++++++++++++++++++ 28 files changed, 532 insertions(+) create mode 100644 godot/assets/blocks/blocks-coin.png create mode 100644 godot/assets/blocks/blocks-coin.png.import create mode 100644 godot/assets/blocks/blocks-exclamation.png create mode 100644 godot/assets/blocks/blocks-exclamation.png.import create mode 100644 godot/assets/blocks/blocks-lock.png create mode 100644 godot/assets/blocks/blocks-lock.png.import create mode 100644 godot/assets/blocks/blocks-normal.png create mode 100644 godot/assets/blocks/blocks-normal.png.import create mode 100644 godot/assets/button.png create mode 100644 godot/assets/button.png.import create mode 100644 godot/assets/coin.png create mode 100644 godot/assets/coin.png.import create mode 100644 godot/assets/flag.png create mode 100644 godot/assets/flag.png.import create mode 100644 godot/assets/gems/gem1.png create mode 100644 godot/assets/gems/gem1.png.import create mode 100644 godot/assets/gems/gem2.png create mode 100644 godot/assets/gems/gem2.png.import create mode 100644 godot/assets/gems/gem3.png create mode 100644 godot/assets/gems/gem3.png.import create mode 100644 godot/assets/health.png create mode 100644 godot/assets/health.png.import create mode 100644 godot/assets/key.png create mode 100644 godot/assets/key.png.import create mode 100644 godot/assets/spring.png create mode 100644 godot/assets/spring.png.import create mode 100644 godot/assets/switch.png create mode 100644 godot/assets/switch.png.import diff --git a/godot/assets/blocks/blocks-coin.png b/godot/assets/blocks/blocks-coin.png new file mode 100644 index 0000000..89490ac --- /dev/null +++ b/godot/assets/blocks/blocks-coin.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c3f5e717172d807af12dd086c3eccf6c747c0dc65de494c7464a7eefad665f99 +size 850 diff --git a/godot/assets/blocks/blocks-coin.png.import b/godot/assets/blocks/blocks-coin.png.import new file mode 100644 index 0000000..bd3a6c6 --- /dev/null +++ b/godot/assets/blocks/blocks-coin.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/blocks-coin.png-e02d021b2492bebc2d42f6607de594d0.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/blocks/blocks-coin.png" +dest_files=[ "res://.import/blocks-coin.png-e02d021b2492bebc2d42f6607de594d0.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 +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=false +svg/scale=1.0 diff --git a/godot/assets/blocks/blocks-exclamation.png b/godot/assets/blocks/blocks-exclamation.png new file mode 100644 index 0000000..96b9028 --- /dev/null +++ b/godot/assets/blocks/blocks-exclamation.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d03bd5d598e78759aff6e22dd75d1e4674bdb8235e03897679ed16fd9d70d06c +size 839 diff --git a/godot/assets/blocks/blocks-exclamation.png.import b/godot/assets/blocks/blocks-exclamation.png.import new file mode 100644 index 0000000..bb9f2a2 --- /dev/null +++ b/godot/assets/blocks/blocks-exclamation.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/blocks-exclamation.png-3d4ad82f7288be44d67e956f3c0bebbc.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/blocks/blocks-exclamation.png" +dest_files=[ "res://.import/blocks-exclamation.png-3d4ad82f7288be44d67e956f3c0bebbc.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 +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=false +svg/scale=1.0 diff --git a/godot/assets/blocks/blocks-lock.png b/godot/assets/blocks/blocks-lock.png new file mode 100644 index 0000000..4059e1b --- /dev/null +++ b/godot/assets/blocks/blocks-lock.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9b7d1c159057b02a4ef86c3eb3526e208d7dbacf7022b104dcae0fbd3cbd08fa +size 10037 diff --git a/godot/assets/blocks/blocks-lock.png.import b/godot/assets/blocks/blocks-lock.png.import new file mode 100644 index 0000000..8043038 --- /dev/null +++ b/godot/assets/blocks/blocks-lock.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/blocks-lock.png-e62b69c90efbafbcd301ed5c5a597fa0.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/blocks/blocks-lock.png" +dest_files=[ "res://.import/blocks-lock.png-e62b69c90efbafbcd301ed5c5a597fa0.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 +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=false +svg/scale=1.0 diff --git a/godot/assets/blocks/blocks-normal.png b/godot/assets/blocks/blocks-normal.png new file mode 100644 index 0000000..7bb808f --- /dev/null +++ b/godot/assets/blocks/blocks-normal.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6161973675876daf47bf373fabff792851ee40751f3982d797237f778785a1ae +size 721 diff --git a/godot/assets/blocks/blocks-normal.png.import b/godot/assets/blocks/blocks-normal.png.import new file mode 100644 index 0000000..1ceda52 --- /dev/null +++ b/godot/assets/blocks/blocks-normal.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/blocks-normal.png-4af7780b7fe056a41734dfa530cd81c4.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/blocks/blocks-normal.png" +dest_files=[ "res://.import/blocks-normal.png-4af7780b7fe056a41734dfa530cd81c4.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 +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=false +svg/scale=1.0 diff --git a/godot/assets/button.png b/godot/assets/button.png new file mode 100644 index 0000000..4feceba --- /dev/null +++ b/godot/assets/button.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5342b91195a92698fa6c4ce612410a90cfa6be378bdad6eba4d937fb75f20ce3 +size 697 diff --git a/godot/assets/button.png.import b/godot/assets/button.png.import new file mode 100644 index 0000000..0098d5f --- /dev/null +++ b/godot/assets/button.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/button.png-c79155b6e84601a7c5a042250ad77b07.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/button.png" +dest_files=[ "res://.import/button.png-c79155b6e84601a7c5a042250ad77b07.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 +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=false +svg/scale=1.0 diff --git a/godot/assets/coin.png b/godot/assets/coin.png new file mode 100644 index 0000000..83175d5 --- /dev/null +++ b/godot/assets/coin.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1a882327de89f19ce8d7c1d7b499caf19ac0a323f72326c1adc522c7762c4be5 +size 709 diff --git a/godot/assets/coin.png.import b/godot/assets/coin.png.import new file mode 100644 index 0000000..b18e5a3 --- /dev/null +++ b/godot/assets/coin.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/coin.png-f04b9cd408b88aba3ab0966b4da32df0.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/coin.png" +dest_files=[ "res://.import/coin.png-f04b9cd408b88aba3ab0966b4da32df0.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 +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=false +svg/scale=1.0 diff --git a/godot/assets/flag.png b/godot/assets/flag.png new file mode 100644 index 0000000..81911f2 --- /dev/null +++ b/godot/assets/flag.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:39f152c42bc749e0e6acf2a253598b2ce27797499332a4092bc150df162012a9 +size 903 diff --git a/godot/assets/flag.png.import b/godot/assets/flag.png.import new file mode 100644 index 0000000..5ad2205 --- /dev/null +++ b/godot/assets/flag.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/flag.png-29c6a06ab0a1d25cfcfa38ea2a7baffa.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/flag.png" +dest_files=[ "res://.import/flag.png-29c6a06ab0a1d25cfcfa38ea2a7baffa.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 +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=false +svg/scale=1.0 diff --git a/godot/assets/gems/gem1.png b/godot/assets/gems/gem1.png new file mode 100644 index 0000000..8f2565b --- /dev/null +++ b/godot/assets/gems/gem1.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bc6ff8a090d5999ae1593bcd2f6d9ae90f014f3495f6d0398f727dad75123841 +size 695 diff --git a/godot/assets/gems/gem1.png.import b/godot/assets/gems/gem1.png.import new file mode 100644 index 0000000..f8e7e0b --- /dev/null +++ b/godot/assets/gems/gem1.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/gem1.png-11065ad0e2eb5b112fc6a0edf260e97b.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/gems/gem1.png" +dest_files=[ "res://.import/gem1.png-11065ad0e2eb5b112fc6a0edf260e97b.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 +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=false +svg/scale=1.0 diff --git a/godot/assets/gems/gem2.png b/godot/assets/gems/gem2.png new file mode 100644 index 0000000..82b6fd5 --- /dev/null +++ b/godot/assets/gems/gem2.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:181efc41fbb66a8ce641bc515737a109612237c6d1cc09bed8497d5a46a59c0e +size 707 diff --git a/godot/assets/gems/gem2.png.import b/godot/assets/gems/gem2.png.import new file mode 100644 index 0000000..59ac929 --- /dev/null +++ b/godot/assets/gems/gem2.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/gem2.png-72573c34c050e40128e078d94f847e09.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/gems/gem2.png" +dest_files=[ "res://.import/gem2.png-72573c34c050e40128e078d94f847e09.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 +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=false +svg/scale=1.0 diff --git a/godot/assets/gems/gem3.png b/godot/assets/gems/gem3.png new file mode 100644 index 0000000..19dd614 --- /dev/null +++ b/godot/assets/gems/gem3.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e53b83b4b284d28250a7742f4192183f0e0c194f889422a58552ba6114b38a39 +size 671 diff --git a/godot/assets/gems/gem3.png.import b/godot/assets/gems/gem3.png.import new file mode 100644 index 0000000..1604e59 --- /dev/null +++ b/godot/assets/gems/gem3.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/gem3.png-471deee972b4e29e8d552e3b1ebf7645.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/gems/gem3.png" +dest_files=[ "res://.import/gem3.png-471deee972b4e29e8d552e3b1ebf7645.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 +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=false +svg/scale=1.0 diff --git a/godot/assets/health.png b/godot/assets/health.png new file mode 100644 index 0000000..9dc09ae --- /dev/null +++ b/godot/assets/health.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3477fd291a49199237fe96cdc337055eeab9c95a51e0ba00bba55d0ece827f17 +size 830 diff --git a/godot/assets/health.png.import b/godot/assets/health.png.import new file mode 100644 index 0000000..24fd710 --- /dev/null +++ b/godot/assets/health.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/health.png-00457dc45e4c240f12819344f6504f87.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/health.png" +dest_files=[ "res://.import/health.png-00457dc45e4c240f12819344f6504f87.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 +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=false +svg/scale=1.0 diff --git a/godot/assets/key.png b/godot/assets/key.png new file mode 100644 index 0000000..019bd92 --- /dev/null +++ b/godot/assets/key.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4d0a8a72855134da1af9a1dd6f8645dbc4071f65cf077c11089e630f3af6a733 +size 702 diff --git a/godot/assets/key.png.import b/godot/assets/key.png.import new file mode 100644 index 0000000..6a0e560 --- /dev/null +++ b/godot/assets/key.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/key.png-a97df9ba773df86f934812b8b28ef996.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/key.png" +dest_files=[ "res://.import/key.png-a97df9ba773df86f934812b8b28ef996.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 +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=false +svg/scale=1.0 diff --git a/godot/assets/spring.png b/godot/assets/spring.png new file mode 100644 index 0000000..e9c449c --- /dev/null +++ b/godot/assets/spring.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cd115cd0b411a7c663b6e60a840e12763496e2bca00e2556fa50fd0f34f1f0d3 +size 770 diff --git a/godot/assets/spring.png.import b/godot/assets/spring.png.import new file mode 100644 index 0000000..555135a --- /dev/null +++ b/godot/assets/spring.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/spring.png-3b3902b04c9197ab9097abc899b361d1.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/spring.png" +dest_files=[ "res://.import/spring.png-3b3902b04c9197ab9097abc899b361d1.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 +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=false +svg/scale=1.0 diff --git a/godot/assets/switch.png b/godot/assets/switch.png new file mode 100644 index 0000000..869c02f --- /dev/null +++ b/godot/assets/switch.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:57e5096a649e708ef9c5a55726fd4743bb09a544d2ece84578b85ac0d9ad2bb4 +size 916 diff --git a/godot/assets/switch.png.import b/godot/assets/switch.png.import new file mode 100644 index 0000000..0bab12e --- /dev/null +++ b/godot/assets/switch.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/switch.png-7f9d21c701660c7107ee136e6649068b.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/switch.png" +dest_files=[ "res://.import/switch.png-7f9d21c701660c7107ee136e6649068b.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 +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=false +svg/scale=1.0 From 8edcae5adcceb9113d0d9fe199818470679b5a75 Mon Sep 17 00:00:00 2001 From: Chris Cromer Date: Wed, 20 Apr 2022 11:48:11 -0400 Subject: [PATCH 41/42] add camera limit script --- godot/CameraLimit.gdns | 8 ++++++ godot/levels/Level2.tscn | 2 +- godot/levels/Prototype.tscn | 2 +- src/CameraLimit.cpp | 52 +++++++++++++++++++++++++++++++++++++ src/CameraLimit.h | 48 ++++++++++++++++++++++++++++++++++ src/godot.cpp | 2 ++ 6 files changed, 112 insertions(+), 2 deletions(-) create mode 100644 godot/CameraLimit.gdns create mode 100644 src/CameraLimit.cpp create mode 100644 src/CameraLimit.h diff --git a/godot/CameraLimit.gdns b/godot/CameraLimit.gdns new file mode 100644 index 0000000..fe16c94 --- /dev/null +++ b/godot/CameraLimit.gdns @@ -0,0 +1,8 @@ +[gd_resource type="NativeScript" load_steps=2 format=2] + +[ext_resource path="res://gdnative/alai.tres" type="GDNativeLibrary" id=1] + +[resource] +resource_name = "CameraLimit" +class_name = "CameraLimit" +library = ExtResource( 1 ) diff --git a/godot/levels/Level2.tscn b/godot/levels/Level2.tscn index 13c3651..717c1fe 100644 --- a/godot/levels/Level2.tscn +++ b/godot/levels/Level2.tscn @@ -1,6 +1,6 @@ [gd_scene load_steps=5 format=2] -[ext_resource path="res://camera_fix.gd" type="Script" id=1] +[ext_resource path="res://CameraLimit.gdns" type="Script" id=1] [ext_resource path="res://characters/player/Player.tscn" type="PackedScene" id=2] [ext_resource path="res://assets/backgrounds/hills.png" type="Texture" id=3] [ext_resource path="res://levels/Level2.tmx" type="PackedScene" id=4] diff --git a/godot/levels/Prototype.tscn b/godot/levels/Prototype.tscn index d33d09c..b18e1ae 100644 --- a/godot/levels/Prototype.tscn +++ b/godot/levels/Prototype.tscn @@ -1,6 +1,6 @@ [gd_scene load_steps=5 format=2] -[ext_resource path="res://camera_fix.gd" type="Script" id=1] +[ext_resource path="res://CameraLimit.gdns" type="Script" id=1] [ext_resource path="res://characters/player/Player.tscn" type="PackedScene" id=2] [ext_resource path="res://levels/Prototype.tmx" type="PackedScene" id=3] [ext_resource path="res://assets/backgrounds/mountains.png" type="Texture" id=4] diff --git a/src/CameraLimit.cpp b/src/CameraLimit.cpp new file mode 100644 index 0000000..ca0dae6 --- /dev/null +++ b/src/CameraLimit.cpp @@ -0,0 +1,52 @@ +#include "CameraLimit.h" + +#include +#include +#include +#include +#include + +using namespace godot; + +void CameraLimit::_register_methods() +{ + register_method("_ready", &CameraLimit::_ready); +} + +CameraLimit::CameraLimit() +{ +} + +CameraLimit::~CameraLimit() +{ +} + +void CameraLimit::_init() +{ +} + +void CameraLimit::_ready() +{ + auto node = find_node("Middleground"); + auto middle_ground = cast_to(node); + if (middle_ground != NULL) + { + auto used_rect = middle_ground->get_used_rect(); + auto bounds = Vector2(used_rect.position.x + used_rect.size.x, used_rect.position.y + used_rect.size.y - 1); + node = get_tree()->get_root()->find_node("Camera2D", true, false); + auto camera = cast_to(node); + if (camera != NULL) + { + camera->set_limit(2, bounds.x * middle_ground->get_cell_size().x); + camera->set_limit(3, bounds.y * middle_ground->get_cell_size().y); + } + else + { + ERR_PRINT("Could not find Camera2D node!"); + } + } + else + { + ERR_PRINT("Could not find Middleground node!"); + } +} diff --git a/src/CameraLimit.h b/src/CameraLimit.h new file mode 100644 index 0000000..838d4b5 --- /dev/null +++ b/src/CameraLimit.h @@ -0,0 +1,48 @@ +#ifndef ALAI_CAMERA_LIMIT_H +#define ALAI_CAMERA_LIMIT_H + +#include +#include + +namespace godot +{ + class CameraLimit: public Node2D + { + GODOT_CLASS(CameraLimit, Node2D) + + public: + /** + * @brief This method registers classes with Godot. + * + * @details This method registers methods, properties, and signals with the Godot engine. + */ + static void _register_methods(); + + /** + * @brief Construct a new Camera Limit object. + * + */ + CameraLimit(); + + /** + * @brief Destroy the Camera Limit object. + * + */ + ~CameraLimit(); + + /** + * @brief Initialize the class from Godot. + * + * @details This method is called just once when the Godot engine connects to the instance of the class. + */ + void _init(); + + /** + * @brief Code to be run when ready. + * + * @details This method is run when all the children of this node are ready. + */ + void _ready(); + }; +} +#endif diff --git a/src/godot.cpp b/src/godot.cpp index 76e07ec..1c56d09 100644 --- a/src/godot.cpp +++ b/src/godot.cpp @@ -3,6 +3,7 @@ #include "state_machine/StateMachine.h" #include "state_machine/State.h" #include "Main.h" +#include "CameraLimit.h" #include "player/Player.h" #include "player/states/PlayerIdle.h" #include "player/states/PlayerMove.h" @@ -42,6 +43,7 @@ extern "C" void GDN_EXPORT godot_nativescript_init(void *handle) register_class(); register_class(); register_class(); + register_class(); register_class(); register_class(); register_class(); From 69e4d0d6fc9938471f4365e6e39a653a5599e9fd Mon Sep 17 00:00:00 2001 From: Chris Cromer Date: Wed, 20 Apr 2022 11:48:57 -0400 Subject: [PATCH 42/42] remove temporary gdscript camera limit --- godot/camera_fix.gd | 10 ---------- 1 file changed, 10 deletions(-) delete mode 100644 godot/camera_fix.gd diff --git a/godot/camera_fix.gd b/godot/camera_fix.gd deleted file mode 100644 index 31ad05f..0000000 --- a/godot/camera_fix.gd +++ /dev/null @@ -1,10 +0,0 @@ -extends Node2D - - -# Called when the node enters the scene tree for the first time. -func _ready() -> void: - var used_rect = get_node("Middleground").get_used_rect() - var bounds = Vector2(used_rect.position.x + used_rect.size.x, used_rect.position.y + used_rect.size.y - 1) - var camera : Camera2D = $"../../Player/Camera2D" - camera.limit_right = bounds.x * get_node("Middleground").cell_size.x - camera.limit_bottom = bounds.y * get_node("Middleground").cell_size.y