forked from team-sg/hero-mark-2
It's blood.
This commit is contained in:
parent
8c818ac174
commit
8264c9c1b8
18 changed files with 107 additions and 58 deletions
|
@ -1,12 +0,0 @@
|
|||
[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 )
|
|
@ -1,19 +1,29 @@
|
|||
extends RigidBody2D
|
||||
|
||||
|
||||
const BloodSplatter := preload("res://objects/environment/blood/blood_splatter.tscn")
|
||||
const BloodStain := preload("res://objects/environment/blood/blood_stain.tscn")
|
||||
|
||||
|
||||
export var color: Color = Color(0xf53342ff)
|
||||
|
||||
|
||||
onready var sprite: Sprite = $Sprite
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
sprite.self_modulate = color
|
||||
|
||||
|
||||
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)
|
||||
if body.is_in_group("can_stain"):
|
||||
var stain = BloodStain.instance()
|
||||
stain.color = color
|
||||
stain.global_position = global_position
|
||||
body.add_child(stain)
|
||||
queue_free()
|
||||
elif body is TileMap:
|
||||
queue_free()
|
||||
|
|
|
@ -12,8 +12,8 @@ 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 )
|
||||
self_modulate = Color( 0.960784, 0.2, 0.258824, 1 )
|
||||
scale = Vector2( 0.75, 0.5 )
|
||||
texture = ExtResource( 1 )
|
||||
offset = Vector2( 2, 0 )
|
||||
flip_h = true
|
||||
|
|
12
objects/environment/blood/blood_stain.tscn
Normal file
12
objects/environment/blood/blood_stain.tscn
Normal file
|
@ -0,0 +1,12 @@
|
|||
[gd_scene load_steps=3 format=2]
|
||||
|
||||
[ext_resource path="res://graphics/particles/dust.png" type="Texture" id=1]
|
||||
[ext_resource path="res://objects/environment/blood/blood_stain.gd" type="Script" id=2]
|
||||
|
||||
[node name="BloodStain" type="Light2D"]
|
||||
light_mask = 3
|
||||
texture = ExtResource( 1 )
|
||||
color = Color( 0.960784, 0.2, 0.258824, 1 )
|
||||
mode = 2
|
||||
range_item_cull_mask = 2
|
||||
script = ExtResource( 2 )
|
|
@ -276,7 +276,7 @@ func _on_Dead_state_entered() -> void:
|
|||
particles.global_position = death_splatter_position.global_position
|
||||
particles.emitting = true
|
||||
get_parent().add_child(particles)
|
||||
for i in 32:
|
||||
for i in 16:
|
||||
var spray: RigidBody2D = BloodSpray.instance()
|
||||
spray.global_position = global_position
|
||||
spray.linear_velocity = Vector2(80.0, 0.0).rotated(randf() * TAU)
|
||||
|
|
|
@ -1066,6 +1066,7 @@ angle_random = 1.0
|
|||
scale_amount = 0.25
|
||||
scale_amount_random = 0.5
|
||||
scale_amount_curve = SubResource( 13 )
|
||||
color = Color( 0.956863, 0.92549, 0.831373, 1 )
|
||||
|
||||
[node name="PushableDetector" type="RayCast2D" parent="Graphics"]
|
||||
unique_name_in_owner = true
|
||||
|
@ -1553,8 +1554,8 @@ align = 1
|
|||
[connection signal="state_entered" from="StateChart/Root/Movement/Grounded/Shooting" to="." method="_on_Shooting_state_entered"]
|
||||
[connection signal="state_entered" from="StateChart/Root/Movement/Grounded/Pushing" to="." method="_on_Pushing_state_entered"]
|
||||
[connection signal="state_physics_processing" from="StateChart/Root/Movement/Grounded/Pushing" to="." method="_process_pushing"]
|
||||
[connection signal="state_entered" from="StateChart/Root/Movement/Airborne" to="." method="_on_Airborne_state_entered"]
|
||||
[connection signal="state_entered" from="StateChart/Root/Movement/Airborne" to="." method="reset_fall_speed"]
|
||||
[connection signal="state_entered" from="StateChart/Root/Movement/Airborne" to="." method="_on_Airborne_state_entered"]
|
||||
[connection signal="state_physics_processing" from="StateChart/Root/Movement/Airborne" to="." method="_process_gravity"]
|
||||
[connection signal="state_physics_processing" from="StateChart/Root/Movement/Airborne/Jump" to="." method="_process_horizontal_movement"]
|
||||
[connection signal="state_physics_processing" from="StateChart/Root/Movement/Airborne/Jump" to="." method="_process_jump"]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue