lose screen animation

This commit is contained in:
Michael Campbell 2026-04-14 15:10:14 -04:00
parent 1d0032b587
commit dba09165e8
9 changed files with 151 additions and 2 deletions

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,5 @@
extends AnimationPlayer
func _process(_delta: float) -> void:
# ensure animation speed is unscaled
speed_scale = 1. / Engine.time_scale

View file

@ -0,0 +1 @@
uid://ck0331hehsf3n

15
levels/greyscale.gdshader Normal file
View file

@ -0,0 +1,15 @@
shader_type canvas_item;
uniform float effect_amount: hint_range(0, 1) = 0.0;
uniform sampler2D screen_texture : hint_screen_texture, repeat_disable, filter_nearest;
void fragment() {
vec4 c = texture(screen_texture, SCREEN_UV);
float y = 0.2126 * c.r + 0.7152 * c.g + 0.0722 * c.b;
COLOR.rgb = mix(c.rgb, vec3(y), effect_amount);
}
//void light() {
// // Called for every pixel for every light affecting the CanvasItem.
// // Uncomment to replace the default light processing function with this one.
//}

View file

@ -0,0 +1 @@
uid://cgrk2eiljt4v1

View file

@ -22,9 +22,12 @@ static func is_active() -> bool:
return false
func _ready() -> void:
%ResultsScreen.hide()
level = self
func _on_player_died() -> void:
active = false
%DeathAnimation.play(&"death")
%ResultsScreen.update_labels()
%ResultsScreen.show()

View file

@ -30,7 +30,7 @@ func _on_restart_pressed() -> void:
get_tree().reload_current_scene()
func _on_quit_pressed() -> void:
get_tree().quit()
get_tree().change_scene_to_file("res://ui/title_screen/title_screen.tscn")
func _ready() -> void:
SignalBus.building_destroyed.connect(func(_b, _s): buildings_destroyed_count += 1)

8
levels/timescale_node.gd Normal file
View file

@ -0,0 +1,8 @@
extends Node
@export var time_scale := 1.:
set(v):
Engine.time_scale = v
func _ready() -> void:
time_scale = time_scale

View file

@ -0,0 +1 @@
uid://bm3t2dcw4e32i