Skip to content

Commit

Permalink
feat: add audio and animation system (#20)
Browse files Browse the repository at this point in the history
  • Loading branch information
tmttn authored Nov 12, 2024
1 parent da4b853 commit 8574c44
Show file tree
Hide file tree
Showing 32 changed files with 422 additions and 173 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,5 @@ mono_crash.*.json
repomix-output.txt

.idea

assets/packs/
42 changes: 0 additions & 42 deletions addons/ability_editor/ability_data_inspector.gd

This file was deleted.

13 changes: 0 additions & 13 deletions addons/ability_editor/ability_editor_plugin.gd

This file was deleted.

7 changes: 0 additions & 7 deletions addons/ability_editor/plugin.cfg

This file was deleted.

Binary file added assets/audio/sfx/03_Fighter_Damage_1.wav
Binary file not shown.
Binary file added assets/audio/sfx/04_Fighter_Damage_2.wav
Binary file not shown.
Binary file added assets/audio/sfx/28_swoosh_01.wav
Binary file not shown.
Binary file added assets/audio/sfx/29_swoosh_02.wav
Binary file not shown.
Binary file added assets/audio/sfx/30_swoosh_03.wav
Binary file not shown.
Binary file added assets/audio/sfx/37_Block_01.wav
Binary file not shown.
Binary file added assets/audio/sfx/40_Block_04.wav
Binary file not shown.
Binary file added assets/audio/ui/007_Hover_07.wav
Binary file not shown.
Binary file added assets/audio/ui/052_use_item_02.wav
Binary file not shown.
Binary file added assets/audio/ui/Click_1.wav
Binary file not shown.
Binary file added assets/audio/ui/Hover_1.wav
Binary file not shown.
3 changes: 2 additions & 1 deletion project.godot
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ AdventureSystem="*res://scripts/systems/adventure_system.gd"
BackgroundSystem="*res://scripts/systems/background_system.gd"
CutsceneSystem="*res://scripts/systems/cutscene_system.gd"
MusicSystem="*res://scripts/systems/music_system.gd"
SoundEffectsSystem="*res://scripts/systems/sound_effects_system.gd"

[display]

Expand All @@ -31,7 +32,7 @@ window/size/resizable=false

[editor_plugins]

enabled=PackedStringArray("res://addons/ability_editor/plugin.cfg")
enabled=PackedStringArray()

[global_group]

Expand Down
15 changes: 15 additions & 0 deletions resources/audio_bus_layout.tres
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[gd_resource type="AudioBusLayout" format=3 uid="uid://b2bkub5s8hm0j"]

[resource]
bus/1/name = &"Music"
bus/1/solo = false
bus/1/mute = false
bus/1/bypass_fx = false
bus/1/volume_db = -8.0
bus/1/send = &"Master"
bus/2/name = &"SoundEffects"
bus/2/solo = false
bus/2/mute = false
bus/2/bypass_fx = false
bus/2/volume_db = -5.0
bus/2/send = &"Master"
6 changes: 6 additions & 0 deletions scenes/adventure_map.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ vertical_scroll_mode = 0
layout_mode = 2
size_flags_vertical = 3

[node name="HealthLabel" type="Label" parent="ScrollContainer/AdventureStages"]
layout_mode = 2
theme_override_font_sizes/font_size = 40
text = "100/100"
horizontal_alignment = 1

[node name="LinesContainer" type="Node2D" parent="ScrollContainer"]
z_index = -1

Expand Down
6 changes: 5 additions & 1 deletion scenes/enemies/enemy.tscn
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
[gd_scene load_steps=3 format=3 uid="uid://b3hv5sm4hjouf"]
[gd_scene load_steps=4 format=3 uid="uid://b3hv5sm4hjouf"]

[ext_resource type="Script" path="res://scripts/enemy.gd" id="1_wa7o7"]
[ext_resource type="PackedScene" uid="uid://c0l75fsf0a0lh" path="res://scenes/ui/health_bar.tscn" id="2_ahs3m"]
[ext_resource type="Script" path="res://scripts/animators/combat_animator.gd" id="3_l6amq"]

[node name="Enemy" type="Node2D"]
script = ExtResource("1_wa7o7")
Expand All @@ -11,3 +12,6 @@ offset_left = -50.0
offset_top = 630.0
offset_right = 350.0
offset_bottom = 680.0

[node name="CombatAnimator" type="Node" parent="."]
script = ExtResource("3_l6amq")
7 changes: 6 additions & 1 deletion scenes/menus/main_menu.tscn
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[gd_scene load_steps=2 format=3 uid="uid://bxru22786wp6n"]
[gd_scene load_steps=3 format=3 uid="uid://bxru22786wp6n"]

[ext_resource type="Script" path="res://scripts/scenes/main_menu.gd" id="1_prvtn"]
[ext_resource type="Script" path="res://scripts/ui/audio_button.gd" id="2_l6w84"]

[node name="MainMenu" type="CenterContainer"]
anchors_preset = 15
Expand All @@ -23,21 +24,25 @@ layout_mode = 2
theme_override_font_sizes/font_size = 32
disabled = true
text = "Continue Game"
script = ExtResource("2_l6w84")

[node name="StartButton" type="Button" parent="CenterContainer/VBoxContainer"]
custom_minimum_size = Vector2(400, 100)
layout_mode = 2
theme_override_font_sizes/font_size = 32
text = "New Game"
script = ExtResource("2_l6w84")

[node name="Options" type="Button" parent="CenterContainer/VBoxContainer"]
custom_minimum_size = Vector2(400, 100)
layout_mode = 2
theme_override_font_sizes/font_size = 32
text = "Options"
script = ExtResource("2_l6w84")

[node name="QuitButton" type="Button" parent="CenterContainer/VBoxContainer"]
custom_minimum_size = Vector2(400, 100)
layout_mode = 2
theme_override_font_sizes/font_size = 32
text = "Quit"
script = ExtResource("2_l6w84")
76 changes: 76 additions & 0 deletions scenes/menus/pause_menu.tscn
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
[gd_scene load_steps=3 format=3 uid="uid://dtnutgtckwipv"]

[ext_resource type="Script" path="res://scripts/pause_menu.gd" id="1_p7luq"]
[ext_resource type="Script" path="res://scripts/ui/audio_button.gd" id="2_yb0ds"]

[node name="PauseMenu" type="Control"]
process_mode = 3
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
mouse_filter = 2
script = ExtResource("1_p7luq")

[node name="ColorRect" type="ColorRect" parent="."]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
mouse_filter = 2
color = Color(0, 0, 0, 0.5)

[node name="CenterContainer" type="CenterContainer" parent="."]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
mouse_filter = 2

[node name="PanelContainer" type="PanelContainer" parent="CenterContainer"]
custom_minimum_size = Vector2(400, 200)
layout_mode = 2
mouse_filter = 2

[node name="MarginContainer" type="MarginContainer" parent="CenterContainer/PanelContainer"]
layout_mode = 2
mouse_filter = 2
theme_override_constants/margin_left = 16
theme_override_constants/margin_top = 16
theme_override_constants/margin_right = 16
theme_override_constants/margin_bottom = 16

[node name="VBoxContainer" type="VBoxContainer" parent="CenterContainer/PanelContainer/MarginContainer"]
layout_mode = 2
mouse_filter = 2
theme_override_constants/separation = 16

[node name="Label" type="Label" parent="CenterContainer/PanelContainer/MarginContainer/VBoxContainer"]
layout_mode = 2
theme_override_font_sizes/font_size = 32
text = "PAUSED"
horizontal_alignment = 1

[node name="ResumeButton" type="Button" parent="CenterContainer/PanelContainer/MarginContainer/VBoxContainer"]
custom_minimum_size = Vector2(200, 50)
layout_mode = 2
size_flags_horizontal = 4
mouse_default_cursor_shape = 2
theme_override_font_sizes/font_size = 24
text = "Resume"
script = ExtResource("2_yb0ds")

[node name="QuitButton" type="Button" parent="CenterContainer/PanelContainer/MarginContainer/VBoxContainer"]
custom_minimum_size = Vector2(200, 50)
layout_mode = 2
size_flags_horizontal = 4
mouse_default_cursor_shape = 2
theme_override_font_sizes/font_size = 24
text = "Quit to Menu"
script = ExtResource("2_yb0ds")
69 changes: 0 additions & 69 deletions scenes/pause_menu.tscn

This file was deleted.

6 changes: 5 additions & 1 deletion scenes/player.tscn
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
[gd_scene load_steps=4 format=3 uid="uid://boov2saejccy7"]
[gd_scene load_steps=5 format=3 uid="uid://boov2saejccy7"]

[ext_resource type="Script" path="res://scripts/player.gd" id="1_o86w8"]
[ext_resource type="Texture2D" uid="uid://bqjhgi43f43w2" path="res://assets/player/player_sprite.png" id="2_h6yh7"]
[ext_resource type="PackedScene" uid="uid://c0l75fsf0a0lh" path="res://scenes/ui/health_bar.tscn" id="3_gufyl"]
[ext_resource type="Script" path="res://scripts/animators/combat_animator.gd" id="4_10708"]

[node name="Player" type="Node2D"]
script = ExtResource("1_o86w8")
Expand All @@ -19,3 +20,6 @@ offset_left = -50.0
offset_top = 630.0
offset_right = 350.0
offset_bottom = 680.0

[node name="CombatAnimator" type="Node" parent="."]
script = ExtResource("4_10708")
Loading

0 comments on commit 8574c44

Please sign in to comment.