summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--docs/index.html2
-rw-r--r--docs/index.pckbin3813040 -> 3815896 bytes
-rw-r--r--docs/index.service.worker.js2
-rw-r--r--mat_palette.gdshader54
-rw-r--r--mat_palette.gdshader.uid1
-rw-r--r--mat_palette.tres18
-rw-r--r--room_main_menu.tscn23
-rw-r--r--tileset_kenney_platformer.tres39
-rw-r--r--top.tscn14
9 files changed, 113 insertions, 40 deletions
diff --git a/docs/index.html b/docs/index.html
index 40c2dba..fb60c30 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -112,7 +112,7 @@ body {
<script src="index.js"></script>
<script>
-const GODOT_CONFIG = {"args":[],"canvasResizePolicy":2,"emscriptenPoolSize":8,"ensureCrossOriginIsolationHeaders":true,"executable":"index","experimentalVK":false,"fileSizes":{"index.pck":3813040,"index.wasm":38034280},"focusCanvas":true,"gdextensionLibs":[],"godotPoolSize":4,"serviceWorker":"index.service.worker.js"};
+const GODOT_CONFIG = {"args":[],"canvasResizePolicy":2,"emscriptenPoolSize":8,"ensureCrossOriginIsolationHeaders":true,"executable":"index","experimentalVK":false,"fileSizes":{"index.pck":3815896,"index.wasm":38034280},"focusCanvas":true,"gdextensionLibs":[],"godotPoolSize":4,"serviceWorker":"index.service.worker.js"};
const GODOT_THREADS_ENABLED = false;
const engine = new Engine(GODOT_CONFIG);
diff --git a/docs/index.pck b/docs/index.pck
index df4e07d..c1cc666 100644
--- a/docs/index.pck
+++ b/docs/index.pck
Binary files differ
diff --git a/docs/index.service.worker.js b/docs/index.service.worker.js
index aa6398d..e1a7bd4 100644
--- a/docs/index.service.worker.js
+++ b/docs/index.service.worker.js
@@ -4,7 +4,7 @@
// Incrementing CACHE_VERSION will kick off the install event and force
// previously cached resources to be updated from the network.
/** @type {string} */
-const CACHE_VERSION = '1764100597|5566382751';
+const CACHE_VERSION = '1764153772|1018290046';
/** @type {string} */
const CACHE_PREFIX = 'MobileMetroidvan-sw-cache-';
const CACHE_NAME = CACHE_PREFIX + CACHE_VERSION;
diff --git a/mat_palette.gdshader b/mat_palette.gdshader
new file mode 100644
index 0000000..e24a6ee
--- /dev/null
+++ b/mat_palette.gdshader
@@ -0,0 +1,54 @@
+shader_type canvas_item;
+
+uniform vec4 palette_0 : source_color;
+uniform vec4 palette_1 : source_color;
+uniform vec4 palette_2 : source_color;
+uniform vec4 palette_3 : source_color;
+uniform vec4 palette_4 : source_color;
+uniform vec4 palette_5 : source_color;
+uniform vec4 palette_6 : source_color;
+uniform vec4 palette_7 : source_color;
+uniform vec4 palette_8 : source_color;
+uniform vec4 palette_9 : source_color;
+uniform vec4 palette_10 : source_color;
+uniform vec4 palette_11 : source_color;
+
+const int N_COLORS = 12;
+
+uniform sampler2D screen_texture : hint_screen_texture;
+
+void fragment() {
+ vec4 palette[N_COLORS] = { palette_0, palette_1, palette_2, palette_3, palette_4, palette_5, palette_6, palette_7, palette_8, palette_9, palette_10, palette_11 };
+ vec4 screen_color = texture(screen_texture, SCREEN_UV);
+ // Compute source color value
+ float sv = 0.f;
+ for (int i = 0; i < 3; i++) {
+ if (screen_color[i] > sv) { sv = screen_color[i]; }
+ }
+
+ int pal_i = int(floor((sv * 0.99f) * float(N_COLORS)));
+ vec4 result = palette[pal_i];
+ /*
+ float min_dist = 999.f; // always bigger than 1.0
+ vec4 result;
+ for (int i = 0; i < N_COLORS; i++) {
+ vec4 pc = palette[i];
+ // Compute palette color value
+ float pv = 0.f;
+ for (int j = 0; j < 3; j++) {
+ if (pc[j] > pv) { pv = pc[j]; }
+ }
+ float dist = abs(pv - sv);
+ if (dist < min_dist) {
+ min_dist = dist;
+ result = pc;
+ }
+ }
+ */
+ COLOR = vec4(result.rgb, COLOR.a);
+}
+
+//void light() {
+// // Called for every pixel for every light affecting the CanvasItem.
+// // Uncomment to replace the default light processing function with this one.
+//}
diff --git a/mat_palette.gdshader.uid b/mat_palette.gdshader.uid
new file mode 100644
index 0000000..b7a1066
--- /dev/null
+++ b/mat_palette.gdshader.uid
@@ -0,0 +1 @@
+uid://dug36yc62jfj5
diff --git a/mat_palette.tres b/mat_palette.tres
new file mode 100644
index 0000000..4bdf09e
--- /dev/null
+++ b/mat_palette.tres
@@ -0,0 +1,18 @@
+[gd_resource type="ShaderMaterial" load_steps=2 format=3 uid="uid://bb4b8jm2tyy81"]
+
+[ext_resource type="Shader" uid="uid://dug36yc62jfj5" path="res://mat_palette.gdshader" id="1_tt8pc"]
+
+[resource]
+shader = ExtResource("1_tt8pc")
+shader_parameter/palette_0 = Color(0, 0, 0, 1)
+shader_parameter/palette_1 = Color(0.2509804, 0.15686275, 0.34901962, 1)
+shader_parameter/palette_2 = Color(0.20784314, 0.21568628, 0.3882353, 1)
+shader_parameter/palette_3 = Color(0.15294118, 0.37254903, 0.46666667, 1)
+shader_parameter/palette_4 = Color(0.21960784, 0.5294118, 0.44313726, 1)
+shader_parameter/palette_5 = Color(0.3529412, 0.61960787, 0.36078432, 1)
+shader_parameter/palette_6 = Color(1, 0.91764706, 0.3882353, 1)
+shader_parameter/palette_7 = Color(0.84705883, 0.58431375, 0.26666668, 1)
+shader_parameter/palette_8 = Color(0.5529412, 0.5176471, 0.2901961, 1)
+shader_parameter/palette_9 = Color(0.7372549, 0.69803923, 0.43529412, 1)
+shader_parameter/palette_10 = Color(1, 0.8980392, 0.7490196, 1)
+shader_parameter/palette_11 = Color(1, 1, 1, 1)
diff --git a/room_main_menu.tscn b/room_main_menu.tscn
index 99ac7cd..bad7ab6 100644
--- a/room_main_menu.tscn
+++ b/room_main_menu.tscn
@@ -1,27 +1,12 @@
-[gd_scene load_steps=4 format=3 uid="uid://cjdhfl70fgt6m"]
+[gd_scene load_steps=3 format=4 uid="uid://cjdhfl70fgt6m"]
[ext_resource type="Script" uid="uid://dufnvsfxreqq8" path="res://room_main_menu.gd" id="1_rbk04"]
-
-[sub_resource type="Gradient" id="Gradient_n14lx"]
-colors = PackedColorArray(0.2509804, 0.15686275, 0.34901962, 1, 1, 0.8980392, 0.7490196, 1)
-
-[sub_resource type="GradientTexture2D" id="GradientTexture2D_ftmdk"]
-gradient = SubResource("Gradient_n14lx")
-width = 16
-height = 16
+[ext_resource type="TileSet" uid="uid://0cd30n67d6k5" path="res://tileset_kenney_platformer.tres" id="2_ftmdk"]
[node name="MainMenu" type="Node2D"]
process_mode = 1
script = ExtResource("1_rbk04")
-[node name="Bg" type="TextureRect" parent="."]
-offset_left = -30.0
-offset_top = -81.0
-offset_right = -14.0
-offset_bottom = -65.0
-scale = Vector2(16, 16)
-texture = SubResource("GradientTexture2D_ftmdk")
-
[node name="ColorRect" type="ColorRect" parent="."]
anchors_preset = 8
anchor_left = 0.5
@@ -61,3 +46,7 @@ offset_bottom = 47.0
scale = Vector2(0.5, 0.5)
text = "Metroidvania"
horizontal_alignment = 1
+
+[node name="TileMapLayer" type="TileMapLayer" parent="."]
+tile_map_data = PackedByteArray("AAABAAYAAQAPAAIAAAABAAUAAQAPAAEAAAABAAQAAQAPAAAAAAAKAAAAAQATAAAAAAAKAAEAAQATAAAAAAAKAAIAAQATAAEAAAAJAAYAAQARAAAAAAAIAAYAAQAQAAAAAAA=")
+tile_set = ExtResource("2_ftmdk")
diff --git a/tileset_kenney_platformer.tres b/tileset_kenney_platformer.tres
index bd687f1..103b35a 100644
--- a/tileset_kenney_platformer.tres
+++ b/tileset_kenney_platformer.tres
@@ -102,7 +102,7 @@ texture = ExtResource("2_at7kb")
9:3/0 = 0
10:3/0 = 0
11:3/0 = 0
-11:3/0/modulate = Color(1, 0.8980392, 0.7490196, 1)
+11:3/0/modulate = Color(0.78431374, 0.10980392, 0.6156863, 1)
11:3/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 8, -8, 8)
12:3/0 = 0
13:3/0 = 0
@@ -121,13 +121,13 @@ texture = ExtResource("2_at7kb")
5:4/0 = 0
6:4/0 = 0
7:4/0 = 0
-7:4/0/modulate = Color(1, 0.8980392, 0.7490196, 1)
+7:4/0/modulate = Color(0.78431374, 0.10980392, 0.6156863, 1)
7:4/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 8, -8, 8)
8:4/0 = 0
-8:4/0/modulate = Color(1, 0.8980392, 0.7490196, 1)
+8:4/0/modulate = Color(0.78431374, 0.10980392, 0.6156863, 1)
8:4/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 8, -8, 8)
9:4/0 = 0
-9:4/0/modulate = Color(1, 0.8980392, 0.7490196, 1)
+9:4/0/modulate = Color(0.78431374, 0.10980392, 0.6156863, 1)
9:4/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 8, -8, 8)
10:4/0 = 0
11:4/0 = 0
@@ -148,13 +148,13 @@ texture = ExtResource("2_at7kb")
5:5/0 = 0
6:5/0 = 0
7:5/0 = 0
-7:5/0/modulate = Color(1, 0.8980392, 0.7490196, 1)
+7:5/0/modulate = Color(0.78431374, 0.10980392, 0.6156863, 1)
7:5/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 8, -8, 8)
8:5/0 = 0
-8:5/0/modulate = Color(1, 0.8980392, 0.7490196, 1)
+8:5/0/modulate = Color(0.78431374, 0.10980392, 0.6156863, 1)
8:5/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 8, -8, 8)
9:5/0 = 0
-9:5/0/modulate = Color(1, 0.8980392, 0.7490196, 1)
+9:5/0/modulate = Color(0.78431374, 0.10980392, 0.6156863, 1)
9:5/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 8, -8, 8)
10:5/0 = 0
11:5/0 = 0
@@ -174,13 +174,13 @@ texture = ExtResource("2_at7kb")
5:6/0 = 0
6:6/0 = 0
7:6/0 = 0
-7:6/0/modulate = Color(1, 0.8980392, 0.7490196, 1)
+7:6/0/modulate = Color(0.78431374, 0.10980392, 0.6156863, 1)
7:6/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 8, -8, 8)
8:6/0 = 0
-8:6/0/modulate = Color(1, 0.8980392, 0.7490196, 1)
+8:6/0/modulate = Color(0.78431374, 0.10980392, 0.6156863, 1)
8:6/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 8, -8, 8)
9:6/0 = 0
-9:6/0/modulate = Color(1, 0.8980392, 0.7490196, 1)
+9:6/0/modulate = Color(0.78431374, 0.10980392, 0.6156863, 1)
9:6/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 8, -8, 8)
10:6/0 = 0
12:6/0 = 0
@@ -553,6 +553,7 @@ texture = ExtResource("2_at7kb")
9:3/0 = 0
10:3/0 = 0
11:3/0 = 0
+11:3/0/modulate = Color(0.78431374, 0.10980392, 0.6156863, 1)
12:3/0 = 0
13:3/0 = 0
14:3/0 = 0
@@ -569,13 +570,13 @@ texture = ExtResource("2_at7kb")
5:4/0 = 0
6:4/0 = 0
7:4/0 = 0
-7:4/0/modulate = Color(1, 0.8980392, 0.7490196, 1)
+7:4/0/modulate = Color(0.78431374, 0.10980392, 0.6156863, 1)
7:4/0/z_index = 20
8:4/0 = 0
-8:4/0/modulate = Color(1, 0.8980392, 0.7490196, 1)
+8:4/0/modulate = Color(0.78431374, 0.10980392, 0.6156863, 1)
8:4/0/z_index = 20
9:4/0 = 0
-9:4/0/modulate = Color(1, 0.8980392, 0.7490196, 1)
+9:4/0/modulate = Color(0.78431374, 0.10980392, 0.6156863, 1)
9:4/0/z_index = 20
10:4/0 = 0
11:4/0 = 0
@@ -595,13 +596,13 @@ texture = ExtResource("2_at7kb")
5:5/0 = 0
6:5/0 = 0
7:5/0 = 0
-7:5/0/modulate = Color(1, 0.8980392, 0.7490196, 1)
+7:5/0/modulate = Color(0.78431374, 0.10980392, 0.6156863, 1)
7:5/0/z_index = 20
8:5/0 = 0
-8:5/0/modulate = Color(1, 0.8980392, 0.7490196, 1)
+8:5/0/modulate = Color(0.78431374, 0.10980392, 0.6156863, 1)
8:5/0/z_index = 20
9:5/0 = 0
-9:5/0/modulate = Color(1, 0.8980392, 0.7490196, 1)
+9:5/0/modulate = Color(0.78431374, 0.10980392, 0.6156863, 1)
9:5/0/z_index = 20
10:5/0 = 0
11:5/0 = 0
@@ -621,13 +622,13 @@ texture = ExtResource("2_at7kb")
5:6/0 = 0
6:6/0 = 0
7:6/0 = 0
-7:6/0/modulate = Color(1, 0.8980392, 0.7490196, 1)
+7:6/0/modulate = Color(0.78431374, 0.10980392, 0.6156863, 1)
7:6/0/z_index = 20
8:6/0 = 0
-8:6/0/modulate = Color(1, 0.8980392, 0.7490196, 1)
+8:6/0/modulate = Color(0.78431374, 0.10980392, 0.6156863, 1)
8:6/0/z_index = 20
9:6/0 = 0
-9:6/0/modulate = Color(1, 0.8980392, 0.7490196, 1)
+9:6/0/modulate = Color(0.78431374, 0.10980392, 0.6156863, 1)
9:6/0/z_index = 20
10:6/0 = 0
12:6/0 = 0
diff --git a/top.tscn b/top.tscn
index 6f455c5..2c08b75 100644
--- a/top.tscn
+++ b/top.tscn
@@ -1,18 +1,28 @@
[gd_scene load_steps=6 format=3 uid="uid://cey3jxnpmommt"]
+[ext_resource type="Material" uid="uid://bb4b8jm2tyy81" path="res://mat_palette.tres" id="1_edsjh"]
[ext_resource type="Script" uid="uid://dxbspy72bg0db" path="res://top.gd" id="1_on2c2"]
-[ext_resource type="PackedScene" uid="uid://cjdhfl70fgt6m" path="res://room_main_menu.tscn" id="2_58ij3"]
[ext_resource type="PackedScene" uid="uid://c2shuyjjq06p8" path="res://transition_manager.tscn" id="3_2exal"]
[ext_resource type="PackedScene" uid="uid://cseqghymhiyqo" path="res://map.tscn" id="3_58ij3"]
[ext_resource type="PackedScene" uid="uid://cciwccvljuuyq" path="res://touch_screen_ui.tscn" id="5_edsjh"]
[node name="Top" type="Node2D"]
process_mode = 3
+material = ExtResource("1_edsjh")
script = ExtResource("1_on2c2")
-initial_room = ExtResource("2_58ij3")
[node name="TransitionManager" parent="." instance=ExtResource("3_2exal")]
[node name="Map" parent="." instance=ExtResource("3_58ij3")]
[node name="TouchScreenUI" parent="." instance=ExtResource("5_edsjh")]
+
+[node name="PaletterShader" type="CanvasLayer" parent="."]
+
+[node name="ColorRect" type="ColorRect" parent="PaletterShader"]
+material = ExtResource("1_edsjh")
+anchors_preset = 15
+anchor_right = 1.0
+anchor_bottom = 1.0
+grow_horizontal = 2
+grow_vertical = 2