feat: Implement the main game scene with manager initialization, comprehensive UI setup including a dynamic message bar, tile respawn logic, and core multiplayer integration.
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
shader_type canvas_item;
|
||||
|
||||
// Positive values lean right, negative lean left
|
||||
uniform float skew_x : hint_range(-2.0, 2.0) = 0.0;
|
||||
// Positive values lean down, negative lean up
|
||||
uniform float skew_y : hint_range(-2.0, 2.0) = 0.0;
|
||||
|
||||
void vertex() {
|
||||
// 1. Get the size of the Control node
|
||||
vec2 size = 1.0 / TEXTURE_PIXEL_SIZE;
|
||||
|
||||
// 2. Move the pivot to the center for a natural tilt
|
||||
// Without this, it skews from the top-left corner
|
||||
VERTEX -= size * 0.5;
|
||||
|
||||
// 3. Apply the Skew math
|
||||
// We use a temporary variable so the calculations don't interfere
|
||||
float old_x = VERTEX.x;
|
||||
float old_y = VERTEX.y;
|
||||
|
||||
VERTEX.x = old_x + (old_y * skew_x);
|
||||
VERTEX.y = old_y + (old_x * skew_y);
|
||||
|
||||
// 4. Move back from the center
|
||||
VERTEX += size * 0.5;
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
uid://blkxmiijmkakh
|
||||
@@ -0,0 +1,21 @@
|
||||
shader_type canvas_item;
|
||||
|
||||
// Photoshop-style corner offsets in pixels
|
||||
uniform vec2 top_left = vec2(0.0);
|
||||
uniform vec2 top_right = vec2(0.0);
|
||||
uniform vec2 bottom_left = vec2(0.0);
|
||||
uniform vec2 bottom_right = vec2(0.0);
|
||||
|
||||
void vertex() {
|
||||
// 1. Calculate UV based on the vertex position relative to size
|
||||
vec2 size = 1.0 / TEXTURE_PIXEL_SIZE;
|
||||
vec2 uv = VERTEX / size;
|
||||
|
||||
// 2. Linear interpolation to find the offset for this specific vertex
|
||||
// This maps the square to whatever quadrilateral you define
|
||||
vec2 top_row = mix(top_left, top_right, uv.x);
|
||||
vec2 bottom_row = mix(bottom_left, bottom_right, uv.x);
|
||||
vec2 final_offset = mix(top_row, bottom_row, uv.y);
|
||||
|
||||
VERTEX += final_offset;
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
uid://b4jor2qt7hwxn
|
||||
@@ -0,0 +1,9 @@
|
||||
[gd_resource type="ShaderMaterial" format=3 uid="uid://f6wt058avgca"]
|
||||
|
||||
[ext_resource type="Shader" uid="uid://b4jor2qt7hwxn" path="res://assets/shaders/tilt_shader.gdshader" id="1_5xkx8"]
|
||||
|
||||
[resource]
|
||||
shader = ExtResource("1_5xkx8")
|
||||
shader_parameter/x_rot = 0.0
|
||||
shader_parameter/y_rot = 0.0
|
||||
shader_parameter/scale = 1.0
|
||||
@@ -0,0 +1,3 @@
|
||||
[gd_resource type="ShaderMaterial" format=3 uid="uid://dp3wad2clk6a2"]
|
||||
|
||||
[resource]
|
||||
Reference in New Issue
Block a user