lose screen animation
This commit is contained in:
parent
1d0032b587
commit
dba09165e8
9 changed files with 151 additions and 2 deletions
File diff suppressed because one or more lines are too long
5
levels/death_animation.gd
Normal file
5
levels/death_animation.gd
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
extends AnimationPlayer
|
||||
|
||||
func _process(_delta: float) -> void:
|
||||
# ensure animation speed is unscaled
|
||||
speed_scale = 1. / Engine.time_scale
|
||||
1
levels/death_animation.gd.uid
Normal file
1
levels/death_animation.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://ck0331hehsf3n
|
||||
15
levels/greyscale.gdshader
Normal file
15
levels/greyscale.gdshader
Normal 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.
|
||||
//}
|
||||
1
levels/greyscale.gdshader.uid
Normal file
1
levels/greyscale.gdshader.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://cgrk2eiljt4v1
|
||||
|
|
@ -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()
|
||||
|
||||
|
|
|
|||
|
|
@ -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
8
levels/timescale_node.gd
Normal 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
|
||||
1
levels/timescale_node.gd.uid
Normal file
1
levels/timescale_node.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://bm3t2dcw4e32i
|
||||
Loading…
Add table
Add a link
Reference in a new issue