It's blood.
This commit is contained in:
parent
8c818ac174
commit
8264c9c1b8
18 changed files with 107 additions and 58 deletions
|
@ -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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue