[gd_scene load_steps=12 format=3 uid="uid://sj3527bjrq4g"]

[ext_resource type="Theme" uid="uid://cy1gdeutlxbey" path="res://resources/theme.tres" id="1_0i13d"]
[ext_resource type="Script" uid="uid://be4h8kbumyqad" path="res://code/menu/intro.gd" id="1_d7r31"]
[ext_resource type="AudioStream" uid="uid://bvu5dd51ndfq1" path="res://art/audio/music/MenuMusic.ogg" id="2_56pe6"]
[ext_resource type="Texture2D" uid="uid://k827lp4jhg3" path="res://art/textures/IGDC.png" id="2_d7r31"]
[ext_resource type="Script" uid="uid://bgnidt81al0x6" path="res://code/shader/gb_shader.gd" id="3_56pe6"]
[ext_resource type="Resource" uid="uid://dhyomieciwaky" path="res://resources/palettes/default.tres" id="4_klb7a"]

[sub_resource type="Shader" id="Shader_56pe6"]
code = "
shader_type canvas_item;

uniform sampler2D SCREEN_TEXTURE : hint_screen_texture, filter_linear;

uniform vec4 color_black: source_color = vec4(0.251, 0.314, 0.063, 1.0);
uniform vec4 color_dark: source_color = vec4(0.439, 0.502, 0.157, 1.0);
uniform vec4 color_light: source_color = vec4(0.627, 0.659, 0.251, 1.0);
uniform vec4 color_white: source_color = vec4(0.816, 0.816, 0.345, 1.0);

uniform float threshold_black: hint_range(0.0, 1.0, 0.01) = 0.25;
uniform float threshold_dark: hint_range(0.0, 1.0, 0.01) = 0.5;
uniform float threshold_light: hint_range(0.0, 1.0, 0.01) = 0.75;

uniform int fade: hint_range(-3, 3, 1) = 0;
uniform bool inversion = false;


void fragment() {
	vec4 current_color = texture(SCREEN_TEXTURE, SCREEN_UV);
	float rgb_avg = (current_color.r + current_color.g + current_color.b) / 3.0;

	int base_index;
	if (rgb_avg <= threshold_black) {
		base_index = 0;
	} else if (rgb_avg <= threshold_dark) {
		base_index = 1;
	} else if (rgb_avg <= threshold_light) {
		base_index = 2;
	} else {
		base_index = 3;
	}

	int color_index = clamp(base_index + fade, 0, 3);
	color_index = inversion ? 3 - color_index : color_index;

	vec4 palette[] = {color_black, color_dark, color_light, color_white};

	COLOR = palette[color_index];
}
"

[sub_resource type="ShaderMaterial" id="ShaderMaterial_klb7a"]
shader = SubResource("Shader_56pe6")
shader_parameter/color_black = Color(0.25098, 0.313726, 0.0627451, 1)
shader_parameter/color_dark = Color(0.439216, 0.501961, 0.156863, 1)
shader_parameter/color_light = Color(0.627451, 0.658824, 0.25098, 1)
shader_parameter/color_white = Color(0.815686, 0.815686, 0.345098, 1)
shader_parameter/threshold_black = 0.25
shader_parameter/threshold_dark = 0.5
shader_parameter/threshold_light = 0.75
shader_parameter/fade = 0
shader_parameter/inversion = false

[sub_resource type="Animation" id="Animation_56pe6"]
length = 0.001
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("Logo:visible")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [true]
}

[sub_resource type="Animation" id="Animation_d7r31"]
resource_name = "intro"
length = 2.8
tracks/0/type = "method"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("GBShader")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 0.9, 1.4, 2.4),
"transitions": PackedFloat32Array(1, 1, 1, 1),
"values": [{
"args": [0.4],
"method": &"fade_from_black"
}, {
"args": [0.4],
"method": &"fade_to_black"
}, {
"args": [0.4],
"method": &"fade_from_black"
}, {
"args": [0.4],
"method": &"fade_to_white"
}]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("Logo:visible")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0, 1.4),
"transitions": PackedFloat32Array(1, 1),
"update": 1,
"values": [true, false]
}
tracks/2/type = "method"
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/path = NodePath(".")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/keys = {
"times": PackedFloat32Array(2.8),
"transitions": PackedFloat32Array(1),
"values": [{
"args": [],
"method": &"switch_scene"
}]
}

[sub_resource type="AnimationLibrary" id="AnimationLibrary_klb7a"]
_data = {
&"RESET": SubResource("Animation_56pe6"),
&"intro": SubResource("Animation_d7r31")
}

[node name="Intro" type="Control"]
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
script = ExtResource("1_d7r31")
scene_path = "uid://6cvqva637hl0"
music = ExtResource("2_56pe6")

[node name="TitlesBG" type="ColorRect" parent="."]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2

[node name="Titles" type="Label" parent="TitlesBG"]
layout_mode = 1
anchors_preset = 8
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
offset_left = -80.0
offset_top = -72.0
offset_right = 80.0
offset_bottom = 72.0
grow_horizontal = 2
grow_vertical = 2
theme = ExtResource("1_0i13d")
text = "

GBoy Race™


Music: SunoAI   
Sounds: BFXR,     
        ElevenLabs
Game engine: Godot

©2025 BlitzID 

For IGDC.RU 


Licensed by nobody"
horizontal_alignment = 1
autowrap_mode = 3

[node name="Logo" type="Sprite2D" parent="."]
position = Vector2(80, 72)
texture = ExtResource("2_d7r31")

[node name="GBShader" type="ColorRect" parent="."]
material = SubResource("ShaderMaterial_klb7a")
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
script = ExtResource("3_56pe6")
game_boy_palette = ExtResource("4_klb7a")
metadata/_custom_type_script = "uid://bgnidt81al0x6"
metadata/_edit_lock_ = true

[node name="IntroAnimationPlayer" type="AnimationPlayer" parent="."]
libraries = {
&"": SubResource("AnimationLibrary_klb7a")
}
autoplay = "intro"
