Added destruction wall and player destruction

This commit is contained in:
2026-06-30 14:37:09 +03:00
parent 6b98e10bf4
commit 20e297999b
9 changed files with 109 additions and 11 deletions
+16
View File
@@ -0,0 +1,16 @@
shader_type canvas_item;
uniform float destruction_x = 0.0;
uniform float edge_width = 50.0;
uniform mat4 screen_to_world;
uniform sampler2D SCREEN_TEXTURE : hint_screen_texture, filter_nearest_mipmap;
void fragment() {
vec4 screen_color = texture(SCREEN_TEXTURE, SCREEN_UV);
vec4 world_pos = screen_to_world * vec4(FRAGCOORD.xy, 0.0, 1.0);
float dist = destruction_x - world_pos.x;
COLOR.a = smoothstep(-edge_width, edge_width, dist);
COLOR.a /= 2.0;
}
+1
View File
@@ -0,0 +1 @@
uid://b6gy8a5et63t1