meat_madness_redux/godot/player/Overlay.gd

18 lines
504 B
GDScript

extends CanvasLayer
# This is just a proof of concept, feel free to remove.
# This should be triggered by some central damage taking system
onready var OnFootPhysics = get_node("../OnFootPhysics")
var will_fall_hard = false
func _ready():
$HurtScreen.modulate.a = 0.0
func _process(_delta):
if OnFootPhysics.is_falling_velocity_terminal():
will_fall_hard = true
if will_fall_hard and OnFootPhysics.is_on_floor():
will_fall_hard = false
$HurtScreen/HurtScreenOpacityAnimation.play("opacity")