19 lines
447 B
GDScript
19 lines
447 B
GDScript
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()
|