robots have oil, not blood

This commit is contained in:
Haze Weathers 2023-10-06 14:52:37 -04:00
parent fe09f34bf8
commit 5ffd99fb08
4 changed files with 18 additions and 3 deletions

View file

@ -1,9 +1,22 @@
extends Node2D
func _ready():
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:
$AnimatedSprite.playing = true
for i in spray_ammount:
var spray = BloodSpray.instance()
spray.color = Color(0x20223aff)
spray.global_position = global_position
spray.velocity = Vector2(randf() * spray_velocity, 0.0).rotated(randf() * TAU)
get_parent().add_child(spray)
func _on_AnimatedSprite_animation_finished():
$AnimatedSprite.queue_free()