Add ice effect component to enemies and adjust collapsing bridge collapse time

This commit is contained in:
2025-05-01 20:36:40 +02:00
parent 51cb49d7df
commit ebfd5f0e60
8 changed files with 107 additions and 5 deletions

View File

@@ -0,0 +1,21 @@
shader_type canvas_item;
uniform vec4 shine_color : source_color = vec4(1.0);
uniform float shine_speed : hint_range(-10.0, 10.0, 0.1) = 1.0;
uniform float shine_size : hint_range(0.001, 1.0, 0.01) = 0.01;
uniform float shine_frequency: hint_range(1.0, 45.0, 0.5) = 5.0;
uniform float shine_angle_deg : hint_range(-360.0, 360.0, 1.0) = 45.0;
void fragment() {
COLOR = texture(TEXTURE, UV);
// Convert degrees to radians
float angle_rad = radians(shine_angle_deg);
// Calculate direction vector for the shine line
vec2 shine_dir = vec2(cos(angle_rad), sin(angle_rad));
// Project UV onto shine direction
float projection = dot(UV, shine_dir);
float shine = step(1.0 - shine_size * 0.5, 0.5 + 0.5 * sin(projection + TIME * shine_speed * shine_frequency));
COLOR.rgb = mix(COLOR.rgb, shine_color.rgb, shine * shine_color.a);
}