skeleton proper death sound, better bone particles

This commit is contained in:
Haze Weathers 2023-01-21 00:32:28 -05:00
parent 30d7e84a46
commit b1beffd97b
10 changed files with 46 additions and 10 deletions

BIN
audio/sounds/bonebreak.wav Normal file

Binary file not shown.

View file

@ -0,0 +1,23 @@
[remap]
importer="wav"
type="AudioStreamSample"
path="res://.import/bonebreak.wav-14186323e77d90e5dc18927fa3d77983.sample"
[deps]
source_file="res://audio/sounds/bonebreak.wav"
dest_files=[ "res://.import/bonebreak.wav-14186323e77d90e5dc18927fa3d77983.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

View file

@ -35,6 +35,7 @@ const a_doublejump = preload("res://audio/sounds/a_bree.wav")
const a_shoot = preload("res://audio/sounds/a_egg_shoot.ogg")
const a_die = preload("res://audio/sounds/die.wav")
const a_gover = preload("res://audio/sounds/gover.wav")
const a_bone = preload("res://audio/sounds/bonebreak.wav")
#Objects
const block_text = preload("res://objects/hud/blocktext.tscn")
const pause_screen = preload("res://objects/hud/pause_screen.tscn")

Binary file not shown.

Before

Width:  |  Height:  |  Size: 578 B

After

Width:  |  Height:  |  Size: 4.8 KiB

Before After
Before After

View file

@ -5,9 +5,8 @@
[sub_resource type="PhysicsMaterial" id=2]
bounce = 0.75
[sub_resource type="SegmentShape2D" id=1]
a = Vector2( 0, -2 )
b = Vector2( 0, 2 )
[sub_resource type="RectangleShape2D" id=3]
extents = Vector2( 0.5, 1.5 )
[node name="BoneParticle" type="RigidBody2D"]
collision_layer = 16
@ -17,4 +16,8 @@ physics_material_override = SubResource( 2 )
texture = ExtResource( 1 )
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
shape = SubResource( 1 )
position = Vector2( -0.5, 0.5 )
shape = SubResource( 3 )
__meta__ = {
"_edit_group_": true
}

View file

@ -17,6 +17,9 @@ const DeathParticles = preload("res://objects/enemy/death_particles.tscn")
#export var can_be_squashed = true
export var score_for_killing = 0
export var blood = true
var death_sound = Game.a_die
func _on_Hitbox_area_entered(area):
#Kill player
@ -24,11 +27,12 @@ func _on_Hitbox_area_entered(area):
area.get_parent().die()
func die():
var death_particles = DeathParticles.instance()
death_particles.global_position = global_position
death_particles.emitting = true
get_parent().add_child(death_particles)
if blood:
var death_particles = DeathParticles.instance()
death_particles.global_position = global_position
death_particles.emitting = true
get_parent().add_child(death_particles)
Game.play_sound(Game.a_die, Game.ac_die)
Game.play_sound(death_sound, Game.ac_die)
Game.score += score_for_killing
queue_free()

View file

@ -15,6 +15,7 @@ onready var anims = $AnimationPlayer
onready var sprite = $Sprite
func _ready():
death_sound = Game.a_bone
timer.start(shoot_time)
func _on_Timer_timeout():

View file

@ -143,6 +143,7 @@ tracks/3/keys = {
[node name="Skelarcher" type="Node2D" groups=["enemy"]]
script = ExtResource( 4 )
blood = false
shoot_time = 3.0
[node name="Sprite" type="Sprite" parent="."]

View file

@ -55,6 +55,9 @@ func _on_Hitbox_area_entered(area):
if target_group == "enemy_hitbox":
Game.arrows = max(0, Game.arrows - 1) # clamp arrows above 0
queue_free()
elif area.is_in_group("arrow"):
_make_sparks()
queue_free()
func _make_sparks():
var particles = $SparkParticles

View file

@ -75,7 +75,6 @@ process_material = SubResource( 5 )
texture = ExtResource( 4 )
[node name="Hitbox" type="Area2D" parent="." groups=["arrow"]]
collision_layer = 0
[node name="CollisionShape2D" type="CollisionShape2D" parent="Hitbox"]
position = Vector2( -0.5, -0.5 )
@ -86,6 +85,7 @@ position = Vector2( 4, 0 )
emitting = false
amount = 16
lifetime = 0.5
one_shot = true
explosiveness = 1.0
process_material = SubResource( 8 )
texture = ExtResource( 4 )