inflict upon EVERYONE a bloody death!
This commit is contained in:
parent
2166d4443f
commit
18f5b28295
3 changed files with 46 additions and 2 deletions
37
objects/enemy/death_particles.tscn
Normal file
37
objects/enemy/death_particles.tscn
Normal file
|
@ -0,0 +1,37 @@
|
|||
[gd_scene load_steps=5 format=2]
|
||||
|
||||
[ext_resource path="res://graphics/particles/blood.png" type="Texture" id=1]
|
||||
|
||||
[sub_resource type="Curve" id=43]
|
||||
_data = [ Vector2( 0, 1 ), 0.0, -0.113537, 0, 0, Vector2( 1, 0 ), -3.35032, 0.0, 0, 0 ]
|
||||
|
||||
[sub_resource type="CurveTexture" id=42]
|
||||
width = 128
|
||||
curve = SubResource( 43 )
|
||||
|
||||
[sub_resource type="ParticlesMaterial" id=44]
|
||||
emission_shape = 2
|
||||
emission_box_extents = Vector3( 4, 4, 0 )
|
||||
flag_disable_z = true
|
||||
direction = Vector3( 0, -1, 0 )
|
||||
spread = 180.0
|
||||
gravity = Vector3( 0, 50, 0 )
|
||||
initial_velocity = 60.0
|
||||
initial_velocity_random = 0.9
|
||||
orbit_velocity = 0.0
|
||||
orbit_velocity_random = 0.0
|
||||
damping = 2.0
|
||||
angle = 720.0
|
||||
angle_random = 1.0
|
||||
scale = 0.5
|
||||
scale_random = 1.0
|
||||
scale_curve = SubResource( 42 )
|
||||
|
||||
[node name="DeathSplatter" type="Particles2D"]
|
||||
emitting = false
|
||||
lifetime = 0.2
|
||||
one_shot = true
|
||||
explosiveness = 0.9
|
||||
local_coords = false
|
||||
process_material = SubResource( 44 )
|
||||
texture = ExtResource( 1 )
|
|
@ -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