What's that smell?
This commit is contained in:
parent
dde551db56
commit
8c818ac174
16 changed files with 99 additions and 2 deletions
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
16
objects/enemy/death_particles.gd
Normal file
16
objects/enemy/death_particles.gd
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
extends CPUParticles2D
|
||||||
|
|
||||||
|
|
||||||
|
const BloodSpray := preload("res://objects/environment/blood/blood_spray.tscn")
|
||||||
|
|
||||||
|
|
||||||
|
export var spray_ammount: int = 16
|
||||||
|
export var spray_velocity: float = 80
|
||||||
|
|
||||||
|
|
||||||
|
func _ready() -> void:
|
||||||
|
for i in spray_ammount:
|
||||||
|
var spray: RigidBody2D = BloodSpray.instance()
|
||||||
|
spray.global_position = global_position
|
||||||
|
spray.linear_velocity = Vector2(spray_velocity, 0.0).rotated(randf() * TAU)
|
||||||
|
get_parent().add_child(spray)
|
|
@ -1,6 +1,7 @@
|
||||||
[gd_scene load_steps=3 format=2]
|
[gd_scene load_steps=4 format=2]
|
||||||
|
|
||||||
[ext_resource path="res://graphics/particles/blood.png" type="Texture" id=1]
|
[ext_resource path="res://graphics/particles/blood.png" type="Texture" id=1]
|
||||||
|
[ext_resource path="res://objects/enemy/death_particles.gd" type="Script" id=2]
|
||||||
|
|
||||||
[sub_resource type="Curve" id=43]
|
[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 ]
|
_data = [ Vector2( 0, 1 ), 0.0, -0.113537, 0, 0, Vector2( 1, 0 ), -3.35032, 0.0, 0, 0 ]
|
||||||
|
@ -26,3 +27,4 @@ angle_random = 1.0
|
||||||
scale_amount = 0.5
|
scale_amount = 0.5
|
||||||
scale_amount_random = 1.0
|
scale_amount_random = 1.0
|
||||||
scale_amount_curve = SubResource( 43 )
|
scale_amount_curve = SubResource( 43 )
|
||||||
|
script = ExtResource( 2 )
|
||||||
|
|
5
objects/environment/blood/blood_splatter.gd
Normal file
5
objects/environment/blood/blood_splatter.gd
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
extends Light2D
|
||||||
|
|
||||||
|
|
||||||
|
func _ready() -> void:
|
||||||
|
rotation = randf() * TAU
|
12
objects/environment/blood/blood_splatter.tscn
Normal file
12
objects/environment/blood/blood_splatter.tscn
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
[gd_scene load_steps=3 format=2]
|
||||||
|
|
||||||
|
[ext_resource path="res://graphics/particles/blood.png" type="Texture" id=1]
|
||||||
|
[ext_resource path="res://objects/environment/blood/blood_splatter.gd" type="Script" id=2]
|
||||||
|
|
||||||
|
[node name="Splatter" type="Light2D"]
|
||||||
|
texture = ExtResource( 1 )
|
||||||
|
color = Color( 0.960784, 0.2, 0.258824, 1 )
|
||||||
|
energy = 4.0
|
||||||
|
mode = 2
|
||||||
|
range_item_cull_mask = 3
|
||||||
|
script = ExtResource( 2 )
|
19
objects/environment/blood/blood_spray.gd
Normal file
19
objects/environment/blood/blood_spray.gd
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
extends RigidBody2D
|
||||||
|
|
||||||
|
|
||||||
|
const BloodSplatter := preload("res://objects/environment/blood/blood_splatter.tscn")
|
||||||
|
|
||||||
|
|
||||||
|
onready var sprite: Sprite = $Sprite
|
||||||
|
|
||||||
|
|
||||||
|
func _physics_process(delta: float) -> void:
|
||||||
|
sprite.global_rotation = linear_velocity.angle()
|
||||||
|
|
||||||
|
|
||||||
|
func _on_body_entered(body: Node) -> void:
|
||||||
|
if body is TileMap:
|
||||||
|
var splatter = BloodSplatter.instance()
|
||||||
|
splatter.global_position = global_position
|
||||||
|
get_parent().add_child(splatter)
|
||||||
|
queue_free()
|
24
objects/environment/blood/blood_spray.tscn
Normal file
24
objects/environment/blood/blood_spray.tscn
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
[gd_scene load_steps=4 format=2]
|
||||||
|
|
||||||
|
[ext_resource path="res://graphics/particles/muzzle_flash.png" type="Texture" id=1]
|
||||||
|
[ext_resource path="res://objects/environment/blood/blood_spray.gd" type="Script" id=3]
|
||||||
|
|
||||||
|
[sub_resource type="CircleShape2D" id=1]
|
||||||
|
radius = 1.0
|
||||||
|
|
||||||
|
[node name="BloodSpray" type="RigidBody2D"]
|
||||||
|
contacts_reported = 4
|
||||||
|
contact_monitor = true
|
||||||
|
script = ExtResource( 3 )
|
||||||
|
|
||||||
|
[node name="Sprite" type="Sprite" parent="."]
|
||||||
|
modulate = Color( 0.960784, 0.2, 0.258824, 1 )
|
||||||
|
scale = Vector2( 0.5, 0.5 )
|
||||||
|
texture = ExtResource( 1 )
|
||||||
|
offset = Vector2( 2, 0 )
|
||||||
|
flip_h = true
|
||||||
|
|
||||||
|
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||||
|
shape = SubResource( 1 )
|
||||||
|
|
||||||
|
[connection signal="body_entered" from="." to="." method="_on_body_entered"]
|
|
@ -6,6 +6,7 @@ signal died()
|
||||||
# CONSTANTS #
|
# CONSTANTS #
|
||||||
const ArrowProjectile = preload("res://objects/player/arrow_projectile.tscn")
|
const ArrowProjectile = preload("res://objects/player/arrow_projectile.tscn")
|
||||||
const DeathSplatter = preload("res://objects/player/player_death_particles.tscn")
|
const DeathSplatter = preload("res://objects/player/player_death_particles.tscn")
|
||||||
|
const BloodSpray := preload("res://objects/environment/blood/blood_spray.tscn")
|
||||||
|
|
||||||
# EXPORTS #
|
# EXPORTS #
|
||||||
## whether to be temporarily invulnerable after respawning
|
## whether to be temporarily invulnerable after respawning
|
||||||
|
@ -275,6 +276,11 @@ func _on_Dead_state_entered() -> void:
|
||||||
particles.global_position = death_splatter_position.global_position
|
particles.global_position = death_splatter_position.global_position
|
||||||
particles.emitting = true
|
particles.emitting = true
|
||||||
get_parent().add_child(particles)
|
get_parent().add_child(particles)
|
||||||
|
for i in 32:
|
||||||
|
var spray: RigidBody2D = BloodSpray.instance()
|
||||||
|
spray.global_position = global_position
|
||||||
|
spray.linear_velocity = Vector2(80.0, 0.0).rotated(randf() * TAU)
|
||||||
|
get_parent().add_child(spray)
|
||||||
else:
|
else:
|
||||||
skip_blood = false
|
skip_blood = false
|
||||||
# fade into the ether
|
# fade into the ether
|
||||||
|
|
|
@ -1566,8 +1566,8 @@ align = 1
|
||||||
[connection signal="state_entered" from="StateChart/Root/Movement/Airborne/Falling/NormalFalling" to="." method="_on_NormalFalling_state_entered"]
|
[connection signal="state_entered" from="StateChart/Root/Movement/Airborne/Falling/NormalFalling" to="." method="_on_NormalFalling_state_entered"]
|
||||||
[connection signal="state_physics_processing" from="StateChart/Root/Movement/Airborne/Falling/NormalFalling" to="." method="_process_horizontal_movement"]
|
[connection signal="state_physics_processing" from="StateChart/Root/Movement/Airborne/Falling/NormalFalling" to="." method="_process_horizontal_movement"]
|
||||||
[connection signal="state_entered" from="StateChart/Root/Movement/Airborne/Falling/ScaredFalling" to="." method="_on_ScaredFalling_state_entered"]
|
[connection signal="state_entered" from="StateChart/Root/Movement/Airborne/Falling/ScaredFalling" to="." method="_on_ScaredFalling_state_entered"]
|
||||||
[connection signal="state_entered" from="StateChart/Root/Movement/Airborne/DoubleJump" to="." method="_on_DoubleJump_state_entered"]
|
|
||||||
[connection signal="state_entered" from="StateChart/Root/Movement/Airborne/DoubleJump" to="." method="reset_fall_speed"]
|
[connection signal="state_entered" from="StateChart/Root/Movement/Airborne/DoubleJump" to="." method="reset_fall_speed"]
|
||||||
|
[connection signal="state_entered" from="StateChart/Root/Movement/Airborne/DoubleJump" to="." method="_on_DoubleJump_state_entered"]
|
||||||
[connection signal="state_physics_processing" from="StateChart/Root/Movement/Airborne/DoubleJump" to="." method="_process_horizontal_movement"]
|
[connection signal="state_physics_processing" from="StateChart/Root/Movement/Airborne/DoubleJump" to="." method="_process_horizontal_movement"]
|
||||||
[connection signal="state_entered" from="StateChart/Root/Movement/Airborne/AirShooting" to="." method="_on_AirShooting_state_entered"]
|
[connection signal="state_entered" from="StateChart/Root/Movement/Airborne/AirShooting" to="." method="_on_AirShooting_state_entered"]
|
||||||
[connection signal="state_physics_processing" from="StateChart/Root/Movement/Airborne/AirShooting" to="." method="_process_horizontal_movement"]
|
[connection signal="state_physics_processing" from="StateChart/Root/Movement/Airborne/AirShooting" to="." method="_process_horizontal_movement"]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue