forked from team-sg/hero-mark-2
skeleton proper death sound, better bone particles
This commit is contained in:
parent
30d7e84a46
commit
b1beffd97b
10 changed files with 46 additions and 10 deletions
BIN
audio/sounds/bonebreak.wav
Normal file
BIN
audio/sounds/bonebreak.wav
Normal file
Binary file not shown.
23
audio/sounds/bonebreak.wav.import
Normal file
23
audio/sounds/bonebreak.wav.import
Normal 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
|
1
game.gd
1
game.gd
|
@ -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_shoot = preload("res://audio/sounds/a_egg_shoot.ogg")
|
||||||
const a_die = preload("res://audio/sounds/die.wav")
|
const a_die = preload("res://audio/sounds/die.wav")
|
||||||
const a_gover = preload("res://audio/sounds/gover.wav")
|
const a_gover = preload("res://audio/sounds/gover.wav")
|
||||||
|
const a_bone = preload("res://audio/sounds/bonebreak.wav")
|
||||||
#Objects
|
#Objects
|
||||||
const block_text = preload("res://objects/hud/blocktext.tscn")
|
const block_text = preload("res://objects/hud/blocktext.tscn")
|
||||||
const pause_screen = preload("res://objects/hud/pause_screen.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 |
|
@ -5,9 +5,8 @@
|
||||||
[sub_resource type="PhysicsMaterial" id=2]
|
[sub_resource type="PhysicsMaterial" id=2]
|
||||||
bounce = 0.75
|
bounce = 0.75
|
||||||
|
|
||||||
[sub_resource type="SegmentShape2D" id=1]
|
[sub_resource type="RectangleShape2D" id=3]
|
||||||
a = Vector2( 0, -2 )
|
extents = Vector2( 0.5, 1.5 )
|
||||||
b = Vector2( 0, 2 )
|
|
||||||
|
|
||||||
[node name="BoneParticle" type="RigidBody2D"]
|
[node name="BoneParticle" type="RigidBody2D"]
|
||||||
collision_layer = 16
|
collision_layer = 16
|
||||||
|
@ -17,4 +16,8 @@ physics_material_override = SubResource( 2 )
|
||||||
texture = ExtResource( 1 )
|
texture = ExtResource( 1 )
|
||||||
|
|
||||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||||
shape = SubResource( 1 )
|
position = Vector2( -0.5, 0.5 )
|
||||||
|
shape = SubResource( 3 )
|
||||||
|
__meta__ = {
|
||||||
|
"_edit_group_": true
|
||||||
|
}
|
||||||
|
|
|
@ -17,6 +17,9 @@ const DeathParticles = preload("res://objects/enemy/death_particles.tscn")
|
||||||
#export var can_be_squashed = true
|
#export var can_be_squashed = true
|
||||||
|
|
||||||
export var score_for_killing = 0
|
export var score_for_killing = 0
|
||||||
|
export var blood = true
|
||||||
|
|
||||||
|
var death_sound = Game.a_die
|
||||||
|
|
||||||
func _on_Hitbox_area_entered(area):
|
func _on_Hitbox_area_entered(area):
|
||||||
#Kill player
|
#Kill player
|
||||||
|
@ -24,11 +27,12 @@ func _on_Hitbox_area_entered(area):
|
||||||
area.get_parent().die()
|
area.get_parent().die()
|
||||||
|
|
||||||
func die():
|
func die():
|
||||||
var death_particles = DeathParticles.instance()
|
if blood:
|
||||||
death_particles.global_position = global_position
|
var death_particles = DeathParticles.instance()
|
||||||
death_particles.emitting = true
|
death_particles.global_position = global_position
|
||||||
get_parent().add_child(death_particles)
|
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
|
Game.score += score_for_killing
|
||||||
queue_free()
|
queue_free()
|
||||||
|
|
|
@ -15,6 +15,7 @@ onready var anims = $AnimationPlayer
|
||||||
onready var sprite = $Sprite
|
onready var sprite = $Sprite
|
||||||
|
|
||||||
func _ready():
|
func _ready():
|
||||||
|
death_sound = Game.a_bone
|
||||||
timer.start(shoot_time)
|
timer.start(shoot_time)
|
||||||
|
|
||||||
func _on_Timer_timeout():
|
func _on_Timer_timeout():
|
||||||
|
|
|
@ -143,6 +143,7 @@ tracks/3/keys = {
|
||||||
|
|
||||||
[node name="Skelarcher" type="Node2D" groups=["enemy"]]
|
[node name="Skelarcher" type="Node2D" groups=["enemy"]]
|
||||||
script = ExtResource( 4 )
|
script = ExtResource( 4 )
|
||||||
|
blood = false
|
||||||
shoot_time = 3.0
|
shoot_time = 3.0
|
||||||
|
|
||||||
[node name="Sprite" type="Sprite" parent="."]
|
[node name="Sprite" type="Sprite" parent="."]
|
||||||
|
|
|
@ -55,6 +55,9 @@ func _on_Hitbox_area_entered(area):
|
||||||
if target_group == "enemy_hitbox":
|
if target_group == "enemy_hitbox":
|
||||||
Game.arrows = max(0, Game.arrows - 1) # clamp arrows above 0
|
Game.arrows = max(0, Game.arrows - 1) # clamp arrows above 0
|
||||||
queue_free()
|
queue_free()
|
||||||
|
elif area.is_in_group("arrow"):
|
||||||
|
_make_sparks()
|
||||||
|
queue_free()
|
||||||
|
|
||||||
func _make_sparks():
|
func _make_sparks():
|
||||||
var particles = $SparkParticles
|
var particles = $SparkParticles
|
||||||
|
|
|
@ -75,7 +75,6 @@ process_material = SubResource( 5 )
|
||||||
texture = ExtResource( 4 )
|
texture = ExtResource( 4 )
|
||||||
|
|
||||||
[node name="Hitbox" type="Area2D" parent="." groups=["arrow"]]
|
[node name="Hitbox" type="Area2D" parent="." groups=["arrow"]]
|
||||||
collision_layer = 0
|
|
||||||
|
|
||||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="Hitbox"]
|
[node name="CollisionShape2D" type="CollisionShape2D" parent="Hitbox"]
|
||||||
position = Vector2( -0.5, -0.5 )
|
position = Vector2( -0.5, -0.5 )
|
||||||
|
@ -86,6 +85,7 @@ position = Vector2( 4, 0 )
|
||||||
emitting = false
|
emitting = false
|
||||||
amount = 16
|
amount = 16
|
||||||
lifetime = 0.5
|
lifetime = 0.5
|
||||||
|
one_shot = true
|
||||||
explosiveness = 1.0
|
explosiveness = 1.0
|
||||||
process_material = SubResource( 8 )
|
process_material = SubResource( 8 )
|
||||||
texture = ExtResource( 4 )
|
texture = ExtResource( 4 )
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue