meat_madness_redux/godot/player/Overlay.gd

18 lines
504 B
GDScript3
Raw Normal View History

2022-11-27 21:06:36 -07:00
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():
2022-12-11 17:02:57 -07:00
$HurtScreen.modulate.a = 0.0
2022-11-27 21:06:36 -07:00
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
2022-12-11 17:02:57 -07:00
$HurtScreen/HurtScreenOpacityAnimation.play("opacity")