forked from team-sg/hero-mark-2
inflict upon SG a bloody death
This commit is contained in:
parent
da03fddf2d
commit
2166d4443f
4 changed files with 77 additions and 1 deletions
|
@ -7,6 +7,7 @@ onready var climb_ray = $ClimbRay
|
|||
onready var anims = $AnimationPlayer
|
||||
onready var sword_sprite = $SwordSprite
|
||||
onready var sword_hitbox = $SwordArea
|
||||
onready var death_particles = $DeathSplatter
|
||||
#Map
|
||||
onready var map = get_owner()
|
||||
##States
|
||||
|
@ -244,6 +245,10 @@ func check_ladder():
|
|||
#climb_ray.position.x = 4 * sprite.scale.x
|
||||
|
||||
func die():
|
||||
var new_particles = death_particles.duplicate()
|
||||
get_parent().add_child(new_particles)
|
||||
new_particles.global_position = global_position
|
||||
new_particles.emitting = true
|
||||
position = Game.respawn_point
|
||||
Game.lives -= 1
|
||||
Game.play_sound(Game.a_die,Game.ac_die)
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
[gd_scene load_steps=28 format=2]
|
||||
[gd_scene load_steps=32 format=2]
|
||||
|
||||
[ext_resource path="res://objects/player/player.gd" type="Script" id=1]
|
||||
[ext_resource path="res://graphics/player/sg_walk.png" type="Texture" id=2]
|
||||
|
@ -14,6 +14,7 @@
|
|||
[ext_resource path="res://graphics/player/sg_shoot_air.png" type="Texture" id=12]
|
||||
[ext_resource path="res://scripts/recolor.tres" type="Shader" id=13]
|
||||
[ext_resource path="res://graphics/player/sg_doublejump.png" type="Texture" id=14]
|
||||
[ext_resource path="res://graphics/particles/blood.png" type="Texture" id=15]
|
||||
|
||||
[sub_resource type="ShaderMaterial" id=38]
|
||||
resource_local_to_scene = true
|
||||
|
@ -599,6 +600,31 @@ tracks/4/keys = {
|
|||
[sub_resource type="RectangleShape2D" id=34]
|
||||
extents = Vector2( 6, 7 )
|
||||
|
||||
[sub_resource type="Curve" id=41]
|
||||
_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( 41 )
|
||||
|
||||
[sub_resource type="ParticlesMaterial" id=40]
|
||||
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="Player" type="KinematicBody2D"]
|
||||
collision_layer = 2
|
||||
collision_mask = 5
|
||||
|
@ -655,4 +681,14 @@ position = Vector2( 0, 3 )
|
|||
shape = SubResource( 34 )
|
||||
disabled = true
|
||||
|
||||
[node name="DeathSplatter" type="Particles2D" parent="."]
|
||||
emitting = false
|
||||
amount = 16
|
||||
lifetime = 0.3
|
||||
one_shot = true
|
||||
explosiveness = 0.9
|
||||
local_coords = false
|
||||
process_material = SubResource( 40 )
|
||||
texture = ExtResource( 15 )
|
||||
|
||||
[connection signal="animation_finished" from="AnimationPlayer" to="." method="_on_AnimationPlayer_animation_finished"]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue