Cambiados los aspectos visuales del juego a algo gotico
This commit is contained in:
1 parent
ec7e35ddf6
commit
967b3a286d
205 files changed
+7056
-1630
No files matched your search
@@ -0,0 +1,35 @@
|
||||
extends CanvasLayer
|
||||
class_name AshenAtmosphere
|
||||
|
||||
## Una capa ambiental para toda la ventana; no depende de la longitud del nivel.
|
||||
## Polvo por CPU y una sola pasada de niebla, sin leer la pantalla ni luces globales.
|
||||
|
||||
@export var mist_strength: float = 0.45
|
||||
@export var mist_color: Color = Color(0.40, 0.39, 0.46, 0.14)
|
||||
@export var dust_color: Color = Color(0.72, 0.60, 0.45, 0.38)
|
||||
|
||||
var _clock: float = 0.0
|
||||
var _mist_material: ShaderMaterial
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
_mist_material = ($Mist as ColorRect).material.duplicate() as ShaderMaterial
|
||||
($Mist as ColorRect).material = _mist_material
|
||||
_mist_material.set_shader_parameter("strength", mist_strength)
|
||||
_mist_material.set_shader_parameter("mist_color", mist_color)
|
||||
($Dust as CPUParticles2D).color = dust_color
|
||||
get_viewport().size_changed.connect(_resize)
|
||||
_resize()
|
||||
|
||||
|
||||
func _resize() -> void:
|
||||
var viewport_size: Vector2 = get_viewport().get_visible_rect().size
|
||||
($Mist as ColorRect).size = viewport_size
|
||||
var dust: CPUParticles2D = $Dust
|
||||
dust.position = viewport_size * 0.5
|
||||
dust.emission_rect_extents = viewport_size * 0.55
|
||||
|
||||
|
||||
func _process(delta: float) -> void:
|
||||
_clock = fmod(_clock + delta, 10000.0)
|
||||
_mist_material.set_shader_parameter("clock", _clock)
|
||||
@@ -0,0 +1,27 @@
|
||||
shader_type canvas_item;
|
||||
render_mode unshaded;
|
||||
|
||||
uniform float clock = 0.0;
|
||||
uniform vec4 mist_color : source_color = vec4(0.40, 0.39, 0.46, 0.14);
|
||||
uniform float strength : hint_range(0.0, 1.0) = 0.45;
|
||||
|
||||
float soft_noise(vec2 p) {
|
||||
vec2 i = floor(p);
|
||||
vec2 f = fract(p);
|
||||
f = f * f * (3.0 - 2.0 * f);
|
||||
float a = fract(sin(dot(i, vec2(127.1, 311.7))) * 43758.5453);
|
||||
float b = fract(sin(dot(i + vec2(1.0, 0.0), vec2(127.1, 311.7))) * 43758.5453);
|
||||
float c = fract(sin(dot(i + vec2(0.0, 1.0), vec2(127.1, 311.7))) * 43758.5453);
|
||||
float d = fract(sin(dot(i + vec2(1.0, 1.0), vec2(127.1, 311.7))) * 43758.5453);
|
||||
return mix(mix(a, b, f.x), mix(c, d, f.x), f.y);
|
||||
}
|
||||
|
||||
void fragment() {
|
||||
// Niebla tenue de baja frecuencia: nunca oculta bordes ni siluetas de combate.
|
||||
vec2 p = floor(UV * vec2(640.0, 360.0)) / vec2(640.0, 360.0);
|
||||
float bank = soft_noise(vec2(p.x * 4.0 - clock * 0.025, p.y * 2.7));
|
||||
float floor_mask = smoothstep(0.50, 0.96, p.y);
|
||||
float rim = smoothstep(0.38, 0.72, abs(p.x - 0.5));
|
||||
float opacity = (floor_mask * (0.26 + bank * 0.65) + rim * 0.12) * strength;
|
||||
COLOR = vec4(mist_color.rgb, mist_color.a * opacity);
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
[gd_scene load_steps=6 format=3]
|
||||
|
||||
[ext_resource type="Script" path="res://world/backgrounds/ashen_atmosphere.gd" id="script"]
|
||||
[ext_resource type="Shader" path="res://world/backgrounds/ashen_atmosphere.gdshader" id="shader"]
|
||||
[ext_resource type="Script" path="res://ui/editor_ui_visibility.gd" id="editor"]
|
||||
|
||||
[sub_resource type="ShaderMaterial" id="mist"]
|
||||
resource_local_to_scene = true
|
||||
shader = ExtResource("shader")
|
||||
|
||||
[sub_resource type="Gradient" id="fade"]
|
||||
offsets = PackedFloat32Array(0, 0.15, 0.75, 1)
|
||||
colors = PackedColorArray(1, 1, 1, 0, 1, 1, 1, 0.8, 1, 1, 1, 0.5, 1, 1, 1, 0)
|
||||
|
||||
[node name="AshenAtmosphere" type="CanvasLayer"]
|
||||
layer = 70
|
||||
script = ExtResource("script")
|
||||
|
||||
[node name="EditorVisibility" type="Node" parent="."]
|
||||
script = ExtResource("editor")
|
||||
|
||||
[node name="Mist" type="ColorRect" parent="."]
|
||||
material = SubResource("mist")
|
||||
mouse_filter = 2
|
||||
color = Color(1, 1, 1, 1)
|
||||
|
||||
[node name="Dust" type="CPUParticles2D" parent="."]
|
||||
amount = 36
|
||||
lifetime = 12.0
|
||||
preprocess = 12.0
|
||||
randomness = 0.65
|
||||
emission_shape = 3
|
||||
emission_rect_extents = Vector2(704, 396)
|
||||
direction = Vector2(0.35, -1)
|
||||
spread = 18.0
|
||||
gravity = Vector2(0, 0)
|
||||
initial_velocity_min = 3.0
|
||||
initial_velocity_max = 8.0
|
||||
scale_amount_min = 1.0
|
||||
scale_amount_max = 2.0
|
||||
color = Color(0.72, 0.60, 0.45, 0.38)
|
||||
color_ramp = SubResource("fade")
|
||||
@@ -0,0 +1,137 @@
|
||||
@tool
|
||||
extends Node2D
|
||||
class_name AshenVista
|
||||
|
||||
## Fondos pintados en planos independientes. Solo reconstruye la presentacion
|
||||
## al editar recursos; Parallax2D se ocupa del desplazamiento durante la partida.
|
||||
## Cada panorama alterna normal/reflejado para cerrar su union sin estirarlo.
|
||||
|
||||
@export_category("Painted layers")
|
||||
@export var distant_texture: Texture2D:
|
||||
set(value):
|
||||
distant_texture = value
|
||||
_queue_refresh()
|
||||
@export var middle_texture: Texture2D:
|
||||
set(value):
|
||||
middle_texture = value
|
||||
_queue_refresh()
|
||||
@export var near_texture: Texture2D:
|
||||
set(value):
|
||||
near_texture = value
|
||||
_queue_refresh()
|
||||
|
||||
@export_category("Composition")
|
||||
@export var horizon_y: float = 1008.0:
|
||||
set(value):
|
||||
horizon_y = value
|
||||
_queue_refresh()
|
||||
## Altura de referencia para componer el panorama tambien en el editor.
|
||||
@export var camera_anchor_y: float = 760.0:
|
||||
set(value):
|
||||
camera_anchor_y = value
|
||||
_queue_refresh()
|
||||
@export var composition_x: float = 0.0:
|
||||
set(value):
|
||||
composition_x = value
|
||||
_queue_refresh()
|
||||
@export_range(0.1, 2.0, 0.05) var distant_scale: float = 0.5:
|
||||
set(value):
|
||||
distant_scale = maxf(value, 0.1)
|
||||
_queue_refresh()
|
||||
@export_range(0.1, 2.0, 0.05) var middle_scale: float = 0.5:
|
||||
set(value):
|
||||
middle_scale = maxf(value, 0.1)
|
||||
_queue_refresh()
|
||||
@export_range(0.1, 2.0, 0.05) var near_scale: float = 0.5:
|
||||
set(value):
|
||||
near_scale = maxf(value, 0.1)
|
||||
_queue_refresh()
|
||||
@export var distant_tint: Color = Color.WHITE:
|
||||
set(value):
|
||||
distant_tint = value
|
||||
_queue_refresh()
|
||||
@export var middle_tint: Color = Color(0.60, 0.65, 0.74, 1.0):
|
||||
set(value):
|
||||
middle_tint = value
|
||||
_queue_refresh()
|
||||
@export var near_tint: Color = Color(0.44, 0.42, 0.44, 1.0):
|
||||
set(value):
|
||||
near_tint = value
|
||||
_queue_refresh()
|
||||
|
||||
var _refresh_pending: bool = false
|
||||
var _last_camera_y: float = INF
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
_refresh()
|
||||
set_process(not Engine.is_editor_hint())
|
||||
|
||||
|
||||
func _queue_refresh() -> void:
|
||||
if not is_inside_tree() or _refresh_pending:
|
||||
return
|
||||
_refresh_pending = true
|
||||
call_deferred("_refresh")
|
||||
|
||||
|
||||
func _refresh() -> void:
|
||||
_refresh_pending = false
|
||||
if not is_inside_tree() or not has_node("Distant"):
|
||||
return
|
||||
_configure_layer($Distant, distant_texture, distant_scale, 0.12, distant_tint, 0.0)
|
||||
_configure_layer($Middle, middle_texture, middle_scale, 0.34, middle_tint, 24.0)
|
||||
_configure_layer($Near, near_texture, near_scale, 0.63, near_tint, -120.0)
|
||||
_last_camera_y = INF
|
||||
update_configuration_warnings()
|
||||
|
||||
|
||||
func _configure_layer(layer: Parallax2D, texture: Texture2D, factor: float,
|
||||
speed: float, tint: Color, base_offset: float) -> void:
|
||||
layer.visible = texture != null
|
||||
if texture == null:
|
||||
return
|
||||
var width: float = texture.get_width() * factor
|
||||
var height: float = texture.get_height() * factor
|
||||
# La vertical sigue al mundo: los fondos no se separan de los pies al saltar.
|
||||
layer.scroll_scale = Vector2(speed, 1.0)
|
||||
layer.repeat_size = Vector2(width * 2.0, 0.0)
|
||||
layer.repeat_times = 3
|
||||
for index: int in range(2):
|
||||
var panel: Sprite2D = layer.get_child(index) as Sprite2D
|
||||
panel.texture = texture
|
||||
panel.scale = Vector2(factor, factor)
|
||||
panel.position = Vector2(index * width + composition_x, horizon_y - height + base_offset)
|
||||
panel.modulate = tint
|
||||
panel.flip_h = index == 1
|
||||
|
||||
|
||||
func _process(_delta: float) -> void:
|
||||
var camera: Camera2D = get_viewport().get_camera_2d()
|
||||
if camera == null:
|
||||
return
|
||||
var camera_y: float = camera.get_screen_center_position().y
|
||||
if is_equal_approx(camera_y, _last_camera_y):
|
||||
return
|
||||
_last_camera_y = camera_y
|
||||
# El cielo acompana el ascenso; las siluetas cercanas cambian ligeramente de
|
||||
# altura. Solo se mueven sprites almacenados, no se reconstruye el dibujo.
|
||||
_position_vertical($Distant, distant_texture, distant_scale, 0.0, 0.0, camera_y)
|
||||
_position_vertical($Middle, middle_texture, middle_scale, 24.0, 0.12, camera_y)
|
||||
_position_vertical($Near, near_texture, near_scale, -120.0, 0.22, camera_y)
|
||||
|
||||
|
||||
func _position_vertical(layer: Parallax2D, texture: Texture2D, factor: float,
|
||||
base_offset: float, ratio: float, camera_y: float) -> void:
|
||||
if texture == null:
|
||||
return
|
||||
var y: float = horizon_y - texture.get_height() * factor + base_offset
|
||||
y += (camera_y - camera_anchor_y) * (1.0 - ratio)
|
||||
for panel: Sprite2D in layer.get_children():
|
||||
panel.position.y = roundf(y)
|
||||
|
||||
|
||||
func _get_configuration_warnings() -> PackedStringArray:
|
||||
if distant_texture == null:
|
||||
return PackedStringArray(["Asigna el panorama lejano de la localizacion."])
|
||||
return PackedStringArray()
|
||||
@@ -1,52 +1,52 @@
|
||||
[gd_scene load_steps=5 format=3]
|
||||
[ext_resource type="Texture2D" path="res://assets/city/sky.png" id="art_sky"]
|
||||
[ext_resource type="Texture2D" path="res://assets/city/clouds.png" id="art_clouds"]
|
||||
[ext_resource type="Texture2D" path="res://assets/city/skyline_far.png" id="art_skyline_far"]
|
||||
[ext_resource type="Texture2D" path="res://assets/city/skyline_mid.png" id="art_skyline_mid"]
|
||||
|
||||
[ext_resource type="Script" path="res://world/backgrounds/ashen_vista.gd" id="script"]
|
||||
[ext_resource type="Texture2D" path="res://assets/ashen/environment/city_far.png" id="far"]
|
||||
[ext_resource type="Texture2D" path="res://assets/ashen/environment/city_mid.png" id="mid"]
|
||||
[ext_resource type="Texture2D" path="res://assets/ashen/environment/near_ruins.png" id="near"]
|
||||
|
||||
[node name="CityBackground" type="Node2D"]
|
||||
|
||||
[node name="Sky" type="Parallax2D" parent="."]
|
||||
z_index = -18
|
||||
scroll_scale = Vector2(0, 1)
|
||||
repeat_size = Vector2(1024, 0)
|
||||
repeat_times = 2
|
||||
|
||||
[node name="Strip" type="Sprite2D" parent="Sky"]
|
||||
centered = false
|
||||
texture_filter = 1
|
||||
texture = ExtResource("art_sky")
|
||||
script = ExtResource("script")
|
||||
distant_texture = ExtResource("far")
|
||||
middle_texture = ExtResource("mid")
|
||||
near_texture = ExtResource("near")
|
||||
|
||||
[node name="HighClouds" type="Parallax2D" parent="."]
|
||||
z_index = -17
|
||||
[node name="SkyTone" type="Polygon2D" parent="."]
|
||||
z_index = -40
|
||||
color = Color(0.14, 0.10, 0.15, 1)
|
||||
polygon = PackedVector2Array(-20000, -12000, 40000, -12000, 40000, 12000, -20000, 12000)
|
||||
|
||||
[node name="Distant" type="Parallax2D" parent="."]
|
||||
z_index = -30
|
||||
scroll_scale = Vector2(0.12, 1)
|
||||
repeat_size = Vector2(1024, 0)
|
||||
repeat_times = 2
|
||||
autoscroll = Vector2(3, 0)
|
||||
repeat_size = Vector2(1774, 0)
|
||||
repeat_times = 3
|
||||
|
||||
[node name="Strip" type="Sprite2D" parent="HighClouds"]
|
||||
[node name="Normal" type="Sprite2D" parent="Distant"]
|
||||
centered = false
|
||||
texture_filter = 1
|
||||
texture = ExtResource("art_clouds")
|
||||
|
||||
[node name="FarBuildings" type="Parallax2D" parent="."]
|
||||
z_index = -16
|
||||
scroll_scale = Vector2(0.23, 1)
|
||||
repeat_size = Vector2(1024, 0)
|
||||
repeat_times = 2
|
||||
|
||||
[node name="Strip" type="Sprite2D" parent="FarBuildings"]
|
||||
[node name="Mirrored" type="Sprite2D" parent="Distant"]
|
||||
centered = false
|
||||
texture_filter = 1
|
||||
texture = ExtResource("art_skyline_far")
|
||||
|
||||
[node name="NearBuildings" type="Parallax2D" parent="."]
|
||||
z_index = -15
|
||||
scroll_scale = Vector2(0.46, 1)
|
||||
repeat_size = Vector2(1024, 0)
|
||||
repeat_times = 2
|
||||
[node name="Middle" type="Parallax2D" parent="."]
|
||||
z_index = -24
|
||||
scroll_scale = Vector2(0.34, 1)
|
||||
repeat_times = 3
|
||||
|
||||
[node name="Strip" type="Sprite2D" parent="NearBuildings"]
|
||||
[node name="Normal" type="Sprite2D" parent="Middle"]
|
||||
centered = false
|
||||
|
||||
[node name="Mirrored" type="Sprite2D" parent="Middle"]
|
||||
centered = false
|
||||
|
||||
[node name="Near" type="Parallax2D" parent="."]
|
||||
z_index = -18
|
||||
scroll_scale = Vector2(0.63, 1)
|
||||
repeat_times = 3
|
||||
|
||||
[node name="Normal" type="Sprite2D" parent="Near"]
|
||||
centered = false
|
||||
|
||||
[node name="Mirrored" type="Sprite2D" parent="Near"]
|
||||
centered = false
|
||||
texture_filter = 1
|
||||
texture = ExtResource("art_skyline_mid")
|
||||
@@ -0,0 +1,58 @@
|
||||
@tool
|
||||
extends TextureRect
|
||||
class_name PaintedHall
|
||||
|
||||
## Mural con profundidad real dentro de los limites de una sala. La camara
|
||||
## recorre una pintura grande lentamente; columnas y plataformas siguen al mundo.
|
||||
## No se estira una ilustracion sobre toda la altura de una torre.
|
||||
const HALL_SHADER: Shader = preload("res://world/backgrounds/painted_hall.gdshader")
|
||||
|
||||
@export var parallax_ratio: Vector2 = Vector2(0.24, 0.18):
|
||||
set(value):
|
||||
parallax_ratio = value
|
||||
_update_layout()
|
||||
@export var composition_offset: Vector2 = Vector2(0.0, 160.0):
|
||||
set(value):
|
||||
composition_offset = value
|
||||
_update_layout()
|
||||
@export_range(0.25, 2.0, 0.05) var art_scale: float = 1.0:
|
||||
set(value):
|
||||
art_scale = maxf(value, 0.25)
|
||||
_update_layout()
|
||||
|
||||
var _hall_material: ShaderMaterial
|
||||
var _last_camera_local: Vector2 = Vector2.INF
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
mouse_filter = Control.MOUSE_FILTER_IGNORE
|
||||
texture_filter = CanvasItem.TEXTURE_FILTER_NEAREST
|
||||
expand_mode = TextureRect.EXPAND_IGNORE_SIZE
|
||||
_hall_material = ShaderMaterial.new()
|
||||
_hall_material.shader = HALL_SHADER
|
||||
material = _hall_material
|
||||
resized.connect(_update_layout)
|
||||
_update_layout()
|
||||
if Engine.is_editor_hint():
|
||||
_hall_material.set_shader_parameter("camera_local", size * 0.5)
|
||||
set_process(false)
|
||||
|
||||
|
||||
func _update_layout() -> void:
|
||||
if _hall_material == null:
|
||||
return
|
||||
_hall_material.set_shader_parameter("panel_size", size)
|
||||
_hall_material.set_shader_parameter("parallax_ratio", parallax_ratio)
|
||||
_hall_material.set_shader_parameter("composition_offset", composition_offset)
|
||||
_hall_material.set_shader_parameter("art_scale", art_scale)
|
||||
|
||||
|
||||
func _process(_delta: float) -> void:
|
||||
var camera: Camera2D = get_viewport().get_camera_2d()
|
||||
if camera == null:
|
||||
return
|
||||
var local_position: Vector2 = get_global_transform().affine_inverse() * camera.get_screen_center_position()
|
||||
if local_position.is_equal_approx(_last_camera_local):
|
||||
return
|
||||
_last_camera_local = local_position
|
||||
_hall_material.set_shader_parameter("camera_local", local_position)
|
||||
@@ -0,0 +1,23 @@
|
||||
shader_type canvas_item;
|
||||
render_mode unshaded;
|
||||
|
||||
uniform vec2 panel_size = vec2(1280.0, 720.0);
|
||||
uniform vec2 camera_local = vec2(640.0, 360.0);
|
||||
uniform vec2 parallax_ratio = vec2(0.24, 0.18);
|
||||
uniform vec2 composition_offset = vec2(0.0, 160.0);
|
||||
uniform float art_scale = 1.0;
|
||||
varying vec4 vertex_tint;
|
||||
|
||||
void vertex() {
|
||||
vertex_tint = COLOR;
|
||||
}
|
||||
|
||||
void fragment() {
|
||||
vec2 art_size = vec2(textureSize(TEXTURE, 0)) * art_scale;
|
||||
vec2 p = UV * panel_size + camera_local * (parallax_ratio - vec2(1.0)) + composition_offset;
|
||||
vec2 uv = p / art_size;
|
||||
float mirrored = mod(floor(uv.x), 2.0);
|
||||
uv.x = mix(fract(uv.x), 1.0 - fract(uv.x), mirrored);
|
||||
uv.y = clamp(uv.y, 0.001, 0.999);
|
||||
COLOR = texture(TEXTURE, uv) * vertex_tint;
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
[gd_scene load_steps=3 format=3]
|
||||
[ext_resource type="PackedScene" path="res://world/props/scenery_prop.tscn" id="base"]
|
||||
[ext_resource type="Texture2D" path="res://assets/ashen/environment/altar.png" id="texture"]
|
||||
|
||||
[node name="Altar" instance=ExtResource("base")]
|
||||
texture = ExtResource("texture")
|
||||
display_size = Vector2(160, 148)
|
||||
draw_layer = -2
|
||||
tint = Color(0.78, 0.75, 0.82, 1)
|
||||
collision_enabled = false
|
||||
@@ -0,0 +1,9 @@
|
||||
[gd_scene load_steps=3 format=3]
|
||||
[ext_resource type="PackedScene" path="res://world/props/scenery_prop.tscn" id="base"]
|
||||
[ext_resource type="Texture2D" path="res://assets/ashen/environment/amplifier.png" id="texture"]
|
||||
|
||||
[node name="Amplifier" instance=ExtResource("base")]
|
||||
texture = ExtResource("texture")
|
||||
display_size = Vector2(76, 80)
|
||||
draw_layer = -2
|
||||
collision_enabled = false
|
||||
@@ -0,0 +1,10 @@
|
||||
[gd_scene load_steps=3 format=3]
|
||||
[ext_resource type="PackedScene" path="res://world/props/scenery_prop.tscn" id="base"]
|
||||
[ext_resource type="Texture2D" path="res://assets/ashen/environment/banner.png" id="texture"]
|
||||
|
||||
[node name="Banner" instance=ExtResource("base")]
|
||||
texture = ExtResource("texture")
|
||||
display_size = Vector2(112, 152)
|
||||
draw_layer = -2
|
||||
tint = Color(0.80, 0.77, 0.82, 1)
|
||||
collision_enabled = false
|
||||
@@ -1,6 +1,6 @@
|
||||
[gd_scene load_steps=3 format=3]
|
||||
[ext_resource type="PackedScene" path="res://world/props/scenery_prop.tscn" id="base"]
|
||||
[ext_resource type="Texture2D" path="res://assets/props/barrel.svg" id="texture"]
|
||||
[ext_resource type="Texture2D" path="res://assets/ashen/environment/barrel.png" id="texture"]
|
||||
[node name="Barrel" instance=ExtResource("base")]
|
||||
texture = ExtResource("texture")
|
||||
display_size = Vector2(64, 80)
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
[gd_scene load_steps=3 format=3]
|
||||
[ext_resource type="PackedScene" path="res://world/props/scenery_prop.tscn" id="base"]
|
||||
[ext_resource type="Texture2D" path="res://assets/props/bench.svg" id="texture"]
|
||||
[ext_resource type="Texture2D" path="res://assets/ashen/environment/altar.png" id="texture"]
|
||||
[node name="Bench" instance=ExtResource("base")]
|
||||
texture = ExtResource("texture")
|
||||
display_size = Vector2(160, 84)
|
||||
display_size = Vector2(160, 148)
|
||||
draw_layer = -2
|
||||
collision_enabled = false
|
||||
collision_dimensions = Vector2(152, 60)
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
[gd_scene load_steps=3 format=3]
|
||||
[ext_resource type="PackedScene" path="res://world/props/scenery_prop.tscn" id="base"]
|
||||
[ext_resource type="Texture2D" path="res://assets/ashen/environment/column.png" id="texture"]
|
||||
|
||||
[node name="Column" instance=ExtResource("base")]
|
||||
texture = ExtResource("texture")
|
||||
display_size = Vector2(96, 244)
|
||||
draw_layer = -2
|
||||
tint = Color(0.77, 0.73, 0.80, 1)
|
||||
collision_enabled = false
|
||||
@@ -1,6 +1,6 @@
|
||||
[gd_scene load_steps=3 format=3]
|
||||
[ext_resource type="PackedScene" path="res://world/props/scenery_prop.tscn" id="base"]
|
||||
[ext_resource type="Texture2D" path="res://assets/props/crate.svg" id="texture"]
|
||||
[ext_resource type="Texture2D" path="res://assets/ashen/environment/crate.png" id="texture"]
|
||||
[node name="Crate" instance=ExtResource("base")]
|
||||
texture = ExtResource("texture")
|
||||
display_size = Vector2(64, 64)
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
[gd_scene load_steps=3 format=3]
|
||||
[ext_resource type="PackedScene" path="res://world/props/scenery_prop.tscn" id="base"]
|
||||
[ext_resource type="Texture2D" path="res://assets/city/facade_01.png" id="texture"]
|
||||
[ext_resource type="Texture2D" path="res://assets/ashen/environment/column.png" id="texture"]
|
||||
[node name="Facade01" instance=ExtResource("base")]
|
||||
texture = ExtResource("texture")
|
||||
display_size = Vector2(216, 490)
|
||||
display_size = Vector2(160, 406)
|
||||
draw_layer = -8
|
||||
collision_enabled = false
|
||||
collision_dimensions = Vector2(216, 490)
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
[gd_scene load_steps=3 format=3]
|
||||
[ext_resource type="PackedScene" path="res://world/props/scenery_prop.tscn" id="base"]
|
||||
[ext_resource type="Texture2D" path="res://assets/city/facade_02.png" id="texture"]
|
||||
[ext_resource type="Texture2D" path="res://assets/ashen/environment/statue.png" id="texture"]
|
||||
[node name="Facade02" instance=ExtResource("base")]
|
||||
texture = ExtResource("texture")
|
||||
display_size = Vector2(188, 414)
|
||||
display_size = Vector2(176, 358)
|
||||
draw_layer = -8
|
||||
collision_enabled = false
|
||||
collision_dimensions = Vector2(188, 414)
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
[gd_scene load_steps=3 format=3]
|
||||
[ext_resource type="PackedScene" path="res://world/props/scenery_prop.tscn" id="base"]
|
||||
[ext_resource type="Texture2D" path="res://assets/city/facade_03.png" id="texture"]
|
||||
[ext_resource type="Texture2D" path="res://assets/ashen/environment/banner.png" id="texture"]
|
||||
[node name="Facade03" instance=ExtResource("base")]
|
||||
texture = ExtResource("texture")
|
||||
display_size = Vector2(264, 544)
|
||||
display_size = Vector2(180, 244)
|
||||
draw_layer = -8
|
||||
collision_enabled = false
|
||||
collision_dimensions = Vector2(264, 544)
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
[gd_scene load_steps=3 format=3]
|
||||
[ext_resource type="PackedScene" path="res://world/props/scenery_prop.tscn" id="base"]
|
||||
[ext_resource type="Texture2D" path="res://assets/city/facade_04.png" id="texture"]
|
||||
[ext_resource type="Texture2D" path="res://assets/ashen/environment/city_mid.png" id="texture"]
|
||||
[node name="Facade04" instance=ExtResource("base")]
|
||||
texture = ExtResource("texture")
|
||||
display_size = Vector2(224, 446)
|
||||
display_size = Vector2(800, 400)
|
||||
draw_layer = -8
|
||||
collision_enabled = false
|
||||
collision_dimensions = Vector2(224, 446)
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
[gd_scene load_steps=3 format=3]
|
||||
[ext_resource type="PackedScene" path="res://world/props/scenery_prop.tscn" id="base"]
|
||||
[ext_resource type="Texture2D" path="res://assets/city/facade_05.png" id="texture"]
|
||||
[ext_resource type="Texture2D" path="res://assets/ashen/environment/altar.png" id="texture"]
|
||||
[node name="Facade05" instance=ExtResource("base")]
|
||||
texture = ExtResource("texture")
|
||||
display_size = Vector2(278, 590)
|
||||
display_size = Vector2(240, 222)
|
||||
draw_layer = -8
|
||||
collision_enabled = false
|
||||
collision_dimensions = Vector2(278, 590)
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
[gd_scene load_steps=3 format=3]
|
||||
[ext_resource type="PackedScene" path="res://world/props/scenery_prop.tscn" id="base"]
|
||||
[ext_resource type="Texture2D" path="res://assets/city/facade_06.png" id="texture"]
|
||||
[ext_resource type="Texture2D" path="res://assets/ashen/environment/amplifier.png" id="texture"]
|
||||
[node name="Facade06" instance=ExtResource("base")]
|
||||
texture = ExtResource("texture")
|
||||
display_size = Vector2(240, 514)
|
||||
display_size = Vector2(152, 160)
|
||||
draw_layer = -8
|
||||
collision_enabled = false
|
||||
collision_dimensions = Vector2(240, 514)
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
[gd_scene load_steps=3 format=3]
|
||||
[ext_resource type="PackedScene" path="res://world/props/scenery_prop.tscn" id="base"]
|
||||
[ext_resource type="Texture2D" path="res://assets/ashen/environment/fence.png" id="texture"]
|
||||
|
||||
[node name="Fence" instance=ExtResource("base")]
|
||||
texture = ExtResource("texture")
|
||||
display_size = Vector2(208, 204)
|
||||
draw_layer = -2
|
||||
tint = Color(0.62, 0.63, 0.72, 1)
|
||||
collision_enabled = false
|
||||
@@ -0,0 +1,9 @@
|
||||
[gd_scene load_steps=3 format=3]
|
||||
[ext_resource type="PackedScene" path="res://world/props/scenery_prop.tscn" id="base"]
|
||||
[ext_resource type="Texture2D" path="res://assets/ashen/environment/ivy.png" id="texture"]
|
||||
|
||||
[node name="Ivy" instance=ExtResource("base")]
|
||||
texture = ExtResource("texture")
|
||||
display_size = Vector2(120, 128)
|
||||
draw_layer = -2
|
||||
collision_enabled = false
|
||||
@@ -1,9 +1,9 @@
|
||||
[gd_scene load_steps=3 format=3]
|
||||
[ext_resource type="PackedScene" path="res://world/props/scenery_prop.tscn" id="base"]
|
||||
[ext_resource type="Texture2D" path="res://assets/props/rock.svg" id="texture"]
|
||||
[ext_resource type="Texture2D" path="res://assets/ashen/environment/rubble.png" id="texture"]
|
||||
[node name="Rock" instance=ExtResource("base")]
|
||||
texture = ExtResource("texture")
|
||||
display_size = Vector2(80, 48)
|
||||
display_size = Vector2(96, 60)
|
||||
draw_layer = -2
|
||||
collision_enabled = true
|
||||
collision_dimensions = Vector2(64, 40)
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
[gd_scene load_steps=3 format=3]
|
||||
[ext_resource type="PackedScene" path="res://world/props/scenery_prop.tscn" id="base"]
|
||||
[ext_resource type="Texture2D" path="res://assets/ashen/environment/rubble.png" id="texture"]
|
||||
|
||||
[node name="Rubble" instance=ExtResource("base")]
|
||||
texture = ExtResource("texture")
|
||||
display_size = Vector2(96, 60)
|
||||
draw_layer = -2
|
||||
collision_enabled = false
|
||||
@@ -0,0 +1,10 @@
|
||||
[gd_scene load_steps=3 format=3]
|
||||
[ext_resource type="PackedScene" path="res://world/props/scenery_prop.tscn" id="base"]
|
||||
[ext_resource type="Texture2D" path="res://assets/ashen/environment/statue.png" id="texture"]
|
||||
|
||||
[node name="Statue" instance=ExtResource("base")]
|
||||
texture = ExtResource("texture")
|
||||
display_size = Vector2(120, 244)
|
||||
draw_layer = -2
|
||||
tint = Color(0.70, 0.70, 0.78, 1)
|
||||
collision_enabled = false
|
||||
@@ -1,10 +1,16 @@
|
||||
[gd_scene load_steps=3 format=3]
|
||||
[gd_scene load_steps=4 format=3]
|
||||
[ext_resource type="PackedScene" path="res://world/props/scenery_prop.tscn" id="base"]
|
||||
[ext_resource type="Texture2D" path="res://assets/city/streetlamp.png" id="texture"]
|
||||
[ext_resource type="Texture2D" path="res://assets/ashen/environment/candelabra.png" id="texture"]
|
||||
[ext_resource type="PackedScene" path="res://world/props/votive_glow.tscn" id="glow"]
|
||||
[node name="Streetlamp" instance=ExtResource("base")]
|
||||
texture = ExtResource("texture")
|
||||
display_size = Vector2(96, 352)
|
||||
display_size = Vector2(82, 168)
|
||||
draw_layer = -2
|
||||
collision_enabled = false
|
||||
collision_dimensions = Vector2(16, 320)
|
||||
collision_offset = Vector2(0, -160)
|
||||
|
||||
[node name="CandleGlow" parent="." instance=ExtResource("glow")]
|
||||
position = Vector2(0, -142)
|
||||
texture_scale = 1.7
|
||||
base_energy = 0.32
|
||||
@@ -0,0 +1,9 @@
|
||||
[gd_scene load_steps=3 format=3]
|
||||
[ext_resource type="PackedScene" path="res://world/props/scenery_prop.tscn" id="base"]
|
||||
[ext_resource type="Texture2D" path="res://assets/ashen/environment/tombstone.png" id="texture"]
|
||||
|
||||
[node name="Tombstone" instance=ExtResource("base")]
|
||||
texture = ExtResource("texture")
|
||||
display_size = Vector2(70, 82)
|
||||
draw_layer = -2
|
||||
collision_enabled = false
|
||||
@@ -1,9 +1,9 @@
|
||||
[gd_scene load_steps=3 format=3]
|
||||
[ext_resource type="PackedScene" path="res://world/props/scenery_prop.tscn" id="base"]
|
||||
[ext_resource type="Texture2D" path="res://assets/props/traffic_cone.svg" id="texture"]
|
||||
[ext_resource type="Texture2D" path="res://assets/ashen/environment/tombstone.png" id="texture"]
|
||||
[node name="TrafficCone" instance=ExtResource("base")]
|
||||
texture = ExtResource("texture")
|
||||
display_size = Vector2(48, 64)
|
||||
display_size = Vector2(54, 64)
|
||||
draw_layer = -2
|
||||
collision_enabled = false
|
||||
collision_dimensions = Vector2(36, 56)
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
[gd_scene load_steps=3 format=3]
|
||||
[ext_resource type="PackedScene" path="res://world/props/scenery_prop.tscn" id="base"]
|
||||
[ext_resource type="Texture2D" path="res://assets/props/trash_bin.svg" id="texture"]
|
||||
[ext_resource type="Texture2D" path="res://assets/ashen/environment/amplifier.png" id="texture"]
|
||||
[node name="TrashBin" instance=ExtResource("base")]
|
||||
texture = ExtResource("texture")
|
||||
display_size = Vector2(56, 76)
|
||||
display_size = Vector2(76, 80)
|
||||
draw_layer = -2
|
||||
collision_enabled = true
|
||||
collision_dimensions = Vector2(42, 72)
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
extends PointLight2D
|
||||
|
||||
## Halo local del fuego pintado. La leve respiracion se detiene en pausa.
|
||||
@export var base_energy: float = 0.45
|
||||
var _clock: float = 0.0
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
_clock = fposmod(global_position.x * 0.017 + global_position.y * 0.009, TAU)
|
||||
energy = base_energy
|
||||
|
||||
|
||||
func _process(delta: float) -> void:
|
||||
_clock += delta
|
||||
energy = base_energy * (0.94 + sin(_clock * 2.1) * 0.04 + sin(_clock * 5.3) * 0.02)
|
||||
@@ -0,0 +1,25 @@
|
||||
[gd_scene load_steps=4 format=3]
|
||||
|
||||
[ext_resource type="Script" path="res://world/props/votive_glow.gd" id="script"]
|
||||
|
||||
[sub_resource type="Gradient" id="radial"]
|
||||
offsets = PackedFloat32Array(0, 0.25, 0.6, 1)
|
||||
colors = PackedColorArray(1, 1, 1, 0.8, 1, 1, 1, 0.45, 1, 1, 1, 0.1, 1, 1, 1, 0)
|
||||
|
||||
[sub_resource type="GradientTexture2D" id="halo"]
|
||||
gradient = SubResource("radial")
|
||||
width = 128
|
||||
height = 128
|
||||
fill = 1
|
||||
fill_from = Vector2(0.5, 0.5)
|
||||
fill_to = Vector2(0.5, 1)
|
||||
|
||||
[node name="VotiveGlow" type="PointLight2D"]
|
||||
texture = SubResource("halo")
|
||||
texture_scale = 1.2
|
||||
color = Color(1, 0.62, 0.29, 1)
|
||||
energy = 0.45
|
||||
range_z_min = -10
|
||||
range_z_max = 6
|
||||
shadow_enabled = false
|
||||
script = ExtResource("script")
|
||||
@@ -1,12 +1,12 @@
|
||||
[gd_scene load_steps=5 format=3]
|
||||
[ext_resource type="PackedScene" path="res://world/props/scenery_prop.tscn" id="base"]
|
||||
[ext_resource type="Script" path="res://world/signs/world_sign.gd" id="script"]
|
||||
[ext_resource type="Texture2D" path="res://assets/props/sign_board.svg" id="texture"]
|
||||
[ext_resource type="Texture2D" path="res://assets/ashen/ui/button_plate.png" id="texture"]
|
||||
[ext_resource type="FontFile" path="res://assets/fonts/PixelOperator8.ttf" id="font"]
|
||||
[node name="SignPost" instance=ExtResource("base")]
|
||||
script = ExtResource("script")
|
||||
texture = ExtResource("texture")
|
||||
display_size = Vector2(240, 144)
|
||||
display_size = Vector2(240, 104)
|
||||
collision_dimensions = Vector2(20, 144)
|
||||
collision_offset = Vector2(0, -72)
|
||||
[node name="Text" type="Label" parent="."]
|
||||
|
||||
@@ -29,5 +29,8 @@ func _refresh() -> void:
|
||||
label.text = text
|
||||
label.add_theme_font_size_override("font_size", font_size)
|
||||
label.add_theme_color_override("font_color", text_color)
|
||||
label.position = Vector2(-display_size.x * 0.5 + 10.0, -display_size.y + 8.0)
|
||||
label.size = Vector2(maxf(display_size.x - 20.0, 1.0), maxf(display_size.y * 0.60 - 16.0, 1.0))
|
||||
label.add_theme_color_override("font_shadow_color", Color(0.025, 0.02, 0.04, 1.0))
|
||||
label.add_theme_constant_override("shadow_offset_x", 1)
|
||||
label.add_theme_constant_override("shadow_offset_y", 1)
|
||||
label.position = Vector2(-display_size.x * 0.5 + 10.0, -display_size.y + 12.0)
|
||||
label.size = Vector2(maxf(display_size.x - 20.0, 1.0), maxf(display_size.y - 24.0, 1.0))
|
||||
@@ -1,8 +1,12 @@
|
||||
[gd_scene load_steps=4 format=3]
|
||||
[gd_scene load_steps=5 format=3]
|
||||
[ext_resource type="PackedScene" path="res://world/terrain/terrain_piece.tscn" id="base"]
|
||||
[ext_resource type="Texture2D" path="res://assets/city/asphalt.png" id="fill"]
|
||||
[ext_resource type="Texture2D" path="res://assets/city/curb.png" id="top"]
|
||||
[ext_resource type="Texture2D" path="res://assets/ashen/environment/stone_fill.png" id="fill"]
|
||||
[ext_resource type="Texture2D" path="res://assets/ashen/environment/stone_cap.png" id="top"]
|
||||
[ext_resource type="Texture2D" path="res://assets/ashen/environment/platform_skulls.png" id="fascia"]
|
||||
[node name="Ground" instance=ExtResource("base")]
|
||||
dimensions = Vector2(512, 256)
|
||||
fill_texture = ExtResource("fill")
|
||||
top_texture = ExtResource("top")
|
||||
top_height = 16.0
|
||||
fascia_texture = ExtResource("fascia")
|
||||
fascia_height = 54.0
|
||||
@@ -1,7 +1,9 @@
|
||||
[gd_scene load_steps=3 format=3]
|
||||
[ext_resource type="PackedScene" path="res://world/terrain/terrain_piece.tscn" id="base"]
|
||||
[ext_resource type="Texture2D" path="res://assets/city/walkway.png" id="fill"]
|
||||
[ext_resource type="Texture2D" path="res://assets/ashen/environment/platform.png" id="fill"]
|
||||
[node name="Platform" instance=ExtResource("base")]
|
||||
dimensions = Vector2(240, 20)
|
||||
fill_texture = ExtResource("fill")
|
||||
fascia_texture = ExtResource("fill")
|
||||
fascia_height = 54.0
|
||||
one_way = true
|
||||
@@ -1,5 +1,6 @@
|
||||
[gd_scene load_steps=2 format=3]
|
||||
[gd_scene load_steps=3 format=3]
|
||||
[ext_resource type="PackedScene" path="res://world/terrain/terrain_piece.tscn" id="base"]
|
||||
[ext_resource type="Texture2D" path="res://assets/ashen/environment/stone_fill.png" id="stone"]
|
||||
|
||||
[node name="SolidBlock" instance=ExtResource("base")]
|
||||
outline_color = Color(0.93, 0.94, 1, 0.6)
|
||||
fill_texture = ExtResource("stone")
|
||||
@@ -40,15 +40,25 @@ extends StaticBody2D
|
||||
set(value):
|
||||
top_texture = value
|
||||
_queue_refresh()
|
||||
## Friso que cuelga bajo una plataforma. Es decorativo: la linea superior
|
||||
## y la colision conservan exactamente las medidas de Geometry.
|
||||
@export var fascia_texture: Texture2D:
|
||||
set(value):
|
||||
fascia_texture = value
|
||||
_queue_refresh()
|
||||
@export_range(0.0, 128.0, 1.0) var fascia_height: float = 0.0:
|
||||
set(value):
|
||||
fascia_height = maxf(value, 0.0)
|
||||
_queue_refresh()
|
||||
@export_range(1.0, 128.0, 1.0) var top_height: float = 24.0:
|
||||
set(value):
|
||||
top_height = value
|
||||
_queue_refresh()
|
||||
@export var fill_color: Color = Color(0.32, 0.57, 0.79):
|
||||
@export var fill_color: Color = Color(0.20, 0.18, 0.23):
|
||||
set(value):
|
||||
fill_color = value
|
||||
_queue_refresh()
|
||||
@export var outline_color: Color = Color(0.93, 0.94, 1.0, 0.0):
|
||||
@export var outline_color: Color = Color(0.72, 0.63, 0.47, 0.0):
|
||||
set(value):
|
||||
outline_color = value
|
||||
queue_redraw()
|
||||
@@ -103,6 +113,27 @@ func _refresh() -> void:
|
||||
top.position = -half
|
||||
top.region_rect = Rect2(Vector2.ZERO, Vector2(dimensions.x, minf(top_height, dimensions.y)))
|
||||
top.visible = top_texture != null
|
||||
var fascia: Sprite2D = get_node_or_null("Fascia") as Sprite2D
|
||||
if fascia != null:
|
||||
fascia.texture = fascia_texture
|
||||
fascia.position = -half
|
||||
fascia.region_rect = Rect2(Vector2.ZERO, Vector2(dimensions.x, fascia_height))
|
||||
fascia.visible = fascia_texture != null and fascia_height > 0.0
|
||||
# La luz del canto se pierde hacia el subsuelo. Se calcula una sola vez,
|
||||
# en la misma geometria que la colision, sin shaders por baldosa.
|
||||
var shade: Polygon2D = get_node_or_null("DepthShade") as Polygon2D
|
||||
if shade != null:
|
||||
var shaded_top: float = -half.y + minf(28.0, dimensions.y)
|
||||
shade.polygon = PackedVector2Array([
|
||||
Vector2(-half.x, shaded_top), Vector2(half.x, shaded_top),
|
||||
Vector2(half.x, half.y), Vector2(-half.x, half.y),
|
||||
])
|
||||
var depth: float = minf(0.74, dimensions.y / 600.0)
|
||||
shade.vertex_colors = PackedColorArray([
|
||||
Color(0.06, 0.045, 0.085, 0.0), Color(0.06, 0.045, 0.085, 0.0),
|
||||
Color(0.06, 0.045, 0.085, depth), Color(0.06, 0.045, 0.085, depth),
|
||||
])
|
||||
shade.visible = fill_texture != null and dimensions.y > 48.0
|
||||
queue_redraw()
|
||||
update_configuration_warnings()
|
||||
|
||||
|
||||
@@ -10,12 +10,17 @@ collision_mask = 0
|
||||
script = ExtResource("script")
|
||||
[node name="Fill" type="Polygon2D" parent="."]
|
||||
polygon = PackedVector2Array(-128, -32, 128, -32, 128, 32, -128, 32)
|
||||
color = Color(0.32, 0.57, 0.79, 1)
|
||||
color = Color(0.20, 0.18, 0.23, 1)
|
||||
[node name="Texture" type="Sprite2D" parent="."]
|
||||
texture_repeat = 2
|
||||
centered = false
|
||||
region_enabled = true
|
||||
region_rect = Rect2(0, 0, 256, 64)
|
||||
[node name="Fascia" type="Sprite2D" parent="."]
|
||||
texture_repeat = 2
|
||||
centered = false
|
||||
region_enabled = true
|
||||
region_rect = Rect2(0, 0, 256, 54)
|
||||
[node name="Top" type="Sprite2D" parent="."]
|
||||
texture_repeat = 2
|
||||
centered = false
|
||||
@@ -23,3 +28,7 @@ region_enabled = true
|
||||
region_rect = Rect2(0, 0, 256, 24)
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||
shape = SubResource("shape")
|
||||
|
||||
[node name="DepthShade" type="Polygon2D" parent="."]
|
||||
polygon = PackedVector2Array(-128, -4, 128, -4, 128, 32, -128, 32)
|
||||
vertex_colors = PackedColorArray(0.06, 0.045, 0.085, 0, 0.06, 0.045, 0.085, 0, 0.06, 0.045, 0.085, 0.1, 0.06, 0.045, 0.085, 0.1)
|
||||
@@ -1,6 +1,6 @@
|
||||
[gd_scene load_steps=3 format=3]
|
||||
[ext_resource type="PackedScene" path="res://world/terrain/terrain_piece.tscn" id="base"]
|
||||
[ext_resource type="Texture2D" path="res://assets/city/barrier.png" id="fill"]
|
||||
[ext_resource type="Texture2D" path="res://assets/ashen/environment/abbey_wall.png" id="fill"]
|
||||
[node name="Wall" instance=ExtResource("base")]
|
||||
dimensions = Vector2(48, 320)
|
||||
fill_texture = ExtResource("fill")
|
||||
@@ -1,7 +1,7 @@
|
||||
[gd_scene load_steps=5 format=3]
|
||||
|
||||
[ext_resource type="Script" path="res://world/triggers/kill_gate.gd" id="gate"]
|
||||
[ext_resource type="Script" path="res://world/triggers/ossuary_gate_visual.gd" id="visual"]
|
||||
[ext_resource type="PackedScene" path="res://world/triggers/ossuary_gate_visual.tscn" id="visual"]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="gate_collision"]
|
||||
size = Vector2(44, 220)
|
||||
@@ -17,8 +17,7 @@ script = ExtResource("gate")
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||
shape = SubResource("gate_collision")
|
||||
|
||||
[node name="Visual" type="Node2D" parent="."]
|
||||
script = ExtResource("visual")
|
||||
[node name="Visual" parent="." instance=ExtResource("visual")]
|
||||
|
||||
[node name="Sensor" type="Area2D" parent="."]
|
||||
position = Vector2(-40, 0)
|
||||
|
||||
@@ -1,22 +1,27 @@
|
||||
@tool
|
||||
extends Node2D
|
||||
class_name OssuaryGateVisual
|
||||
## Porton de calaveras provisional: hojas de hierro, cadenas, sello y apertura
|
||||
## lateral animada. No controla las muertes ni las colisiones del nivel.
|
||||
|
||||
## Porton raster: las dos hojas de hierro se repliegan detras de las columnas.
|
||||
## Solo anima sprites ya cargados. KillGate conserva todo el contrato de combate
|
||||
## y retira su colision exclusivamente al recibir fully_open.
|
||||
signal fully_open
|
||||
|
||||
@export_range(0.2, 4.0, 0.1) var open_duration: float = 1.15
|
||||
|
||||
var _unlocked: bool = false
|
||||
var _progress: float = 0.0
|
||||
var _elapsed: float = 0.0
|
||||
var _signalled: bool = false
|
||||
|
||||
const STONE: Color = Color(0.24, 0.22, 0.29)
|
||||
const STONE_EDGE: Color = Color(0.53, 0.49, 0.59)
|
||||
const IRON: Color = Color(0.12, 0.12, 0.19)
|
||||
const IRON_EDGE: Color = Color(0.53, 0.58, 0.63)
|
||||
const BONE: Color = Color(0.90, 0.84, 0.71)
|
||||
@onready var _left_leaf: Sprite2D = $LeftLeaf
|
||||
@onready var _right_leaf: Sprite2D = $RightLeaf
|
||||
@onready var _seal: Sprite2D = $Seal
|
||||
@onready var _glow: PointLight2D = $SealGlow
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
_update_visuals()
|
||||
set_process(_unlocked and not Engine.is_editor_hint())
|
||||
|
||||
|
||||
func set_unlocked(value: bool) -> void:
|
||||
@@ -25,135 +30,29 @@ func set_unlocked(value: bool) -> void:
|
||||
_unlocked = value
|
||||
if not value:
|
||||
_signalled = false
|
||||
if not Engine.is_editor_hint():
|
||||
set_process(true)
|
||||
|
||||
|
||||
func _process(delta: float) -> void:
|
||||
if Engine.is_editor_hint():
|
||||
# Preview fija en el editor; animacion real solo durante la partida.
|
||||
queue_redraw()
|
||||
return
|
||||
_elapsed += delta
|
||||
_progress = move_toward(_progress, 1.0 if _unlocked else 0.0, delta / open_duration)
|
||||
_progress = move_toward(_progress, 1.0 if _unlocked else 0.0,
|
||||
delta / maxf(open_duration, 0.01))
|
||||
_update_visuals()
|
||||
if _unlocked and _progress >= 1.0 and not _signalled:
|
||||
_signalled = true
|
||||
fully_open.emit()
|
||||
queue_redraw()
|
||||
if is_equal_approx(_progress, 1.0 if _unlocked else 0.0):
|
||||
set_process(false)
|
||||
|
||||
|
||||
func _draw() -> void:
|
||||
var pale: Color = Color(0.45, 1.0, 0.85) if _unlocked else Color(1.0, 0.33, 0.31)
|
||||
var pulse: float = 0.6 + 0.4 * sin(_elapsed * 4.0)
|
||||
|
||||
# Sombra y vacio de la cripta. El resplandor se vuelve verde al abrir.
|
||||
draw_colored_polygon(PackedVector2Array([
|
||||
Vector2(-96, 116), Vector2(-96, -62), Vector2(-91, -89),
|
||||
Vector2(-72, -120), Vector2(-40, -142), Vector2(0, -150),
|
||||
Vector2(40, -142), Vector2(72, -120), Vector2(91, -89),
|
||||
Vector2(96, -62), Vector2(96, 116)
|
||||
]), Color(0.055, 0.05, 0.092))
|
||||
draw_rect(Rect2(Vector2(-65, -89), Vector2(130, 198)), Color(0.025, 0.06 + 0.04 * pulse, 0.08))
|
||||
draw_circle(Vector2(0, 6), 42.0, Color(pale.r, pale.g, pale.b, 0.10 + 0.08 * pulse))
|
||||
|
||||
# Las hojas se deslizan a los lados y dejan pasar al personaje.
|
||||
for side: int in [-1, 1]:
|
||||
_draw_leaf(side, side * (31.0 + 60.0 * _progress), pale, pulse)
|
||||
|
||||
# Marco principal de bloques de piedra, dibujado por delante de las hojas.
|
||||
for side: int in [-1, 1]:
|
||||
var x: float = -91.0 if side < 0 else 65.0
|
||||
draw_rect(Rect2(Vector2(x, -93), Vector2(26, 211)), STONE)
|
||||
draw_rect(Rect2(Vector2(x + (20 if side < 0 else 0), -88), Vector2(6, 204)), STONE_EDGE.darkened(0.25))
|
||||
for i: int in range(5):
|
||||
draw_line(Vector2(x, -69 + i * 39), Vector2(x + 26, -69 + i * 39), Color(0.11, 0.11, 0.17), 2.0)
|
||||
_draw_skull(Vector2(side * 78.0, -46.0), 0.38, pale)
|
||||
# Arco de piedra, moldura y remaches.
|
||||
draw_arc(Vector2(0, -61), 91.0, PI, TAU, 45, STONE, 25.0)
|
||||
draw_arc(Vector2(0, -61), 91.0, PI, TAU, 45, STONE_EDGE, 5.0)
|
||||
draw_arc(Vector2(0, -61), 65.0, PI, TAU, 40, Color(0.66, 0.58, 0.76), 4.0)
|
||||
for i: int in range(9):
|
||||
var angle: float = PI + float(i) * PI / 8.0
|
||||
var point: Vector2 = Vector2(cos(angle), sin(angle)) * 88.0 + Vector2(0, -61)
|
||||
draw_circle(point, 4.0, Color(0.12, 0.11, 0.18))
|
||||
draw_rect(Rect2(Vector2(-105, 109), Vector2(210, 15)), STONE)
|
||||
draw_line(Vector2(-103, 109), Vector2(103, 109), STONE_EDGE, 4.0)
|
||||
|
||||
# El craneo principal domina el umbral. Cuernos y huesos cruzados.
|
||||
_draw_bone(Vector2(-31, -149), Vector2(31, -122), 5.0)
|
||||
_draw_bone(Vector2(31, -149), Vector2(-31, -122), 5.0)
|
||||
_draw_skull(Vector2(0.0, -131.0), 0.76, pale)
|
||||
for side: int in [-1, 1]:
|
||||
draw_line(Vector2(side * 41, -127), Vector2(side * 60, -147), STONE_EDGE, 5.0)
|
||||
draw_line(Vector2(side * 60, -147), Vector2(side * 52, -116), STONE_EDGE, 4.0)
|
||||
|
||||
if _progress < 0.97:
|
||||
# Cadenas y cerradura central; desaparecen al romper el sello.
|
||||
var opacity: float = 1.0 - _progress
|
||||
for i: int in range(6):
|
||||
var y: float = -44.0 + i * 23.0
|
||||
draw_arc(Vector2(-4 + (i % 2) * 8, y), 10.0, 0, TAU, 18, Color(0.75, 0.72, 0.76, opacity), 4.0)
|
||||
draw_rect(Rect2(Vector2(-18, 22), Vector2(36, 41)), Color(0.26, 0.16, 0.30, opacity))
|
||||
draw_rect(Rect2(Vector2(-14, 27), Vector2(28, 28)), Color(0.63, 0.50, 0.71, opacity), false, 3.0)
|
||||
draw_circle(Vector2(0, 42), 7.0 + pulse * 2.0, Color(pale.r, pale.g, pale.b, opacity))
|
||||
if _progress > 0.0 and _progress < 1.0:
|
||||
# Chispas del sello mientras se desliza la puerta.
|
||||
for i: int in range(7):
|
||||
var a: float = float(i) * TAU / 7.0 + _elapsed * 2.5
|
||||
var r: float = 18.0 + _progress * 80.0
|
||||
draw_circle(Vector2(cos(a) * r, sin(a) * r * 0.55), 2.0 + i % 3, Color(0.75, 1.0, 0.82, 1.0 - _progress))
|
||||
|
||||
|
||||
func _draw_leaf(side: int, cx: float, glow: Color, pulse: float) -> void:
|
||||
var x: float = cx - 30.0
|
||||
# Acero viejo con barras, remaches y espinas, no un simple rectangulo.
|
||||
draw_rect(Rect2(Vector2(x, -94), Vector2(60, 205)), IRON)
|
||||
draw_rect(Rect2(Vector2(x + 4, -90), Vector2(52, 197)), Color(0.20, 0.18, 0.26), false, 4.0)
|
||||
for j: int in range(4):
|
||||
var bar_x: float = x + 10 + j * 13
|
||||
draw_line(Vector2(bar_x, -86), Vector2(bar_x, 106), IRON_EDGE.darkened(0.30), 5.0)
|
||||
draw_line(Vector2(bar_x + 1, -86), Vector2(bar_x + 1, 106), Color(0.09, 0.08, 0.14), 2.0)
|
||||
# Punta de lanza en cada barra.
|
||||
draw_colored_polygon(PackedVector2Array([
|
||||
Vector2(bar_x - 5, -85), Vector2(bar_x, -104), Vector2(bar_x + 5, -85)
|
||||
]), IRON_EDGE)
|
||||
for j: int in range(4):
|
||||
var y: float = -65 + j * 52
|
||||
draw_rect(Rect2(Vector2(x + 4, y), Vector2(52, 8)), Color(0.34, 0.31, 0.40))
|
||||
for i: int in range(3):
|
||||
draw_circle(Vector2(x + 13 + i * 17, y + 4), 2.0, Color(0.70, 0.66, 0.67))
|
||||
# Huesos cruzados y craneo tallado sobre cada hoja.
|
||||
_draw_bone(Vector2(cx - 18, -38), Vector2(cx + 18, 12), 5.0)
|
||||
_draw_bone(Vector2(cx + 18, -38), Vector2(cx - 18, 12), 5.0)
|
||||
_draw_skull(Vector2(cx, -12), 0.70, glow)
|
||||
# Grietas en la madera ennegrecida, pulso espectral.
|
||||
draw_line(Vector2(cx - 20, 58), Vector2(cx - 6, 69), Color(glow.r, glow.g, glow.b, 0.48 * pulse), 3.0)
|
||||
draw_line(Vector2(cx - 6, 69), Vector2(cx + 5, 64), Color(glow.r, glow.g, glow.b, 0.48 * pulse), 3.0)
|
||||
draw_line(Vector2(cx + 5, 64), Vector2(cx + 16, 88), Color(glow.r, glow.g, glow.b, 0.48 * pulse), 3.0)
|
||||
|
||||
|
||||
func _draw_bone(a: Vector2, b: Vector2, width: float) -> void:
|
||||
draw_line(a, b, BONE.darkened(0.18), width)
|
||||
for end: Vector2 in [a, b]:
|
||||
draw_circle(end + Vector2(-2, 0), width * 0.56, BONE)
|
||||
draw_circle(end + Vector2(2, 0), width * 0.56, BONE)
|
||||
|
||||
|
||||
func _draw_skull(center: Vector2, scale_value: float, glow: Color) -> void:
|
||||
var r: float = 26.0 * scale_value
|
||||
var skull: Color = BONE
|
||||
# Silueta ancha en la frente y mandibula con dientes individuales.
|
||||
draw_circle(center + Vector2(0, -4 * scale_value), r, Color(0.28, 0.24, 0.29))
|
||||
draw_circle(center + Vector2(0, -5 * scale_value), r - 2.0, skull)
|
||||
draw_rect(Rect2(center + Vector2(-r * 0.56, r * 0.38), Vector2(r * 1.12, r * 0.72)), skull)
|
||||
for side: int in [-1, 1]:
|
||||
var eye: Vector2 = center + Vector2(side * r * 0.43, -r * 0.15)
|
||||
draw_circle(eye, r * 0.30, Color(0.07, 0.06, 0.13))
|
||||
draw_circle(eye, r * 0.12, glow)
|
||||
draw_colored_polygon(PackedVector2Array([
|
||||
center + Vector2(0, r * 0.10),
|
||||
center + Vector2(-r * 0.20, r * 0.46),
|
||||
center + Vector2(r * 0.20, r * 0.46)
|
||||
]), Color(0.12, 0.08, 0.16))
|
||||
for tooth: int in range(4):
|
||||
var xx: float = center.x - r * 0.42 + tooth * r * 0.28
|
||||
draw_line(Vector2(xx, center.y + r * 0.60), Vector2(xx, center.y + r * 1.03), Color(0.35, 0.32, 0.33), maxf(1.0, 2.0 * scale_value))
|
||||
draw_line(center + Vector2(-r * 0.55, -r * 0.70), center + Vector2(-r * 0.12, -r * 0.83), Color.WHITE, maxf(1.0, 2.0 * scale_value))
|
||||
func _update_visuals() -> void:
|
||||
if not is_instance_valid(_left_leaf):
|
||||
return
|
||||
var eased: float = smoothstep(0.0, 1.0, _progress)
|
||||
_left_leaf.position.x = roundf(-40.0 - 74.0 * eased)
|
||||
_right_leaf.position.x = roundf(40.0 + 74.0 * eased)
|
||||
_left_leaf.scale.x = lerpf(1.0, 0.28, eased)
|
||||
_right_leaf.scale.x = lerpf(1.0, 0.28, eased)
|
||||
_seal.modulate.a = 1.0 - minf(eased * 2.0, 1.0)
|
||||
_glow.color = Color(1.0, 0.39, 0.21).lerp(Color(0.37, 0.84, 0.72), eased)
|
||||
_glow.set("base_energy", lerpf(0.24, 0.38, eased))
|
||||
@@ -0,0 +1,65 @@
|
||||
[gd_scene load_steps=10 format=3]
|
||||
|
||||
[ext_resource type="Script" path="res://world/triggers/ossuary_gate_visual.gd" id="script"]
|
||||
[ext_resource type="Texture2D" path="res://assets/ashen/environment/fence.png" id="iron"]
|
||||
[ext_resource type="Texture2D" path="res://assets/ashen/environment/column.png" id="column"]
|
||||
[ext_resource type="Texture2D" path="res://assets/ashen/environment/stone_cap.png" id="stone"]
|
||||
[ext_resource type="Texture2D" path="res://assets/ashen/environment/banner.png" id="seal"]
|
||||
[ext_resource type="Texture2D" path="res://assets/ashen/environment/gate_arch.png" id="arch"]
|
||||
[ext_resource type="PackedScene" path="res://world/props/votive_glow.tscn" id="glow"]
|
||||
|
||||
[sub_resource type="AtlasTexture" id="left_iron"]
|
||||
atlas = ExtResource("iron")
|
||||
region = Rect2(24, 0, 80, 204)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="right_iron"]
|
||||
atlas = ExtResource("iron")
|
||||
region = Rect2(104, 0, 80, 204)
|
||||
|
||||
[node name="OssuaryGateVisual" type="Node2D"]
|
||||
texture_filter = 1
|
||||
script = ExtResource("script")
|
||||
|
||||
[node name="LeftLeaf" type="Sprite2D" parent="."]
|
||||
position = Vector2(-40, 8)
|
||||
texture = SubResource("left_iron")
|
||||
|
||||
[node name="RightLeaf" type="Sprite2D" parent="."]
|
||||
position = Vector2(40, 8)
|
||||
texture = SubResource("right_iron")
|
||||
|
||||
[node name="Seal" type="Sprite2D" parent="."]
|
||||
position = Vector2(0, 8)
|
||||
scale = Vector2(0.375, 0.375)
|
||||
texture = ExtResource("seal")
|
||||
|
||||
[node name="ColumnLeft" type="Sprite2D" parent="."]
|
||||
position = Vector2(-96, -12)
|
||||
scale = Vector2(0.58, 1)
|
||||
texture = ExtResource("column")
|
||||
self_modulate = Color(0.8, 0.75, 0.82, 1)
|
||||
|
||||
[node name="ColumnRight" type="Sprite2D" parent="."]
|
||||
position = Vector2(96, -12)
|
||||
scale = Vector2(0.58, 1)
|
||||
texture = ExtResource("column")
|
||||
flip_h = true
|
||||
self_modulate = Color(0.8, 0.75, 0.82, 1)
|
||||
|
||||
[node name="Arch" type="Sprite2D" parent="."]
|
||||
position = Vector2(0, -132)
|
||||
texture = ExtResource("arch")
|
||||
self_modulate = Color(0.8, 0.75, 0.82, 1)
|
||||
|
||||
[node name="Threshold" type="Sprite2D" parent="."]
|
||||
position = Vector2(-134, 110)
|
||||
texture = ExtResource("stone")
|
||||
centered = false
|
||||
region_enabled = true
|
||||
region_rect = Rect2(0, 0, 268, 16)
|
||||
|
||||
[node name="SealGlow" parent="." instance=ExtResource("glow")]
|
||||
position = Vector2(0, 8)
|
||||
color = Color(1, 0.39, 0.21, 1)
|
||||
texture_scale = 1.5
|
||||
base_energy = 0.24
|
||||
Reference in new issue
Block a user