From 7d3778486a8bfcbad0208abd7130c4c5df5ca201 Mon Sep 17 00:00:00 2001 From: Snoweuph Date: Sun, 9 Apr 2023 17:57:37 +0200 Subject: [PATCH] Merging Stuff Together and Fixing Stuff Brocken From Merge --- Assets/Sprites/{ => UI Elements}/Cross.png | Bin .../{ => UI Elements}/Cross.png.import | 6 +- Assets/Sprites/{ => UI Elements}/Jesus.png | Bin .../{ => UI Elements}/Jesus.png.import | 8 +- .../Settings Menu.tscn | 12 ++- Prefabs/projectile.tscn | 2 +- Scenes/{MainMenu.tscn => Main Menu.tscn} | 79 ++++++++++-------- Scenes/MusicPlayer.tscn | 8 -- Scenes/PlayerMovement.tscn | 42 ---------- Scenes/Test.tscn | 2 +- Scripts/EntitySystem/Bunny.gd | 8 +- Scripts/EntitySystem/BunnyGenerator.gd | 2 +- Scripts/GameManager.gd | 2 +- Scripts/MapGenerator.gd | 3 +- Scripts/{ => SaveSystem}/GameDataSaver.gd | 0 Scripts/{ => SaveSystem}/GlobalSettings.gd | 0 Scripts/{ => UI}/MainMenuManager.gd | 16 ++-- Scripts/{ => UI}/MenuButton.gd | 5 +- Scripts/{ => UI}/RemapButton.gd | 7 +- Scripts/{ => UI}/SettingsMenu.gd | 0 Scripts/WeaponSystem/Projectile.gd | 10 +-- Scripts/WeaponSystem/WeaponController.gd | 5 +- project.godot | 6 +- 23 files changed, 93 insertions(+), 130 deletions(-) rename Assets/Sprites/{ => UI Elements}/Cross.png (100%) rename Assets/Sprites/{ => UI Elements}/Cross.png.import (71%) rename Assets/Sprites/{ => UI Elements}/Jesus.png (100%) rename Assets/Sprites/{ => UI Elements}/Jesus.png.import (68%) rename Scenes/SettingsMenu.tscn => Prefabs/Settings Menu.tscn (96%) rename Scenes/{MainMenu.tscn => Main Menu.tscn} (81%) delete mode 100644 Scenes/MusicPlayer.tscn delete mode 100644 Scenes/PlayerMovement.tscn rename Scripts/{ => SaveSystem}/GameDataSaver.gd (100%) rename Scripts/{ => SaveSystem}/GlobalSettings.gd (100%) rename Scripts/{ => UI}/MainMenuManager.gd (62%) rename Scripts/{ => UI}/MenuButton.gd (97%) rename Scripts/{ => UI}/RemapButton.gd (81%) rename Scripts/{ => UI}/SettingsMenu.gd (100%) diff --git a/Assets/Sprites/Cross.png b/Assets/Sprites/UI Elements/Cross.png similarity index 100% rename from Assets/Sprites/Cross.png rename to Assets/Sprites/UI Elements/Cross.png diff --git a/Assets/Sprites/Cross.png.import b/Assets/Sprites/UI Elements/Cross.png.import similarity index 71% rename from Assets/Sprites/Cross.png.import rename to Assets/Sprites/UI Elements/Cross.png.import index f74c412..96299a3 100644 --- a/Assets/Sprites/Cross.png.import +++ b/Assets/Sprites/UI Elements/Cross.png.import @@ -3,15 +3,15 @@ importer="texture" type="CompressedTexture2D" uid="uid://6snf183fgfo5" -path="res://.godot/imported/Cross.png-a35d7d54d47ceec63c1f7d015bd7540a.ctex" +path="res://.godot/imported/Cross.png-cb47f197658081aa6b3b2436216091d8.ctex" metadata={ "vram_texture": false } [deps] -source_file="res://Assets/Sprites/Cross.png" -dest_files=["res://.godot/imported/Cross.png-a35d7d54d47ceec63c1f7d015bd7540a.ctex"] +source_file="res://Assets/Sprites/UI Elements/Cross.png" +dest_files=["res://.godot/imported/Cross.png-cb47f197658081aa6b3b2436216091d8.ctex"] [params] diff --git a/Assets/Sprites/Jesus.png b/Assets/Sprites/UI Elements/Jesus.png similarity index 100% rename from Assets/Sprites/Jesus.png rename to Assets/Sprites/UI Elements/Jesus.png diff --git a/Assets/Sprites/Jesus.png.import b/Assets/Sprites/UI Elements/Jesus.png.import similarity index 68% rename from Assets/Sprites/Jesus.png.import rename to Assets/Sprites/UI Elements/Jesus.png.import index b2ef2c8..1beeb37 100644 --- a/Assets/Sprites/Jesus.png.import +++ b/Assets/Sprites/UI Elements/Jesus.png.import @@ -2,16 +2,16 @@ importer="texture" type="CompressedTexture2D" -uid="uid://cnrja43wk2mmd" -path="res://.godot/imported/Jesus.png-03798d7c17250d4d3d3b4253b34b9eae.ctex" +uid="uid://cp84ssaqs3pmp" +path="res://.godot/imported/Jesus.png-4b77d6b073d02e874b45321d0948eaf8.ctex" metadata={ "vram_texture": false } [deps] -source_file="res://Assets/Sprites/Jesus.png" -dest_files=["res://.godot/imported/Jesus.png-03798d7c17250d4d3d3b4253b34b9eae.ctex"] +source_file="res://Assets/Sprites/UI Elements/Jesus.png" +dest_files=["res://.godot/imported/Jesus.png-4b77d6b073d02e874b45321d0948eaf8.ctex"] [params] diff --git a/Scenes/SettingsMenu.tscn b/Prefabs/Settings Menu.tscn similarity index 96% rename from Scenes/SettingsMenu.tscn rename to Prefabs/Settings Menu.tscn index 5df532d..715b749 100644 --- a/Scenes/SettingsMenu.tscn +++ b/Prefabs/Settings Menu.tscn @@ -1,8 +1,8 @@ -[gd_scene load_steps=4 format=3] +[gd_scene load_steps=4 format=3 uid="uid://bbog8pmtkefhq"] -[ext_resource type="Script" path="res://Scripts/SettingsMenu.gd" id="1_2rgd2"] +[ext_resource type="Script" path="res://Scripts/UI/SettingsMenu.gd" id="1_2rgd2"] [ext_resource type="Theme" uid="uid://o3vg845para" path="res://Assets/UI_Theme.tres" id="2_swcn6"] -[ext_resource type="Script" path="res://Scripts/RemapButton.gd" id="3_gktg3"] +[ext_resource type="Script" path="res://Scripts/UI/RemapButton.gd" id="3_gktg3"] [node name="SettingsMenu" type="Node" node_paths=PackedStringArray("display_options_button", "vsync_toggle", "resolutions_options_button", "master_volume_slider", "music_volume_slider", "sfx_volume_slider")] script = ExtResource("1_2rgd2") @@ -50,6 +50,8 @@ theme_override_font_sizes/font_size = 29 [node name="Video" type="VBoxContainer" parent="MainVBox/TabsContainer/SettingsTabs"] layout_mode = 2 +focus_neighbor_left = NodePath("../Controls") +focus_neighbor_right = NodePath("../Audio") [node name="MarginContainer" type="MarginContainer" parent="MainVBox/TabsContainer/SettingsTabs/Video"] custom_minimum_size = Vector2(0, 425) @@ -121,6 +123,8 @@ fit_to_longest_item = false [node name="Audio" type="VBoxContainer" parent="MainVBox/TabsContainer/SettingsTabs"] visible = false layout_mode = 2 +focus_neighbor_left = NodePath("../Video") +focus_neighbor_right = NodePath("../Controls") [node name="MarginContainer" type="MarginContainer" parent="MainVBox/TabsContainer/SettingsTabs/Audio"] custom_minimum_size = Vector2(0, 425) @@ -184,6 +188,8 @@ max_value = 0.0 [node name="Controls" type="VBoxContainer" parent="MainVBox/TabsContainer/SettingsTabs"] visible = false layout_mode = 2 +focus_neighbor_left = NodePath("../Audio") +focus_neighbor_right = NodePath("../Video") [node name="MarginContainer" type="MarginContainer" parent="MainVBox/TabsContainer/SettingsTabs/Controls"] custom_minimum_size = Vector2(0, 425) diff --git a/Prefabs/projectile.tscn b/Prefabs/projectile.tscn index 350abc7..d8d5c72 100644 --- a/Prefabs/projectile.tscn +++ b/Prefabs/projectile.tscn @@ -1,7 +1,7 @@ [gd_scene load_steps=4 format=3 uid="uid://csxh42o8twxwn"] [ext_resource type="Script" path="res://Scripts/WeaponSystem/Projectile.gd" id="1_os652"] -[ext_resource type="Texture2D" uid="uid://c5jj6s5orw6mi" path="res://Assets/Sprites/crucefix.png" id="2_ibs3t"] +[ext_resource type="Texture2D" uid="uid://dlxjdb0tchrps" path="res://Assets/Sprites/crucefix.png" id="2_ibs3t"] [sub_resource type="CapsuleShape2D" id="CapsuleShape2D_ki5cp"] radius = 8.57143 diff --git a/Scenes/MainMenu.tscn b/Scenes/Main Menu.tscn similarity index 81% rename from Scenes/MainMenu.tscn rename to Scenes/Main Menu.tscn index 910ecfa..96333fa 100644 --- a/Scenes/MainMenu.tscn +++ b/Scenes/Main Menu.tscn @@ -1,20 +1,24 @@ -[gd_scene load_steps=12 format=3 uid="uid://c061h8kte43oy"] +[gd_scene load_steps=14 format=3 uid="uid://4fysk8vaw3e1"] -[ext_resource type="Script" path="res://Scripts/MainMenuManager.gd" id="1_0vcve"] -[ext_resource type="Script" path="res://Scripts/MenuButton.gd" id="1_croa2"] -[ext_resource type="Texture2D" uid="uid://6snf183fgfo5" path="res://Assets/Sprites/Cross.png" id="1_joe3h"] -[ext_resource type="Texture2D" uid="uid://tjxkew3m4v8m" path="res://Assets/Sprites/Easter Egg/Shadow.png" id="4_8qs7j"] -[ext_resource type="Texture2D" uid="uid://daat37cyg0go5" path="res://Assets/Sprites/Easter Egg/Egg 3.png" id="5_1ocdn"] -[ext_resource type="Texture2D" uid="uid://dhvvw4yckl8x7" path="res://Assets/Sprites/Props/Cake.png" id="5_5gyoe"] -[ext_resource type="Texture2D" uid="uid://cnrja43wk2mmd" path="res://Assets/Sprites/Jesus.png" id="6_ag6vh"] -[ext_resource type="Theme" uid="uid://o3vg845para" path="res://Assets/UI_Theme.tres" id="8_4mc3t"] -[ext_resource type="Texture2D" uid="uid://c3yg6u8yncau3" path="res://Assets/Sprites/Easter Egg/Egg 2.png" id="8_cha7m"] -[ext_resource type="Texture2D" uid="uid://dkotcqflp3e32" path="res://Assets/Sprites/Easter Egg/Egg 1.png" id="9_ujgvg"] -[ext_resource type="PackedScene" uid="uid://ck2ggeynybwdb" path="res://Scenes/MusicPlayer.tscn" id="12_x3k6e"] +[ext_resource type="Script" path="res://Scripts/UI/MainMenuManager.gd" id="1_qepq0"] +[ext_resource type="Texture2D" uid="uid://tjxkew3m4v8m" path="res://Assets/Sprites/Easter Egg/Shadow.png" id="2_8o6th"] +[ext_resource type="PackedScene" uid="uid://c4btepmue6d7p" path="res://Scenes/Game.tscn" id="2_28004"] +[ext_resource type="Texture2D" uid="uid://daat37cyg0go5" path="res://Assets/Sprites/Easter Egg/Egg 3.png" id="3_1e3fe"] +[ext_resource type="PackedScene" uid="uid://bbog8pmtkefhq" path="res://Prefabs/Settings Menu.tscn" id="3_r3r61"] +[ext_resource type="Texture2D" uid="uid://dhvvw4yckl8x7" path="res://Assets/Sprites/Props/Cake.png" id="5_7ull8"] +[ext_resource type="Texture2D" uid="uid://c3yg6u8yncau3" path="res://Assets/Sprites/Easter Egg/Egg 2.png" id="6_45o7d"] +[ext_resource type="Texture2D" uid="uid://cp84ssaqs3pmp" path="res://Assets/Sprites/UI Elements/Jesus.png" id="6_wnx18"] +[ext_resource type="Texture2D" uid="uid://dkotcqflp3e32" path="res://Assets/Sprites/Easter Egg/Egg 1.png" id="7_285vd"] +[ext_resource type="Theme" uid="uid://o3vg845para" path="res://Assets/UI_Theme.tres" id="8_lr748"] +[ext_resource type="Script" path="res://Scripts/UI/MenuButton.gd" id="9_2cu5l"] +[ext_resource type="Texture2D" uid="uid://6snf183fgfo5" path="res://Assets/Sprites/UI Elements/Cross.png" id="12_dhfc0"] +[ext_resource type="AudioStream" uid="uid://c6nf5s6xy2uii" path="res://Assets/Temp Music/omw-to-beat-the-big-bad.wav" id="13_3j724"] -[node name="MainMenu" type="Node" node_paths=PackedStringArray("button_to_focus_on_start")] -script = ExtResource("1_0vcve") -button_to_focus_on_start = NodePath("MainVBox/ButtonsVbox/PlayButton") +[node name="MainMenu" type="Node" node_paths=PackedStringArray("default_focus")] +script = ExtResource("1_qepq0") +game_scene = ExtResource("2_28004") +settings_scene = ExtResource("3_r3r61") +default_focus = NodePath("MainVBox/ButtonsVbox/PlayButton") [node name="ColorRect" type="ColorRect" parent="."] anchors_preset = 15 @@ -42,22 +46,22 @@ grow_vertical = 2 [node name="Shadow" type="Sprite2D" parent="Decorations/Left Decor"] position = Vector2(226.563, 338.875) scale = Vector2(22.7773, 15.6953) -texture = ExtResource("4_8qs7j") +texture = ExtResource("2_8o6th") [node name="Egg3" type="Sprite2D" parent="Decorations/Left Decor"] position = Vector2(134, 477) scale = Vector2(4.6875, 4.625) -texture = ExtResource("5_1ocdn") +texture = ExtResource("3_1e3fe") [node name="Jesus" type="Sprite2D" parent="Decorations/Left Decor"] position = Vector2(220, 335) scale = Vector2(7.0431, 6.97321) -texture = ExtResource("6_ag6vh") +texture = ExtResource("6_wnx18") [node name="Cake" type="Sprite2D" parent="Decorations/Left Decor"] position = Vector2(310, 491) scale = Vector2(2.59375, 2.32031) -texture = ExtResource("5_5gyoe") +texture = ExtResource("5_7ull8") [node name="Right Decor" type="CenterContainer" parent="Decorations"] custom_minimum_size = Vector2(576, 0) @@ -72,18 +76,18 @@ grow_vertical = 2 [node name="Shadow2" type="Sprite2D" parent="Decorations/Right Decor"] position = Vector2(351, 403) scale = Vector2(19.0938, 11.8125) -texture = ExtResource("4_8qs7j") +texture = ExtResource("2_8o6th") [node name="Egg2" type="Sprite2D" parent="Decorations/Right Decor"] position = Vector2(294, 487) rotation = -1.5708 scale = Vector2(4.89203, 5.21732) -texture = ExtResource("8_cha7m") +texture = ExtResource("6_45o7d") [node name="Egg1" type="Sprite2D" parent="Decorations/Right Decor"] position = Vector2(420.75, 471.25) scale = Vector2(4.89062, 4.95313) -texture = ExtResource("9_ujgvg") +texture = ExtResource("7_285vd") [node name="GoodBunny" type="Sprite2D" parent="Decorations/Right Decor"] position = Vector2(331, 458.5) @@ -96,7 +100,7 @@ anchor_right = 1.0 anchor_bottom = 1.0 grow_horizontal = 2 grow_vertical = 2 -theme = ExtResource("8_4mc3t") +theme = ExtResource("8_lr748") [node name="CenterContainer" type="CenterContainer" parent="MainVBox"] custom_minimum_size = Vector2(0, 150) @@ -125,7 +129,7 @@ focus_neighbor_bottom = NodePath("../SettingsButton") focus_next = NodePath("../SettingsButton") focus_previous = NodePath("../QuitButton") mouse_default_cursor_shape = 2 -script = ExtResource("1_croa2") +script = ExtResource("9_2cu5l") text = "Play" pointer_margin_from_center = 80 leftPointer = NodePath("LeftPointer") @@ -148,13 +152,13 @@ text = "[center]Play[/center]" visible = false position = Vector2(502, 12) rotation = 1.5708 -texture = ExtResource("1_joe3h") +texture = ExtResource("12_dhfc0") [node name="RightPointer" type="Sprite2D" parent="MainVBox/ButtonsVbox/PlayButton"] visible = false position = Vector2(650, 12) rotation = -1.5708 -texture = ExtResource("1_joe3h") +texture = ExtResource("12_dhfc0") [node name="SettingsButton" type="TextureButton" parent="MainVBox/ButtonsVbox" node_paths=PackedStringArray("leftPointer", "rightPointer", "textBox")] custom_minimum_size = Vector2(0, 40) @@ -166,7 +170,7 @@ focus_neighbor_bottom = NodePath("../AboutButton") focus_next = NodePath("../AboutButton") focus_previous = NodePath("../PlayButton") mouse_default_cursor_shape = 2 -script = ExtResource("1_croa2") +script = ExtResource("9_2cu5l") text = "Settings" pointer_margin_from_center = 130 leftPointer = NodePath("LeftPointer") @@ -189,13 +193,13 @@ text = "[center]Settings[/center]" visible = false position = Vector2(502, 12) rotation = 1.5708 -texture = ExtResource("1_joe3h") +texture = ExtResource("12_dhfc0") [node name="RightPointer" type="Sprite2D" parent="MainVBox/ButtonsVbox/SettingsButton"] visible = false position = Vector2(650, 12) rotation = -1.5708 -texture = ExtResource("1_joe3h") +texture = ExtResource("12_dhfc0") [node name="AboutButton" type="TextureButton" parent="MainVBox/ButtonsVbox" node_paths=PackedStringArray("leftPointer", "rightPointer", "textBox")] custom_minimum_size = Vector2(0, 40) @@ -207,7 +211,7 @@ focus_neighbor_bottom = NodePath("../QuitButton") focus_next = NodePath("../QuitButton") focus_previous = NodePath("../SettingsButton") mouse_default_cursor_shape = 2 -script = ExtResource("1_croa2") +script = ExtResource("9_2cu5l") text = "About" pointer_margin_from_center = 95 leftPointer = NodePath("LeftPointer") @@ -230,13 +234,13 @@ text = "[center]About[/center]" visible = false position = Vector2(502, 12) rotation = 1.5708 -texture = ExtResource("1_joe3h") +texture = ExtResource("12_dhfc0") [node name="RightPointer" type="Sprite2D" parent="MainVBox/ButtonsVbox/AboutButton"] visible = false position = Vector2(650, 12) rotation = -1.5708 -texture = ExtResource("1_joe3h") +texture = ExtResource("12_dhfc0") [node name="QuitButton" type="TextureButton" parent="MainVBox/ButtonsVbox" node_paths=PackedStringArray("leftPointer", "rightPointer", "textBox")] custom_minimum_size = Vector2(0, 40) @@ -248,7 +252,7 @@ focus_neighbor_bottom = NodePath("../PlayButton") focus_next = NodePath("../PlayButton") focus_previous = NodePath("../AboutButton") mouse_default_cursor_shape = 2 -script = ExtResource("1_croa2") +script = ExtResource("9_2cu5l") text = "Quit" pointer_margin_from_center = 80 leftPointer = NodePath("LeftPointer") @@ -271,15 +275,18 @@ text = "[center]Quit[/center]" visible = false position = Vector2(502, 12) rotation = 1.5708 -texture = ExtResource("1_joe3h") +texture = ExtResource("12_dhfc0") [node name="RightPointer" type="Sprite2D" parent="MainVBox/ButtonsVbox/QuitButton"] visible = false position = Vector2(650, 12) rotation = -1.5708 -texture = ExtResource("1_joe3h") +texture = ExtResource("12_dhfc0") -[node name="MusicPlayer" parent="." instance=ExtResource("12_x3k6e")] +[node name="MusicPlayer" type="AudioStreamPlayer" parent="."] +stream = ExtResource("13_3j724") +autoplay = true +bus = &"Music" [connection signal="pressed" from="MainVBox/ButtonsVbox/PlayButton" to="." method="_on_play_button_pressed"] [connection signal="pressed" from="MainVBox/ButtonsVbox/SettingsButton" to="." method="_on_settings_button_pressed"] diff --git a/Scenes/MusicPlayer.tscn b/Scenes/MusicPlayer.tscn deleted file mode 100644 index 0e53739..0000000 --- a/Scenes/MusicPlayer.tscn +++ /dev/null @@ -1,8 +0,0 @@ -[gd_scene load_steps=2 format=3 uid="uid://ck2ggeynybwdb"] - -[ext_resource type="AudioStream" uid="uid://c6nf5s6xy2uii" path="res://Assets/Temp Music/omw-to-beat-the-big-bad.wav" id="1_wb1gf"] - -[node name="MusicPlayer" type="AudioStreamPlayer"] -stream = ExtResource("1_wb1gf") -autoplay = true -bus = &"Music" diff --git a/Scenes/PlayerMovement.tscn b/Scenes/PlayerMovement.tscn deleted file mode 100644 index 125749b..0000000 --- a/Scenes/PlayerMovement.tscn +++ /dev/null @@ -1,42 +0,0 @@ -[gd_scene load_steps=7 format=3 uid="uid://ccgpsim5nfxd6"] - -[ext_resource type="Script" path="res://Scripts/PlayerController.gd" id="1_x3102"] -[ext_resource type="TileSet" uid="uid://b7cqbf6xdbeal" path="res://Assets/Test_Tileset.tres" id="3_0at2g"] -[ext_resource type="Script" path="res://Scripts/MapGenerator.gd" id="4_8st0q"] -[ext_resource type="Texture2D" uid="uid://cnrja43wk2mmd" path="res://Assets/Sprites/Jesus.png" id="4_lpajj"] -[ext_resource type="PackedScene" path="res://Scenes/MusicPlayer.tscn" id="5_4vnv3"] -[ext_resource type="AudioStream" uid="uid://dpbyjnyg765r7" path="res://Assets/Temp Music/awesomeness.wav" id="6_2do7l"] - -[node name="Node2D" type="Node2D"] - -[node name="TileMap" type="TileMap" parent="."] -tile_set = ExtResource("3_0at2g") -cell_quadrant_size = 8 -collision_visibility_mode = 1 -format = 2 -script = ExtResource("4_8st0q") - -[node name="CharacterBody2D" type="CharacterBody2D" parent="."] -position = Vector2(512, 300) -scale = Vector2(0.25, 0.25) -script = ExtResource("1_x3102") -speed = 80 - -[node name="Sprite2D" type="Sprite2D" parent="CharacterBody2D"] -position = Vector2(0.75, 3.99997) -scale = Vector2(1.05172, 1) -texture = ExtResource("4_lpajj") - -[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="CharacterBody2D"] -polygon = PackedVector2Array(16, 32, -14, 32, -12, -24, 16, -24) - -[node name="Camera2D" type="Camera2D" parent="CharacterBody2D"] -zoom = Vector2(10, 10) -position_smoothing_enabled = true -drag_horizontal_enabled = true -drag_vertical_enabled = true -editor_draw_limits = true -editor_draw_drag_margin = true - -[node name="MusicPlayer" parent="." instance=ExtResource("5_4vnv3")] -stream = ExtResource("6_2do7l") diff --git a/Scenes/Test.tscn b/Scenes/Test.tscn index 6513980..55d7259 100644 --- a/Scenes/Test.tscn +++ b/Scenes/Test.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=16 format=3 uid="uid://cd45icxf4gxpp"] +[gd_scene load_steps=16 format=3 uid="uid://cugui0mjc6cfe"] [ext_resource type="TileSet" uid="uid://bj7uu2180mie3" path="res://Assets/Tileset.tres" id="1_s4utw"] [ext_resource type="Script" path="res://Scripts/MapGenerator.gd" id="2_yhpwh"] diff --git a/Scripts/EntitySystem/Bunny.gd b/Scripts/EntitySystem/Bunny.gd index 05e1ecf..4fbc017 100644 --- a/Scripts/EntitySystem/Bunny.gd +++ b/Scripts/EntitySystem/Bunny.gd @@ -44,13 +44,13 @@ func _of_collision(body): if body != self: collisions-= 1 pass -func damage(damage : int): - health -= damage +func damage(damage_amount : int): + health -= damage_amount if(health <= 0): on_death() pass -func heal(health : int): - self.health += health +func heal(health_amount : int): + self.health += health_amount pass func on_death(): diff --git a/Scripts/EntitySystem/BunnyGenerator.gd b/Scripts/EntitySystem/BunnyGenerator.gd index 1894fbd..5e34dc9 100644 --- a/Scripts/EntitySystem/BunnyGenerator.gd +++ b/Scripts/EntitySystem/BunnyGenerator.gd @@ -27,6 +27,6 @@ func spawn_wave(free_tiles : Array, team: int, amount : int, health : int) -> Ar for i in amount: var pos = free_tiles.pick_random() free_tiles.erase(pos) - var bunny = spawn_bunny(pos, team, 3) + var bunny = spawn_bunny(pos, team, health) bunnys.push_back(bunny) return bunnys diff --git a/Scripts/GameManager.gd b/Scripts/GameManager.gd index 71e3fb3..cbdd2ff 100644 --- a/Scripts/GameManager.gd +++ b/Scripts/GameManager.gd @@ -12,7 +12,7 @@ func _ready(): print("time for generation: " + str(gen_data.time)) pass -func _process(delta): +func _process(_delta): if(bunnys.size() == 0): wave += 1 bunnys = bunny_generator.spawn_wave(gen_data.free_tiles.duplicate(), TEAM.EVIL, wave * 500, 3) diff --git a/Scripts/MapGenerator.gd b/Scripts/MapGenerator.gd index effc4e0..2c809ea 100644 --- a/Scripts/MapGenerator.gd +++ b/Scripts/MapGenerator.gd @@ -69,7 +69,8 @@ func set_borders_solid(): pass func prepare_player_start_area(): - var center = Vector2i(width/2, height/2) + @warning_ignore("integer_division") + var center = Vector2i(width / 2, height / 2) for x in range(center.x - start_area_size, center.x + start_area_size): # Getting a P factor for the corner "radius" Decission diff --git a/Scripts/GameDataSaver.gd b/Scripts/SaveSystem/GameDataSaver.gd similarity index 100% rename from Scripts/GameDataSaver.gd rename to Scripts/SaveSystem/GameDataSaver.gd diff --git a/Scripts/GlobalSettings.gd b/Scripts/SaveSystem/GlobalSettings.gd similarity index 100% rename from Scripts/GlobalSettings.gd rename to Scripts/SaveSystem/GlobalSettings.gd diff --git a/Scripts/MainMenuManager.gd b/Scripts/UI/MainMenuManager.gd similarity index 62% rename from Scripts/MainMenuManager.gd rename to Scripts/UI/MainMenuManager.gd index 106cb35..06e599a 100644 --- a/Scripts/MainMenuManager.gd +++ b/Scripts/UI/MainMenuManager.gd @@ -1,8 +1,8 @@ extends Node -@export var game_scene_path : String = "res://Scenes/PlayerMovement.tscn" -@export var options_scene_path : String = "res://Scenes/SettingsMenu.tscn" -@export var button_to_focus_on_start : TextureButton +@export var game_scene : Resource +@export var settings_scene : Resource +@export var default_focus : TextureButton # Engine Callbackss func _ready(): @@ -12,17 +12,17 @@ func _ready(): GlobalSettings.update_master_volume(Save.game_data.master_volume) GlobalSettings.update_music_volume(Save.game_data.music_volume) GlobalSettings.update_sfx_volume(Save.game_data.sfx_volume) - button_to_focus_on_start.grab_focus() + default_focus.grab_focus() pass - func _on_play_button_pressed(): - get_tree().change_scene_to_file(game_scene_path) + load(game_scene.resource_path) + get_tree().change_scene_to_file(game_scene.resource_path) pass func _on_settings_button_pressed(): - var options_scene = load(options_scene_path).instantiate() - get_tree().current_scene.add_child(options_scene) + var settings_scene_instance = load(settings_scene.resource_path).instantiate() + get_tree().current_scene.add_child(settings_scene_instance) pass func _on_about_button_pressed(): diff --git a/Scripts/MenuButton.gd b/Scripts/UI/MenuButton.gd similarity index 97% rename from Scripts/MenuButton.gd rename to Scripts/UI/MenuButton.gd index eb568ce..f257cdd 100644 --- a/Scripts/MenuButton.gd +++ b/Scripts/UI/MenuButton.gd @@ -1,4 +1,3 @@ - extends TextureButton @export var text : String = "Sample Text" @@ -12,11 +11,10 @@ func _ready(): textBox.parse_bbcode("[center] %s [/center]" % [text]) pass -func _process(delta): +func _process(_delta): handle_hover_and_focus() handle_x_position() - func handle_hover_and_focus() -> void: if has_focus(): leftPointer.visible = true @@ -33,7 +31,6 @@ func handle_hover_and_focus() -> void: rightPointer.modulate.a = 1 pass - func handle_x_position() -> void: var center_x = get_parent().position.x + (get_parent().size.x / 2.0) leftPointer.global_position.x = center_x - pointer_margin_from_center diff --git a/Scripts/RemapButton.gd b/Scripts/UI/RemapButton.gd similarity index 81% rename from Scripts/RemapButton.gd rename to Scripts/UI/RemapButton.gd index 92c8ee7..570927a 100644 --- a/Scripts/RemapButton.gd +++ b/Scripts/UI/RemapButton.gd @@ -11,7 +11,6 @@ func _unhandled_key_input(event): remap_key(event) pass - func display_key (): text = "%s" % InputMap.action_get_events(input_action_name)[0].as_text() pass @@ -23,8 +22,8 @@ func remap_key(event): text = "%s" % event.as_text() pass -func _on_toggled(button_pressed): - set_process_unhandled_key_input(button_pressed) - if button_pressed: text = "..." +func _on_toggled(is_button_pressed): + set_process_unhandled_key_input(is_button_pressed) + if is_button_pressed: text = "..." else: display_key() pass diff --git a/Scripts/SettingsMenu.gd b/Scripts/UI/SettingsMenu.gd similarity index 100% rename from Scripts/SettingsMenu.gd rename to Scripts/UI/SettingsMenu.gd diff --git a/Scripts/WeaponSystem/Projectile.gd b/Scripts/WeaponSystem/Projectile.gd index 96a7755..9a97159 100644 --- a/Scripts/WeaponSystem/Projectile.gd +++ b/Scripts/WeaponSystem/Projectile.gd @@ -11,16 +11,16 @@ func _process(delta): pass func _on_collision(body): - var collision_layer = null; + var collided_layer = null; if body.get_class() == "TileMap": - collision_layer = body.tile_set.get_physics_layer_collision_layer(0) + collided_layer = body.tile_set.get_physics_layer_collision_layer(0) if(body.has_method("get_collision_layer")): - collision_layer = body.get_collision_layer() + collided_layer = body.get_collision_layer() - if collision_layer & map_collision_layer: + if collided_layer & map_collision_layer: queue_free() - if collision_layer & bunny_collision_layer: + if collided_layer & bunny_collision_layer: var bunny = body as Bunny bunny.damage(damage) queue_free() diff --git a/Scripts/WeaponSystem/WeaponController.gd b/Scripts/WeaponSystem/WeaponController.gd index f3b93ec..f23eec3 100644 --- a/Scripts/WeaponSystem/WeaponController.gd +++ b/Scripts/WeaponSystem/WeaponController.gd @@ -3,7 +3,7 @@ extends Node2D @export var projectile_prefab : Resource @onready var projectilePrefab : PackedScene = load(projectile_prefab.resource_path) -func _process(delta): +func _process(_delta): rotate_to_pointer() if Input.is_action_just_pressed("attack"): @@ -18,5 +18,8 @@ func spawn_projectile(pos : Vector2, dir : float, speed: float, damage : int): var projectile = projectilePrefab.instantiate() projectile.global_position = pos projectile.rotation = dir + projectile.speed = speed + projectile.damage = damage + projectile.is_displayed_folded() get_tree().root.add_child(projectile) pass diff --git a/project.godot b/project.godot index 4d35371..79d1506 100644 --- a/project.godot +++ b/project.godot @@ -11,7 +11,7 @@ config_version=5 [application] config/name="HoppyEaster" -run/main_scene="res://Scenes/Test.tscn" +run/main_scene="res://Scenes/Main Menu.tscn" config/features=PackedStringArray("4.0", "GL Compatibility") config/icon="res://icon.svg" @@ -21,8 +21,8 @@ buses/default_bus_layout="res://Assets/Temp Music/default_bus_layout.tres" [autoload] -GlobalSettings="*res://Scripts/GlobalSettings.gd" -Save="*res://Scripts/GameDataSaver.gd" +GlobalSettings="*res://Scripts/SaveSystem/GlobalSettings.gd" +Save="*res://Scripts/SaveSystem/GameDataSaver.gd" [display]