forked from team-sg/hero-mark-2
inflict upon EVERYONE a bloody death!
This commit is contained in:
parent
2166d4443f
commit
18f5b28295
3 changed files with 46 additions and 2 deletions
|
@ -1,5 +1,7 @@
|
|||
extends Node2D
|
||||
|
||||
const DeathParticles = preload("res://objects/enemy/death_particles.tscn")
|
||||
|
||||
export var can_be_killed_by_sword = true
|
||||
export var can_be_killed_by_arrow = true
|
||||
export var can_be_squashed = true
|
||||
|
@ -33,5 +35,11 @@ func _on_Area2D_area_entered(area):
|
|||
die()
|
||||
|
||||
func die():
|
||||
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.score += score_for_killing
|
||||
queue_free()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue