diff --git a/Audio/walk-home-steps-sound_99bpm_B_minor.wav.reapeaks b/Audio/walk-home-steps-sound_99bpm_B_minor.wav.reapeaks deleted file mode 100644 index c0cfceb..0000000 Binary files a/Audio/walk-home-steps-sound_99bpm_B_minor.wav.reapeaks and /dev/null differ diff --git a/Audio/whoosh.wav b/Audio/whoosh.wav new file mode 100644 index 0000000..a4ba5eb Binary files /dev/null and b/Audio/whoosh.wav differ diff --git a/Audio/whoosh.wav.import b/Audio/whoosh.wav.import new file mode 100644 index 0000000..8bf3939 --- /dev/null +++ b/Audio/whoosh.wav.import @@ -0,0 +1,23 @@ +[remap] + +importer="wav" +type="AudioStreamSample" +path="res://.import/whoosh.wav-3f78e56f3c095630fbe6defec4c28484.sample" + +[deps] + +source_file="res://Audio/whoosh.wav" +dest_files=[ "res://.import/whoosh.wav-3f78e56f3c095630fbe6defec4c28484.sample" ] + +[params] + +force/8_bit=false +force/mono=false +force/max_rate=false +force/max_rate_hz=44100 +edit/trim=false +edit/normalize=false +edit/loop_mode=0 +edit/loop_begin=0 +edit/loop_end=-1 +compress/mode=0 diff --git a/Player.gd b/Player.gd index f87d5c1..5eb05bb 100644 --- a/Player.gd +++ b/Player.gd @@ -32,11 +32,10 @@ onready var ground_check = $GroundCheck onready var slap_gauge = $HUD/PlayerLayer/ActualHUD/SlapGauge onready var slap_animator = $HandMovement onready var Menu = $HUD/MenuLayer/Start -onready var AudioSlap = $AudioSlap -onready var AudioMegaSlap = $AudioMegaSlap onready var hitbox = $Head/Camera/HitBox onready var slap_cooldown = $SlapCooldown onready var AudioCharge = $AudioCharge +onready var Whoosh = $AudioWhoosh onready var Music = $Music onready var Steps = [ $Step1, $Step2, $Step3, $Step4 ] var rng = RandomNumberGenerator.new() @@ -108,8 +107,9 @@ func _physics_process(delta): chargeSlap = true; elif Input.is_action_just_released("slap"): if chargeSlap: - isSlap = true; - chargeSlap = false; + isSlap = true + Whoosh.play() + chargeSlap = false can_slap = false slap_cooldown.start(0.25) AudioCharge.stop(); @@ -131,16 +131,11 @@ func _physics_process(delta): slap_gauge.kill = slapkill; if isSlap: - if slap >= slapkill: - AudioMegaSlap.play() - else: - AudioSlap.play() - isSlap = false; + isSlap = false; hitbox.monitorable = true hitbox.slap_level = slap hitbox.slap_kill = slapkill hitbox.slap_vector = point_to.get_global_transform().origin - camera.get_global_transform().origin - direction = direction.normalized() if isStep: diff --git a/Player.tscn b/Player.tscn index 22a946c..67f5d93 100644 --- a/Player.tscn +++ b/Player.tscn @@ -1,11 +1,10 @@ -[gd_scene load_steps=21 format=2] +[gd_scene load_steps=20 format=2] [ext_resource path="res://Player.gd" type="Script" id=1] [ext_resource path="res://BlenderStuff/Hand/protohand.obj" type="ArrayMesh" id=2] [ext_resource path="res://Textures/kenney_prototype_textures/purple/texture_01.png" type="Texture" id=3] [ext_resource path="res://HUD.tscn" type="PackedScene" id=4] -[ext_resource path="res://Audio/80-s-clap.wav" type="AudioStream" id=5] -[ext_resource path="res://Audio/MegaSlap.wav" type="AudioStream" id=6] +[ext_resource path="res://Audio/whoosh.wav" type="AudioStream" id=5] [ext_resource path="res://Scripts/HitBox.gd" type="Script" id=7] [ext_resource path="res://Audio/step2.wav" type="AudioStream" id=8] [ext_resource path="res://Audio/step3.wav" type="AudioStream" id=9] @@ -148,23 +147,6 @@ cast_to = Vector3( 0, -1.5, 0 ) anims/RESET = SubResource( 5 ) anims/basic_slap = SubResource( 6 ) -[node name="AudioSlap" type="AudioStreamPlayer3D" parent="."] -stream = ExtResource( 5 ) -attenuation_model = 2 -unit_db = 80.0 -max_db = 6.0 -bus = "SFX" - -[node name="AudioMegaSlap" type="AudioStreamPlayer3D" parent="."] -stream = ExtResource( 6 ) -attenuation_model = 2 -unit_db = 60.0 -max_db = 4.0 -pitch_scale = 2.0 -bus = "SFX" -emission_angle_enabled = true -doppler_tracking = 2 - [node name="Music" type="AudioStreamPlayer" parent="."] stream = ExtResource( 13 ) volume_db = -3.0 @@ -216,4 +198,9 @@ pitch_scale = 0.79 bus = "SFX" doppler_tracking = 2 +[node name="AudioWhoosh" type="AudioStreamPlayer" parent="."] +stream = ExtResource( 5 ) +volume_db = -9.613 +pitch_scale = 8.0 + [connection signal="timeout" from="SlapCooldown" to="." method="_on_SlapCooldown_timeout"] diff --git a/Scenes/Enemy.tscn b/Scenes/Enemy.tscn index 55654f0..f8b1a42 100644 --- a/Scenes/Enemy.tscn +++ b/Scenes/Enemy.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=16 format=2] +[gd_scene load_steps=18 format=2] [ext_resource path="res://Scripts/HitBox.gd" type="Script" id=1] [ext_resource path="res://Scenes/Enemy.gd" type="Script" id=2] @@ -7,6 +7,8 @@ [ext_resource path="res://Textures/MetalCorrodedHeavy001/MetalCorrodedHeavy001_Flat.jpg" type="Texture" id=5] [ext_resource path="res://Textures/MetalCorrodedHeavy001/MetalCorrodedHeavy001_NRM_1K_METALNESS.jpg" type="Texture" id=6] [ext_resource path="res://Audio/boom.wav" type="AudioStream" id=7] +[ext_resource path="res://Audio/80-s-clap.wav" type="AudioStream" id=8] +[ext_resource path="res://Audio/MegaSlap.wav" type="AudioStream" id=9] [sub_resource type="SphereMesh" id=6] @@ -69,6 +71,25 @@ script = ExtResource( 3 ) [node name="HeadCollision" type="CollisionShape" parent="Hurtbox"] shape = SubResource( 7 ) +[node name="AudioSlap" type="AudioStreamPlayer3D" parent="Hurtbox"] +transform = Transform( 0.491077, 0, 0, 0, 0.491077, 0, 0, 0, 0.491077, 0, 0, 0 ) +stream = ExtResource( 8 ) +attenuation_model = 2 +unit_db = 80.0 +max_db = 6.0 +bus = "SFX" + +[node name="AudioMegaSlap" type="AudioStreamPlayer3D" parent="Hurtbox"] +transform = Transform( 0.491077, 0, 0, 0, 0.491077, 0, 0, 0, 0.491077, 0, 0, 0 ) +stream = ExtResource( 9 ) +attenuation_model = 2 +unit_db = 60.0 +max_db = 4.0 +pitch_scale = 2.0 +bus = "SFX" +emission_angle_enabled = true +doppler_tracking = 2 + [node name="EnemyCollision" type="CollisionShape" parent="."] transform = Transform( 1, 0, 0, 0, -4.37114e-08, -1, 0, 1, -4.37114e-08, 0, -0.094023, 0 ) shape = SubResource( 8 ) diff --git a/Scripts/HurtBox.gd b/Scripts/HurtBox.gd index ca13869..2c7a827 100644 --- a/Scripts/HurtBox.gd +++ b/Scripts/HurtBox.gd @@ -1,6 +1,9 @@ class_name HurtBox extends Area +onready var Slap = $AudioSlap +onready var MegaSlap = $AudioMegaSlap + func _init(): collision_layer = 0 collision_mask = 2 @@ -14,7 +17,12 @@ func _on_area_entered(hitbox: HitBox): if hitbox.hitbox_type == hitbox.HitboxType.Unassigned: return + if hitbox.hitbox_type == hitbox.HitboxType.Slap and owner.has_method("get_slapped"): owner.get_slapped(hitbox.slap_level,hitbox.slap_kill, hitbox.slap_vector) + if hitbox.slap_level >= hitbox.slap_kill: + MegaSlap.play() + else: + Slap.play() elif hitbox.hitbox_type == hitbox.HitboxType.Projectile and owner.has_method("get_shot"): owner.get_shot(hitbox.owner)