diff --git a/assets/textures/pip_pattern.png b/assets/textures/pip_pattern.png new file mode 100644 index 0000000..9914f33 --- /dev/null +++ b/assets/textures/pip_pattern.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b85087e64788b48901da2638680849c84ae02294d4a3594dc06019e1a6d4a794 +size 1080 diff --git a/assets/textures/pip_pattern.png.import b/assets/textures/pip_pattern.png.import new file mode 100644 index 0000000..2ff39f2 --- /dev/null +++ b/assets/textures/pip_pattern.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://blfths5fy3a5u" +path="res://.godot/imported/pip_pattern.png-cf2584ffc7c1ed78c418b9ce4a42b20e.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/textures/pip_pattern.png" +dest_files=["res://.godot/imported/pip_pattern.png-cf2584ffc7c1ed78c418b9ce4a42b20e.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/src/shaders/glint_2d.gdshader b/src/shaders/glint_2d.gdshader new file mode 100644 index 0000000..89f2a39 --- /dev/null +++ b/src/shaders/glint_2d.gdshader @@ -0,0 +1,72 @@ +/* 2D Glint Effect + * from https://godotshaders.com/shader/highlight-canvasitem/ + */ +shader_type canvas_item; +render_mode blend_premul_alpha; + +uniform float Line_Smoothness : hint_range(0, 0.1) = 0.045; +uniform float Line_Width : hint_range(0, 0.2) = 0.09; +uniform float Brightness = 3.0; +uniform float Rotation_deg : hint_range(-90, 90) = 30; +uniform float Distortion : hint_range(1, 2) = 1.8; +uniform float Speed = 0.7; +uniform float Position : hint_range(0, 1) = 0; +uniform float Position_Min = 0.25; +uniform float Position_Max = 0.5; +uniform float Alpha : hint_range(0, 1) = 1; + +vec2 rotate_uv(vec2 uv, vec2 center, float rotation, bool use_degrees){ + float _angle = rotation; + if(use_degrees){ + _angle = rotation * (3.1415926/180.0); + } + mat2 _rotation = mat2( + vec2(cos(_angle), -sin(_angle)), + vec2(sin(_angle), cos(_angle)) + ); + vec2 _delta = uv - center; + _delta = _rotation * _delta; + return _delta + center; + } + +void fragment() { + + vec2 center_uv = UV - vec2(0.5, 0.5); + float gradient_to_edge = max(abs(center_uv.x), abs(center_uv.y)); + gradient_to_edge = gradient_to_edge * Distortion; + gradient_to_edge = 1.0 - gradient_to_edge; + vec2 rotaded_uv = rotate_uv(UV, vec2(0.5, 0.5), Rotation_deg, true); + + float remapped_position; + { + float output_range = Position_Max - Position_Min; + remapped_position = Position_Min + output_range * Position; + } + + float remapped_time = TIME * Speed + remapped_position; + remapped_time = fract(remapped_time); + { + float output_range = 2.0 - (-2.0); + remapped_time = -2.0 + output_range * remapped_time; + } + + vec2 offset_uv = vec2(rotaded_uv.xy) + vec2(remapped_time, 0.0); + float line = vec3(offset_uv, 0.0).x; + line = abs(line); + line = gradient_to_edge * line; + line = sqrt(line); + + float line_smoothness = clamp(Line_Smoothness, 0.001, 1.0); + float offset_plus = Line_Width + line_smoothness; + float offset_minus = Line_Width - line_smoothness; + + float remapped_line; + { + float input_range = offset_minus - offset_plus; + remapped_line = (line - offset_plus) / input_range; + } + remapped_line = remapped_line * Brightness; + remapped_line = min(remapped_line, Alpha); + COLOR.rgb = vec3(COLOR.xyz) * vec3(remapped_line); + COLOR.a = remapped_line; +} diff --git a/src/ui/shot_hud/winner_alert.tscn b/src/ui/shot_hud/winner_alert.tscn new file mode 100644 index 0000000..ccf2a5e --- /dev/null +++ b/src/ui/shot_hud/winner_alert.tscn @@ -0,0 +1,435 @@ +[gd_scene load_steps=14 format=3 uid="uid://dwyy7tt3nose1"] + +[ext_resource type="FontFile" uid="uid://dsa0oh7c0h4pu" path="res://assets/fonts/Racing_Sans_One/RacingSansOne-Regular.ttf" id="1_mxxhu"] +[ext_resource type="Texture2D" uid="uid://blfths5fy3a5u" path="res://assets/textures/pip_pattern.png" id="2_plyo3"] +[ext_resource type="Script" path="res://src/ui/decorations/text_effects/typewriter/typewriter_label.gd" id="3_vuo1w"] +[ext_resource type="AudioStream" uid="uid://c8bxu5lusqevv" path="res://assets/sound/sfx/ui/ecofuture3.wav" id="4_5f42w"] + +[sub_resource type="Gradient" id="Gradient_rgpi4"] +colors = PackedColorArray(0.49, 1, 0.643, 1, 1, 1, 1, 1) + +[sub_resource type="GradientTexture2D" id="GradientTexture2D_68xa1"] +gradient = SubResource("Gradient_rgpi4") +fill_from = Vector2(0.5, 0) +fill_to = Vector2(0.5, 0.7) +metadata/_snap_enabled = true + +[sub_resource type="Animation" id="Animation_ds0lb"] +resource_name = "pan" +length = 10.0 +loop_mode = 1 +tracks/0/type = "value" +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/path = NodePath(".:position") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/keys = { +"times": PackedFloat32Array(0, 10), +"transitions": PackedFloat32Array(1, 1), +"update": 0, +"values": [Vector2(-800, -400), Vector2(-901, -299)] +} + +[sub_resource type="Animation" id="Animation_7bus8"] +length = 0.001 +tracks/0/type = "value" +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/path = NodePath(".:position") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 0, +"values": [Vector2(-800, -400)] +} + +[sub_resource type="AnimationLibrary" id="AnimationLibrary_egd4v"] +_data = { +"RESET": SubResource("Animation_7bus8"), +"pan": SubResource("Animation_ds0lb") +} + +[sub_resource type="Curve" id="Curve_ghy8a"] +_data = [Vector2(0, 0), 0.0, 1.68564, 0, 0, Vector2(1, 1), -4.89573, 0.0, 0, 0] +point_count = 2 + +[sub_resource type="Animation" id="Animation_f8nc2"] +resource_name = "play" +length = 6.0 +loop_mode = 1 +tracks/0/type = "value" +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/path = NodePath("VerticalCenter/GameLabelRoot:anchor_left") +tracks/0/interp = 1 +tracks/0/loop_wrap = false +tracks/0/keys = { +"times": PackedFloat32Array(0, 0.6, 1, 3, 3.4), +"transitions": PackedFloat32Array(1, 1, 1, 1, 1), +"update": 0, +"values": [-0.5, -0.5, 0.48, 0.52, 1.5] +} +tracks/1/type = "value" +tracks/1/imported = false +tracks/1/enabled = true +tracks/1/path = NodePath("VerticalCenter/GameLabelRoot:anchor_right") +tracks/1/interp = 1 +tracks/1/loop_wrap = false +tracks/1/keys = { +"times": PackedFloat32Array(0, 0.6, 1, 3, 3.4), +"transitions": PackedFloat32Array(1, 1, 1, 1, 1), +"update": 0, +"values": [-0.5, -0.5, 0.48, 0.52, 1.5] +} +tracks/2/type = "value" +tracks/2/imported = false +tracks/2/enabled = true +tracks/2/path = NodePath("CaptionLabel:anchor_top") +tracks/2/interp = 1 +tracks/2/loop_wrap = false +tracks/2/keys = { +"times": PackedFloat32Array(0, 2.7, 2.9, 3.2), +"transitions": PackedFloat32Array(1, 0.2, 4, 1), +"update": 0, +"values": [0.5, 0.5, 0.55, -0.5] +} +tracks/3/type = "value" +tracks/3/imported = false +tracks/3/enabled = true +tracks/3/path = NodePath("CaptionLabel:anchor_bottom") +tracks/3/interp = 1 +tracks/3/loop_wrap = false +tracks/3/keys = { +"times": PackedFloat32Array(0, 2.7, 2.9, 3.2), +"transitions": PackedFloat32Array(1, 0.2, 4, 1), +"update": 0, +"values": [0.5, 0.5, 0.55, -0.5] +} +tracks/4/type = "value" +tracks/4/imported = false +tracks/4/enabled = true +tracks/4/path = NodePath("VerticalCenter/LabelBack:anchor_left") +tracks/4/interp = 1 +tracks/4/loop_wrap = false +tracks/4/keys = { +"times": PackedFloat32Array(0, 0.6), +"transitions": PackedFloat32Array(1, 1), +"update": 0, +"values": [1.5, -0.5] +} +tracks/5/type = "value" +tracks/5/imported = false +tracks/5/enabled = true +tracks/5/path = NodePath("VerticalCenter/LabelBack:anchor_right") +tracks/5/interp = 1 +tracks/5/loop_wrap = false +tracks/5/keys = { +"times": PackedFloat32Array(0, 0.6), +"transitions": PackedFloat32Array(1, 1), +"update": 0, +"values": [1.5, -0.5] +} +tracks/6/type = "value" +tracks/6/imported = false +tracks/6/enabled = true +tracks/6/path = NodePath("AudioStreamPlayer:playing") +tracks/6/interp = 1 +tracks/6/loop_wrap = true +tracks/6/keys = { +"times": PackedFloat32Array(0.9), +"transitions": PackedFloat32Array(1), +"update": 1, +"values": [true] +} +tracks/7/type = "method" +tracks/7/imported = false +tracks/7/enabled = true +tracks/7/path = NodePath("CaptionLabel") +tracks/7/interp = 1 +tracks/7/loop_wrap = true +tracks/7/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"values": [{ +"args": [], +"method": &"restart" +}] +} +tracks/8/type = "value" +tracks/8/imported = false +tracks/8/enabled = true +tracks/8/path = NodePath("CaptionLabel:rotation") +tracks/8/interp = 3 +tracks/8/loop_wrap = false +tracks/8/keys = { +"times": PackedFloat32Array(0, 2.66667, 2.8, 3.06667), +"transitions": PackedFloat32Array(1, 0.618, 1.618, 1), +"update": 0, +"values": [0.0, 0.0, 0.0872665, -0.0872665] +} + +[sub_resource type="Animation" id="Animation_cm2ua"] +length = 0.001 +tracks/0/type = "value" +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/path = NodePath("VerticalCenter/GameLabelRoot:anchor_left") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 0, +"values": [-0.5] +} +tracks/1/type = "value" +tracks/1/imported = false +tracks/1/enabled = true +tracks/1/path = NodePath("VerticalCenter/GameLabelRoot:anchor_right") +tracks/1/interp = 1 +tracks/1/loop_wrap = true +tracks/1/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 0, +"values": [-0.5] +} +tracks/2/type = "value" +tracks/2/imported = false +tracks/2/enabled = true +tracks/2/path = NodePath("CaptionLabel:anchor_top") +tracks/2/interp = 1 +tracks/2/loop_wrap = true +tracks/2/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 0, +"values": [0.5] +} +tracks/3/type = "value" +tracks/3/imported = false +tracks/3/enabled = true +tracks/3/path = NodePath("CaptionLabel:anchor_bottom") +tracks/3/interp = 1 +tracks/3/loop_wrap = true +tracks/3/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 0, +"values": [0.5] +} +tracks/4/type = "value" +tracks/4/imported = false +tracks/4/enabled = true +tracks/4/path = NodePath("VerticalCenter/LabelBack:anchor_left") +tracks/4/interp = 1 +tracks/4/loop_wrap = true +tracks/4/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 0, +"values": [1.5] +} +tracks/5/type = "value" +tracks/5/imported = false +tracks/5/enabled = true +tracks/5/path = NodePath("VerticalCenter/LabelBack:anchor_right") +tracks/5/interp = 1 +tracks/5/loop_wrap = true +tracks/5/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 0, +"values": [1.5] +} +tracks/6/type = "value" +tracks/6/imported = false +tracks/6/enabled = true +tracks/6/path = NodePath("AudioStreamPlayer:playing") +tracks/6/interp = 1 +tracks/6/loop_wrap = true +tracks/6/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 1, +"values": [false] +} +tracks/7/type = "value" +tracks/7/imported = false +tracks/7/enabled = true +tracks/7/path = NodePath("CaptionLabel:rotation") +tracks/7/interp = 1 +tracks/7/loop_wrap = true +tracks/7/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 0, +"values": [0.0] +} + +[sub_resource type="AnimationLibrary" id="AnimationLibrary_x18w1"] +_data = { +"RESET": SubResource("Animation_cm2ua"), +"play": SubResource("Animation_f8nc2") +} + +[node name="WinnerAlert" type="Control"] +custom_minimum_size = Vector2(0, 300) +layout_mode = 3 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 + +[node name="VerticalCenter" type="Control" parent="."] +custom_minimum_size = Vector2(0, 300) +layout_mode = 1 +anchors_preset = 14 +anchor_top = 0.5 +anchor_right = 1.0 +anchor_bottom = 0.5 +offset_top = -150.0 +offset_bottom = 150.0 +grow_horizontal = 2 +grow_vertical = 2 + +[node name="LabelBack" type="Label" parent="VerticalCenter"] +texture_filter = 4 +layout_mode = 1 +anchors_preset = -1 +anchor_left = 1.5 +anchor_top = 0.5 +anchor_right = 1.5 +anchor_bottom = 0.5 +offset_left = 216.5 +offset_top = -95.5 +offset_right = 649.5 +offset_bottom = 95.5 +grow_horizontal = 2 +grow_vertical = 2 +scale = Vector2(-1, 1) +theme_override_colors/font_color = Color(0.237539, 0.237539, 0.237539, 1) +theme_override_colors/font_outline_color = Color(0, 0, 0, 1) +theme_override_constants/outline_size = 9 +theme_override_fonts/font = ExtResource("1_mxxhu") +theme_override_font_sizes/font_size = 150 +text = "GAME!" + +[node name="GameLabelRoot" type="Control" parent="VerticalCenter"] +layout_mode = 1 +anchor_left = -0.5 +anchor_top = 0.5 +anchor_right = -0.5 +anchor_bottom = 0.5 +grow_horizontal = 2 +grow_vertical = 2 + +[node name="LabelOutline" type="Label" parent="VerticalCenter/GameLabelRoot"] +texture_filter = 4 +layout_mode = 1 +anchors_preset = 8 +anchor_left = 0.5 +anchor_top = 0.5 +anchor_right = 0.5 +anchor_bottom = 0.5 +offset_left = -433.0 +offset_top = -191.0 +offset_right = 433.0 +offset_bottom = 191.0 +grow_horizontal = 2 +grow_vertical = 2 +theme_override_colors/font_color = Color(0, 0, 0, 1) +theme_override_colors/font_outline_color = Color(0, 0, 0, 1) +theme_override_constants/outline_size = 9 +theme_override_fonts/font = ExtResource("1_mxxhu") +theme_override_font_sizes/font_size = 300 +text = "GAME!" + +[node name="LabelClip" type="Label" parent="VerticalCenter/GameLabelRoot"] +clip_children = 1 +texture_filter = 4 +layout_mode = 1 +anchors_preset = 8 +anchor_left = 0.5 +anchor_top = 0.5 +anchor_right = 0.5 +anchor_bottom = 0.5 +offset_left = -433.0 +offset_top = -191.0 +offset_right = 433.0 +offset_bottom = 191.0 +grow_horizontal = 2 +grow_vertical = 2 +theme_override_colors/font_color = Color(1, 1, 1, 1) +theme_override_fonts/font = ExtResource("1_mxxhu") +theme_override_font_sizes/font_size = 300 +text = "GAME!" + +[node name="Gradient" type="TextureRect" parent="VerticalCenter/GameLabelRoot/LabelClip"] +layout_mode = 1 +anchors_preset = -1 +anchor_left = -0.1 +anchor_top = -0.1 +anchor_right = 1.1 +anchor_bottom = 1.1 +grow_horizontal = 2 +grow_vertical = 2 +texture = SubResource("GradientTexture2D_68xa1") + +[node name="Pips" type="TextureRect" parent="VerticalCenter/GameLabelRoot/LabelClip"] +texture_filter = 4 +layout_mode = 1 +anchors_preset = -1 +anchor_right = 1.0 +anchor_bottom = 1.0 +offset_left = -800.0 +offset_top = -400.0 +offset_right = 800.0 +offset_bottom = 400.0 +grow_horizontal = 2 +grow_vertical = 2 +texture = ExtResource("2_plyo3") +stretch_mode = 1 + +[node name="AnimationPlayer" type="AnimationPlayer" parent="VerticalCenter/GameLabelRoot/LabelClip/Pips"] +libraries = { +"": SubResource("AnimationLibrary_egd4v") +} +autoplay = "pan" + +[node name="CaptionLabel" type="RichTextLabel" parent="."] +layout_mode = 1 +anchors_preset = -1 +anchor_left = 0.5 +anchor_top = 0.5 +anchor_right = 0.5 +anchor_bottom = 0.5 +offset_left = -300.0 +offset_top = -125.0 +offset_right = 300.0 +offset_bottom = 125.0 +grow_horizontal = 2 +grow_vertical = 2 +pivot_offset = Vector2(300, 10) +theme_override_colors/default_color = Color(0.490196, 1, 0.643137, 1) +theme_override_colors/font_outline_color = Color(0, 0, 0, 1) +theme_override_constants/outline_size = 4 +theme_override_fonts/normal_font = ExtResource("1_mxxhu") +theme_override_font_sizes/normal_font_size = 16 +bbcode_enabled = true +text = "[center][wave][type speed=70 factor=8]guess what sucka you are about to win the fuckign[/type][/wave][/center]" +script = ExtResource("3_vuo1w") +scale_curve = SubResource("Curve_ghy8a") + +[node name="AnimationPlayer" type="AnimationPlayer" parent="."] +libraries = { +"": SubResource("AnimationLibrary_x18w1") +} +autoplay = "play" + +[node name="AudioStreamPlayer" type="AudioStreamPlayer" parent="."] +stream = ExtResource("4_5f42w")