diff --git a/audio/sounds/cop_shoot.ogg b/audio/sounds/cop_shoot.ogg new file mode 100644 index 0000000..d877019 Binary files /dev/null and b/audio/sounds/cop_shoot.ogg differ diff --git a/audio/sounds/cop_shoot.ogg.import b/audio/sounds/cop_shoot.ogg.import new file mode 100644 index 0000000..4096abd --- /dev/null +++ b/audio/sounds/cop_shoot.ogg.import @@ -0,0 +1,15 @@ +[remap] + +importer="ogg_vorbis" +type="AudioStreamOGGVorbis" +path="res://.import/cop_shoot.ogg-9b313ebb8fdaa01b18fd3850d015564e.oggstr" + +[deps] + +source_file="res://audio/sounds/cop_shoot.ogg" +dest_files=[ "res://.import/cop_shoot.ogg-9b313ebb8fdaa01b18fd3850d015564e.oggstr" ] + +[params] + +loop=false +loop_offset=0 diff --git a/audio/sounds/shell.ogg b/audio/sounds/shell.ogg new file mode 100644 index 0000000..22bba6c Binary files /dev/null and b/audio/sounds/shell.ogg differ diff --git a/audio/sounds/shell.ogg.import b/audio/sounds/shell.ogg.import new file mode 100644 index 0000000..90fbd66 --- /dev/null +++ b/audio/sounds/shell.ogg.import @@ -0,0 +1,15 @@ +[remap] + +importer="ogg_vorbis" +type="AudioStreamOGGVorbis" +path="res://.import/shell.ogg-33573c264b05fde91faa4b27d4763823.oggstr" + +[deps] + +source_file="res://audio/sounds/shell.ogg" +dest_files=[ "res://.import/shell.ogg-33573c264b05fde91faa4b27d4763823.oggstr" ] + +[params] + +loop=false +loop_offset=0 diff --git a/autoloads/audio.gd b/autoloads/audio.gd index df1a0e1..f3314ef 100644 --- a/autoloads/audio.gd +++ b/autoloads/audio.gd @@ -61,6 +61,7 @@ const a_copsquash = preload("res://audio/sounds/copsquash.ogg") const a_copsquash2 = preload("res://audio/sounds/cop_splat.ogg") const a_fami_transform = preload("res://audio/sounds/fami_transform.ogg") const a_ominous = preload("res://audio/sounds/ominous.ogg") +const a_bullet_casing = preload("res://audio/sounds/shell.ogg") var loop_section = null var has_looped = false diff --git a/objects/enemy/bullet_casing.gd b/objects/enemy/bullet_casing.gd new file mode 100644 index 0000000..ea7236f --- /dev/null +++ b/objects/enemy/bullet_casing.gd @@ -0,0 +1,12 @@ +extends RigidBody2D + + +var has_played_sound = false + + + +func _on_BoneParticle_body_entered(body): + if !has_played_sound: + Audio.play_sound(Audio.a_bullet_casing, Audio.ac_climb) + has_played_sound = true + diff --git a/objects/enemy/bullet_casing.tscn b/objects/enemy/bullet_casing.tscn index 40007dd..32239f0 100644 --- a/objects/enemy/bullet_casing.tscn +++ b/objects/enemy/bullet_casing.tscn @@ -1,16 +1,20 @@ -[gd_scene load_steps=4 format=2] +[gd_scene load_steps=5 format=2] [ext_resource path="res://graphics/particles/bullet_casing.png" type="Texture" id=1] +[ext_resource path="res://objects/enemy/bullet_casing.gd" type="Script" id=2] [sub_resource type="PhysicsMaterial" id=4] -bounce = 0.75 +bounce = 0.5 [sub_resource type="RectangleShape2D" id=3] extents = Vector2( 1, 1.5 ) [node name="BoneParticle" type="RigidBody2D"] -collision_layer = 16 +collision_layer = 17 physics_material_override = SubResource( 4 ) +contacts_reported = 1 +contact_monitor = true +script = ExtResource( 2 ) [node name="Sprite" type="Sprite" parent="."] texture = ExtResource( 1 ) @@ -21,3 +25,6 @@ shape = SubResource( 3 ) __meta__ = { "_edit_group_": true } + +[connection signal="body_entered" from="." to="." method="_on_BoneParticle_body_entered"] +[connection signal="body_shape_entered" from="." to="." method="_on_BoneParticle_body_shape_entered"]