八音盒基本功能(尚未适配旋转)
BIN
asset/art/lvping_normal.png
Normal file
After Width: | Height: | Size: 6.8 KiB |
BIN
asset/art/neutral_point_light.png
Normal file
After Width: | Height: | Size: 22 KiB |
BIN
asset/art/scene/c02/s03_院子切换/n_院子1楼(黄昏无人).png
Normal file
After Width: | Height: | Size: 591 KiB |
21
asset/art/tool/alpha_converter.gd
Normal file
@ -0,0 +1,21 @@
|
||||
extends Sprite2D
|
||||
|
||||
@export var export_path = ""
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
if texture and export_path:
|
||||
var image = texture.get_image()
|
||||
if image:
|
||||
var converted_image = Image.create_empty(
|
||||
image.get_width(), image.get_height(), false, Image.FORMAT_RGBA8
|
||||
)
|
||||
# convert to transparent BG point light image
|
||||
for y in range(image.get_height()):
|
||||
for x in range(image.get_width()):
|
||||
var color = image.get_pixel(x, y)
|
||||
converted_image.set_pixel(x, y, Color(1.0, 1.0, 1.0, color.r))
|
||||
converted_image.save_png(export_path)
|
||||
print("Exported to: " + export_path)
|
||||
else:
|
||||
print("No image found in texture")
|
10
asset/art/tool/alpha_converter.tscn
Normal file
@ -0,0 +1,10 @@
|
||||
[gd_scene load_steps=3 format=3 uid="uid://bhk8pqkwcgbek"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://t526pexw4ng4" path="res://asset/art/tool/neutral_point_light.webp" id="1_g0k0e"]
|
||||
[ext_resource type="Script" path="res://asset/art/tool/alpha_converter.gd" id="2_fqr7s"]
|
||||
|
||||
[node name="AlphaConverter" type="Sprite2D"]
|
||||
position = Vector2(0, 2)
|
||||
texture = ExtResource("1_g0k0e")
|
||||
script = ExtResource("2_fqr7s")
|
||||
export_path = "res://asset/art/neutral_point_light.png"
|
Before Width: | Height: | Size: 28 KiB After Width: | Height: | Size: 28 KiB |
@ -1,44 +0,0 @@
|
||||
[gd_scene load_steps=7 format=3 uid="uid://611jtxfhccqk"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://mlffyqqogt5n" path="res://assets/worlds/第一章/场景八/单块碎片白.png" id="1_pgqa0"]
|
||||
|
||||
[sub_resource type="Curve" id="Curve_igcm1"]
|
||||
_data = [Vector2(0, 0.956044), 0.0, 0.0, 0, 0, Vector2(0.328947, 0.527472), 2.90961, 2.90961, 0, 0, Vector2(0.72807, 0.340659), 0.0, 0.0, 0, 0, Vector2(1, 1), 0.0, 0.0, 0, 0]
|
||||
point_count = 4
|
||||
|
||||
[sub_resource type="CurveTexture" id="CurveTexture_uoprq"]
|
||||
curve = SubResource("Curve_igcm1")
|
||||
|
||||
[sub_resource type="Curve" id="Curve_sbmii"]
|
||||
_data = [Vector2(0, 1), 0.0, -0.213234, 0, 0, Vector2(0.394872, 0.340659), 0.0, 0.0, 0, 0, Vector2(0.697436, 0.703297), 0.0, 0.0, 0, 0, Vector2(1, 0.131868), 0.0, 0.0, 0, 0]
|
||||
point_count = 4
|
||||
|
||||
[sub_resource type="CurveTexture" id="CurveTexture_1u1hv"]
|
||||
curve = SubResource("Curve_sbmii")
|
||||
|
||||
[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_44bc2"]
|
||||
particle_flag_disable_z = true
|
||||
emission_shape = 3
|
||||
emission_box_extents = Vector3(0, 1, 1)
|
||||
direction = Vector3(-50, -5, 0)
|
||||
spread = 35.0
|
||||
initial_velocity_min = 5.0
|
||||
initial_velocity_max = 10.0
|
||||
angular_velocity_min = -10.0
|
||||
angular_velocity_max = 20.0
|
||||
angular_velocity_curve = SubResource("CurveTexture_uoprq")
|
||||
gravity = Vector3(0, 0, 0)
|
||||
scale_min = 0.1
|
||||
scale_max = 0.5
|
||||
scale_curve = SubResource("CurveTexture_1u1hv")
|
||||
|
||||
[node name="baiselizi" type="GPUParticles2D"]
|
||||
position = Vector2(563, 171)
|
||||
amount = 150
|
||||
process_material = SubResource("ParticleProcessMaterial_44bc2")
|
||||
texture = ExtResource("1_pgqa0")
|
||||
lifetime = 100.0
|
||||
preprocess = 50.0
|
||||
visibility_rect = Rect2(0, -100, -800, 200)
|
||||
trail_sections = 16
|
||||
metadata/_edit_vertical_guides_ = [-721.0]
|
@ -1,86 +0,0 @@
|
||||
// BoTW Toon Shader by NekotoArts
|
||||
// wrote this at 2AM
|
||||
//
|
||||
//
|
||||
//
|
||||
// England is my city
|
||||
// Smoke trees
|
||||
// Two to the One from the One to the Three
|
||||
shader_type spatial;
|
||||
render_mode diffuse_toon, specular_toon;
|
||||
|
||||
uniform vec4 tint: source_color;
|
||||
uniform sampler2D albedo_texture : source_color;
|
||||
uniform float metallic : hint_range(0.0, 1.0) = 0.0;
|
||||
uniform sampler2D normal_map : hint_normal;
|
||||
uniform float shadow_size = 0.045;
|
||||
uniform float shadow_blend = 0.001;
|
||||
uniform float shadow_extra_intensity = 0.0;
|
||||
uniform vec4 shadow_color : source_color;
|
||||
uniform vec4 light_tint : source_color;
|
||||
uniform float rimlight_size = 0.921;
|
||||
uniform float rimlight_blend = 0.01;
|
||||
uniform vec4 rimlight_color : source_color;
|
||||
uniform bool use_normalmap = true;
|
||||
uniform bool animated = true;
|
||||
uniform float time_scale = 0.02;
|
||||
uniform vec3 normal_bias = vec3(0.0);
|
||||
uniform vec3 light_bias = vec3(0.0);
|
||||
uniform bool use_view = true;
|
||||
uniform vec4 view_bias : source_color = vec4(1.0, 0.0, 1.0, 1.0);
|
||||
uniform float view_multiplier : hint_range(-1.0, 1.0) = -1.0;
|
||||
|
||||
float fresnel(float amount, vec3 normal, vec3 view)
|
||||
{
|
||||
return pow((1.0 - clamp(dot(normalize(normal), normalize(view)), 0.0, 1.0 )), amount);
|
||||
}
|
||||
|
||||
varying vec3 vertex_normal;
|
||||
varying vec3 vertex_tangent;
|
||||
|
||||
void vertex(){
|
||||
vertex_normal = NORMAL;
|
||||
vertex_normal = TANGENT;
|
||||
}
|
||||
|
||||
void fragment(){
|
||||
ALBEDO = texture(albedo_texture, UV).rgb * tint.rgb;
|
||||
METALLIC = metallic;
|
||||
}
|
||||
|
||||
void light(){
|
||||
vec3 normal;
|
||||
if (use_normalmap){
|
||||
vec3 normal_from_texture;
|
||||
if (animated){
|
||||
normal_from_texture = texture(normal_map, UV + TIME * time_scale).rgb;
|
||||
}else{
|
||||
normal_from_texture = texture(normal_map, UV).rgb;
|
||||
}
|
||||
normal = vec3(normal_from_texture.x * NORMAL.x,
|
||||
normal_from_texture.y * NORMAL.y, normal_from_texture.z);
|
||||
|
||||
normal = NORMAL - normal_from_texture;
|
||||
}else{
|
||||
normal = NORMAL;
|
||||
}
|
||||
|
||||
if (use_view){
|
||||
normal -= VIEW * view_bias.rgb * view_multiplier;
|
||||
}
|
||||
|
||||
float NdotL = dot(normal + normal_bias, LIGHT + light_bias);
|
||||
|
||||
float rounded = smoothstep(shadow_size, shadow_blend + shadow_size, NdotL);
|
||||
float one_minus = 1.0 - rounded;
|
||||
vec3 mult1 = LIGHT_COLOR * rounded * light_tint.rgb * ATTENUATION;
|
||||
vec3 mult2 = (one_minus * 1.4 * shadow_color.rgb) - shadow_extra_intensity;
|
||||
vec3 add1 = mult1 + mult2;
|
||||
|
||||
float add3 = rimlight_blend + rimlight_size;
|
||||
float basic_fresnel = fresnel(1.0, NORMAL, VIEW);
|
||||
float smoothed = smoothstep(rimlight_size, add3, basic_fresnel);
|
||||
|
||||
vec3 add2 = add1 + smoothed * rimlight_color.rgb;
|
||||
DIFFUSE_LIGHT += ALBEDO * add2;
|
||||
}
|
Before Width: | Height: | Size: 2.0 MiB |
@ -1,54 +0,0 @@
|
||||
[gd_scene load_steps=9 format=3 uid="uid://b3ajpb6miur0s"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://bdfllabmrv7ue" path="res://assets/worlds/第一章/场景八/单块碎片黑.png" id="1_2t4yh"]
|
||||
|
||||
[sub_resource type="Curve" id="Curve_gabfw"]
|
||||
min_value = -360.0
|
||||
max_value = 360.0
|
||||
_data = [Vector2(0, -344.176), 0.0, 0.0, 0, 0, Vector2(0.214912, 360), 0.0, 0.0, 0, 0, Vector2(0.614035, -320.44), 0.0, 0.0, 0, 0, Vector2(0.982456, 360), 0.0, 0.0, 0, 0]
|
||||
point_count = 4
|
||||
|
||||
[sub_resource type="CurveTexture" id="CurveTexture_wrnlh"]
|
||||
curve = SubResource("Curve_gabfw")
|
||||
|
||||
[sub_resource type="Gradient" id="Gradient_rwi0m"]
|
||||
offsets = PackedFloat32Array(0, 0.99, 1)
|
||||
colors = PackedColorArray(1, 1, 1, 0.466667, 1, 1, 1, 0.965333, 1, 1, 1, 1)
|
||||
|
||||
[sub_resource type="GradientTexture1D" id="GradientTexture1D_5cty7"]
|
||||
gradient = SubResource("Gradient_rwi0m")
|
||||
|
||||
[sub_resource type="Curve" id="Curve_8ybmm"]
|
||||
_data = [Vector2(0, 1), 0.0, 0.0, 0, 0, Vector2(0.982456, 0.10989), -1.97802, 0.0, 0, 0]
|
||||
point_count = 2
|
||||
|
||||
[sub_resource type="CurveTexture" id="CurveTexture_jq14j"]
|
||||
curve = SubResource("Curve_8ybmm")
|
||||
|
||||
[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_wa8gc"]
|
||||
particle_flag_disable_z = true
|
||||
emission_shape = 3
|
||||
emission_box_extents = Vector3(0, 1, 1)
|
||||
direction = Vector3(-50, 0, 0)
|
||||
spread = 40.0
|
||||
initial_velocity_min = 5.0
|
||||
initial_velocity_max = 10.0
|
||||
angular_velocity_min = 10.0
|
||||
angular_velocity_max = 30.0
|
||||
angular_velocity_curve = SubResource("CurveTexture_wrnlh")
|
||||
gravity = Vector3(0, 0, 0)
|
||||
scale_min = 0.1
|
||||
scale_max = 0.5
|
||||
scale_curve = SubResource("CurveTexture_jq14j")
|
||||
color_ramp = SubResource("GradientTexture1D_5cty7")
|
||||
|
||||
[node name="heiselizi" type="GPUParticles2D"]
|
||||
position = Vector2(564, 159)
|
||||
amount = 180
|
||||
process_material = SubResource("ParticleProcessMaterial_wa8gc")
|
||||
texture = ExtResource("1_2t4yh")
|
||||
lifetime = 100.0
|
||||
preprocess = 52.0
|
||||
visibility_rect = Rect2(0, -100, -800, 200)
|
||||
trail_enabled = true
|
||||
trail_sections = 16
|
@ -1,44 +0,0 @@
|
||||
[gd_scene load_steps=7 format=3 uid="uid://clfivp8aur278"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://cwgusmrk6t3px" path="res://assets/worlds/第一章/场景八/单块碎片灰.png" id="1_jgu3s"]
|
||||
|
||||
[sub_resource type="Curve" id="Curve_d6251"]
|
||||
_data = [Vector2(0, 1), 0.0, -6.37762, 0, 0, Vector2(0.377193, 0.78022), 0.0, 0.0, 0, 0, Vector2(0.736842, 0.428571), 0.0, 0.0, 0, 0, Vector2(1, 1), 0.0, 0.0, 0, 0]
|
||||
point_count = 4
|
||||
|
||||
[sub_resource type="CurveTexture" id="CurveTexture_kc481"]
|
||||
curve = SubResource("Curve_d6251")
|
||||
|
||||
[sub_resource type="Curve" id="Curve_231os"]
|
||||
_data = [Vector2(0, 1), 0.0, 0.0, 0, 0, Vector2(1, 0), -2.50549, 0.0, 0, 0]
|
||||
point_count = 2
|
||||
|
||||
[sub_resource type="CurveTexture" id="CurveTexture_y7l7i"]
|
||||
curve = SubResource("Curve_231os")
|
||||
|
||||
[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_3xiox"]
|
||||
particle_flag_disable_z = true
|
||||
emission_shape = 3
|
||||
emission_box_extents = Vector3(0, 1, 1)
|
||||
direction = Vector3(-50, 0, 0)
|
||||
spread = 38.0
|
||||
initial_velocity_min = 5.0
|
||||
initial_velocity_max = 10.0
|
||||
angular_velocity_min = -10.0
|
||||
angular_velocity_max = 20.0
|
||||
angular_velocity_curve = SubResource("CurveTexture_kc481")
|
||||
gravity = Vector3(0, 0, 0)
|
||||
scale_min = 0.1
|
||||
scale_max = 0.5
|
||||
scale_curve = SubResource("CurveTexture_y7l7i")
|
||||
|
||||
[node name="dalizi" type="GPUParticles2D"]
|
||||
position = Vector2(465, 162)
|
||||
amount = 200
|
||||
process_material = SubResource("ParticleProcessMaterial_3xiox")
|
||||
texture = ExtResource("1_jgu3s")
|
||||
lifetime = 100.0
|
||||
preprocess = 51.0
|
||||
speed_scale = 1.2
|
||||
visibility_rect = Rect2(0, -100, -800, 200)
|
||||
trail_sections = 16
|
Before Width: | Height: | Size: 2.7 MiB |
Before Width: | Height: | Size: 28 KiB |
@ -2,7 +2,6 @@ extends Control
|
||||
|
||||
@export var path = "res://asset/art/scene/"
|
||||
@export var static_frames = preload("res://config/art/static_sprite_frames.tres")
|
||||
@export var placeholder_texture = preload("res://config/art/placeholder_pic.webp")
|
||||
|
||||
@onready var load_btn = %LoadButton as Button
|
||||
|
||||
@ -16,7 +15,7 @@ func _reload_all():
|
||||
static_frames.clear_all()
|
||||
var dir = DirAccess.open(path) as DirAccess
|
||||
static_frames.add_animation("placeholder")
|
||||
static_frames.add_frame("placeholder", placeholder_texture)
|
||||
# static_frames.add_frame("placeholder", placeholder_texture)
|
||||
for c_dir in dir.get_directories():
|
||||
print("c_dir=", c_dir)
|
||||
var c_path = path + c_dir + "/"
|
||||
|
@ -1,7 +1,6 @@
|
||||
[gd_resource type="SpriteFrames" load_steps=138 format=3 uid="uid://dercgk2rdfig"]
|
||||
[gd_resource type="SpriteFrames" load_steps=137 format=3 uid="uid://dercgk2rdfig"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://diewbtnc2oijl" path="res://asset/art/scene/c01/s01/bg_夜晚有墙.png" id="1_k3ot7"]
|
||||
[ext_resource type="Texture2D" uid="uid://cife3vkg46h4x" path="res://config/art/placeholder_pic.webp" id="1_wsf0p"]
|
||||
[ext_resource type="Texture2D" uid="uid://c388dhpakqyf2" path="res://asset/art/scene/c01/s01/e_老奶奶喂老鼠.png" id="2_eg3uh"]
|
||||
[ext_resource type="Texture2D" uid="uid://dl36n6gnne058" path="res://asset/art/scene/c01/s02/f_序章标题.png" id="3_s15vv"]
|
||||
[ext_resource type="Texture2D" uid="uid://dj4tqeen4wvm4" path="res://asset/art/scene/c01/s02/ux_老鼠吃肉_吃完.png" id="4_mo80j"]
|
||||
@ -1232,12 +1231,4 @@ animations = [{
|
||||
"loop": true,
|
||||
"name": &"default",
|
||||
"speed": 5.0
|
||||
}, {
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": ExtResource("1_wsf0p")
|
||||
}],
|
||||
"loop": true,
|
||||
"name": &"placeholder",
|
||||
"speed": 5.0
|
||||
}]
|
||||
|
@ -9,7 +9,7 @@ func _init() -> void:
|
||||
|
||||
func play_random():
|
||||
if audio_collections == null:
|
||||
push_error("empty audio_collections")
|
||||
push_warning("empty audio_collections")
|
||||
return
|
||||
var audio_collection:=audio_collections.pick_random() as AudioStreamCollection
|
||||
stream = audio_collection.audios.pick_random()
|
||||
|
@ -21,6 +21,8 @@ const FOOTSTEP_AUDIO = {
|
||||
@export_enum("none", "ghost", "walking", "running", "crawling", "concrete")
|
||||
var footstep_type: String = "concrete"
|
||||
@export var bgm := ""
|
||||
# @export_group("Light")
|
||||
# @export var light_color := Color8(0x5e, 0x72, 0xe1, 0xff)
|
||||
|
||||
## ground
|
||||
# @export var foreground_scale: Vector2 = Vector2(1.2, 1.2)
|
||||
|
@ -1,6 +1,6 @@
|
||||
extends Node
|
||||
|
||||
signal archive_loaded()
|
||||
signal archive_loaded
|
||||
|
||||
@export var user_root_dir := "user://data/" # must end with "/"
|
||||
@export var archive_dir := "user://data/archives/"
|
||||
@ -34,11 +34,14 @@ func _ready() -> void:
|
||||
func _notification(what):
|
||||
# handle window close request
|
||||
if what == NOTIFICATION_WM_CLOSE_REQUEST:
|
||||
save_all()
|
||||
print("Saved all success before Quit")
|
||||
SceneManager.pop_notification("已保存所有数据")
|
||||
var tree = get_tree()
|
||||
tree.create_timer(1.5).timeout.connect(tree.quit)
|
||||
if has_node("/root/Main"):
|
||||
save_all()
|
||||
print("Saved all success before Quit")
|
||||
SceneManager.pop_notification("已保存所有数据")
|
||||
var tree = get_tree()
|
||||
tree.create_timer(1.5).timeout.connect(tree.quit)
|
||||
else:
|
||||
get_tree().quit()
|
||||
|
||||
|
||||
func _on_archive_id_changed():
|
||||
|
@ -7,10 +7,11 @@ const DEBUG = true
|
||||
const RES_FILE_FORMAT = ".tres"
|
||||
|
||||
## layers
|
||||
const CANVAS_LAYER_PROP_INSPECTOR = 110
|
||||
const CANVAS_LAYER_UI = 100
|
||||
const CANVAS_LAYER_SHADING = 90
|
||||
const CANVAS_LAYER_FG = 10
|
||||
const CANVAS_LAYER_PROP_INSPECTOR = 12
|
||||
const CANVAS_LAYER_UI = 11
|
||||
const CANVAS_LAYER_SHADING = 10
|
||||
const CANVAS_LAYER_FG = 2
|
||||
const CANVAS_LAYER_HD_ENTITY = 1
|
||||
|
||||
const AUDIO_BUS_SFX = "game_sfx"
|
||||
|
||||
@ -26,4 +27,4 @@ signal auto_save_seconds_changed
|
||||
@export var auto_save_seconds := 60:
|
||||
set(val):
|
||||
auto_save_seconds = val
|
||||
auto_save_seconds_changed.emit()
|
||||
auto_save_seconds_changed.emit()
|
||||
|
@ -141,7 +141,8 @@ locale/translations_pot_files=PackedStringArray("res://asset/dialogue/item_descr
|
||||
2d_physics/layer_1="player"
|
||||
2d_physics/layer_2="wall"
|
||||
2d_physics/layer_3="interactable"
|
||||
2d_physics/layer_4="mouse"
|
||||
2d_physics/layer_4="hud_mouse"
|
||||
2d_physics/layer_5="dragable"
|
||||
|
||||
[rendering]
|
||||
|
||||
|
43
scene/entity/ambient/light.gd
Normal file
@ -0,0 +1,43 @@
|
||||
@tool
|
||||
extends Sprite2D
|
||||
|
||||
@export var mode: Light2D.BlendMode = Light2D.BlendMode.BLEND_MODE_ADD:
|
||||
set(new_val):
|
||||
mode = new_val
|
||||
if not is_node_ready():
|
||||
return
|
||||
_setup()
|
||||
@export_group("Ambient Light", "ambient_light_")
|
||||
@export var ambient_light_scale := 1.0:
|
||||
set(new_val):
|
||||
ambient_light_scale = new_val
|
||||
if not is_node_ready():
|
||||
return
|
||||
_setup()
|
||||
@export var ambient_light_energy := 1.0:
|
||||
set(new_val):
|
||||
ambient_light_energy = new_val
|
||||
if not is_node_ready():
|
||||
return
|
||||
_setup()
|
||||
@export var ambient_light_color := Color8(0xff, 0xff, 0xff, 0xff):
|
||||
set(new_val):
|
||||
ambient_light_color = new_val
|
||||
if not is_node_ready():
|
||||
return
|
||||
_setup()
|
||||
|
||||
@onready var texture_light = %TexturePointLight2D as PointLight2D
|
||||
@onready var natural_light = %NaturalPointLight2D as PointLight2D
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
_setup()
|
||||
|
||||
|
||||
func _setup() -> void:
|
||||
texture_light.texture = texture
|
||||
natural_light.scale = Vector2(ambient_light_scale, ambient_light_scale)
|
||||
natural_light.energy = ambient_light_energy
|
||||
natural_light.color = ambient_light_color
|
||||
natural_light.blend_mode = mode
|
22
scene/entity/ambient/light.tscn
Normal file
@ -0,0 +1,22 @@
|
||||
[gd_scene load_steps=4 format=3 uid="uid://svvlohuicvhf"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://cv26vnjbjeqtq" path="res://asset/art/scene/c02/s06_院子回忆版/e_灯笼调色黄昏.png" id="1_8xsf5"]
|
||||
[ext_resource type="Script" path="res://scene/entity/ambient/light.gd" id="2_uggpe"]
|
||||
[ext_resource type="Texture2D" uid="uid://may55b2uerbw" path="res://asset/art/neutral_point_light.png" id="3_w1x1y"]
|
||||
|
||||
[node name="Light" type="Sprite2D"]
|
||||
texture = ExtResource("1_8xsf5")
|
||||
script = ExtResource("2_uggpe")
|
||||
|
||||
[node name="TexturePointLight2D" type="PointLight2D" parent="."]
|
||||
unique_name_in_owner = true
|
||||
energy = 0.7
|
||||
texture = ExtResource("1_8xsf5")
|
||||
height = 20.0
|
||||
|
||||
[node name="NaturalPointLight2D" type="PointLight2D" parent="."]
|
||||
unique_name_in_owner = true
|
||||
scale = Vector2(1e-05, 1e-05)
|
||||
shadow_color = Color(0, 0, 0, 1)
|
||||
texture = ExtResource("3_w1x1y")
|
||||
height = 40.0
|
@ -2,7 +2,7 @@
|
||||
|
||||
[ext_resource type="Script" path="res://scene/entity/hd_entity.gd" id="1_fp2a8"]
|
||||
[ext_resource type="PackedScene" uid="uid://c85t6stvytvjn" path="res://scene/entity/ux/sfx.tscn" id="2_jmpkt"]
|
||||
[ext_resource type="Texture2D" uid="uid://t526pexw4ng4" path="res://asset/art/neutral_point_light.webp" id="3_oxpta"]
|
||||
[ext_resource type="Texture2D" uid="uid://t526pexw4ng4" path="res://asset/art/tool/neutral_point_light.webp" id="3_oxpta"]
|
||||
[ext_resource type="Texture2D" uid="uid://dvg6wjwn1qxiv" path="res://asset/art/ui/action_mark/探索ui.png" id="4_7tkfj"]
|
||||
[ext_resource type="Script" path="res://scene/entity/ux/sign.gd" id="5_5v6q2"]
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
[ext_resource type="Script" path="res://scene/entity/local_inspectable.gd" id="1_85el0"]
|
||||
[ext_resource type="PackedScene" uid="uid://c85t6stvytvjn" path="res://scene/entity/ux/sfx.tscn" id="2_h0c2s"]
|
||||
[ext_resource type="Texture2D" uid="uid://t526pexw4ng4" path="res://asset/art/neutral_point_light.webp" id="3_o562w"]
|
||||
[ext_resource type="Texture2D" uid="uid://t526pexw4ng4" path="res://asset/art/tool/neutral_point_light.webp" id="3_o562w"]
|
||||
[ext_resource type="Texture2D" uid="uid://dvg6wjwn1qxiv" path="res://asset/art/ui/action_mark/探索ui.png" id="4_bi35o"]
|
||||
[ext_resource type="Script" path="res://scene/entity/ux/sign.gd" id="5_vsfuq"]
|
||||
[ext_resource type="SpriteFrames" uid="uid://c3s8u4ifaucpj" path="res://config/animation/entity_sprite_frames.tres" id="6_e77p4"]
|
||||
|
@ -4,7 +4,7 @@
|
||||
[ext_resource type="Texture2D" uid="uid://dvg6wjwn1qxiv" path="res://asset/art/ui/action_mark/探索ui.png" id="1_eew1k"]
|
||||
[ext_resource type="Script" path="res://scene/entity/ux/sign.gd" id="2_36okt"]
|
||||
[ext_resource type="PackedScene" uid="uid://c85t6stvytvjn" path="res://scene/entity/ux/sfx.tscn" id="2_qocmg"]
|
||||
[ext_resource type="Texture2D" uid="uid://t526pexw4ng4" path="res://asset/art/neutral_point_light.webp" id="3_xb81s"]
|
||||
[ext_resource type="Texture2D" uid="uid://t526pexw4ng4" path="res://asset/art/tool/neutral_point_light.webp" id="3_xb81s"]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_k6och"]
|
||||
resource_local_to_scene = true
|
||||
|
@ -4,7 +4,7 @@
|
||||
[ext_resource type="SpriteFrames" uid="uid://c3s8u4ifaucpj" path="res://config/animation/entity_sprite_frames.tres" id="3_1e8sl"]
|
||||
[ext_resource type="PackedScene" uid="uid://c85t6stvytvjn" path="res://scene/entity/ux/sfx.tscn" id="3_4d53s"]
|
||||
[ext_resource type="Script" path="res://scene/entity/ux/sign.gd" id="3_kgq8p"]
|
||||
[ext_resource type="Texture2D" uid="uid://t526pexw4ng4" path="res://asset/art/neutral_point_light.webp" id="4_jrmg5"]
|
||||
[ext_resource type="Texture2D" uid="uid://t526pexw4ng4" path="res://asset/art/tool/neutral_point_light.webp" id="4_jrmg5"]
|
||||
[ext_resource type="Texture2D" uid="uid://gb3p6ry0bs5x" path="res://asset/art/ui/action_mark/说话标识1.png" id="5_foitt"]
|
||||
[ext_resource type="Texture2D" uid="uid://dsofwe6knklyo" path="res://asset/art/ui/action_mark/说话标识2.png" id="6_2n6ge"]
|
||||
[ext_resource type="Texture2D" uid="uid://blvlw8fgmmu8n" path="res://asset/art/ui/action_mark/说话标识3.png" id="7_afjxr"]
|
||||
|
@ -4,7 +4,7 @@
|
||||
[ext_resource type="Script" path="res://scene/entity/ux/sign.gd" id="2_fcru3"]
|
||||
[ext_resource type="PackedScene" uid="uid://c85t6stvytvjn" path="res://scene/entity/ux/sfx.tscn" id="2_wrnix"]
|
||||
[ext_resource type="Texture2D" uid="uid://dvg6wjwn1qxiv" path="res://asset/art/ui/action_mark/探索ui.png" id="3_s7dto"]
|
||||
[ext_resource type="Texture2D" uid="uid://t526pexw4ng4" path="res://asset/art/neutral_point_light.webp" id="3_vbivp"]
|
||||
[ext_resource type="Texture2D" uid="uid://t526pexw4ng4" path="res://asset/art/tool/neutral_point_light.webp" id="3_vbivp"]
|
||||
[ext_resource type="SpriteFrames" uid="uid://c3s8u4ifaucpj" path="res://config/animation/entity_sprite_frames.tres" id="7_njjhh"]
|
||||
[ext_resource type="Script" path="res://scene/entity/ux/animated_sound_sprite_2d.gd" id="8_wntgt"]
|
||||
|
||||
|
BIN
scene/entity/partical/e_单块碎片灰.png
Normal file
After Width: | Height: | Size: 187 B |
BIN
scene/entity/partical/e_单块碎片白.png
Normal file
After Width: | Height: | Size: 277 B |
BIN
scene/entity/partical/e_单块碎片黑.png
Normal file
After Width: | Height: | Size: 123 B |
139
scene/entity/partical/particals_ash.tscn
Normal file
@ -0,0 +1,139 @@
|
||||
[gd_scene load_steps=21 format=3 uid="uid://b8ncf4d0jda8r"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://035x4sih66al" path="res://scene/entity/partical/e_单块碎片白.png" id="1_lv5jb"]
|
||||
[ext_resource type="Texture2D" uid="uid://blotyc1vq45ut" path="res://scene/entity/partical/e_单块碎片灰.png" id="2_wgqpb"]
|
||||
[ext_resource type="Texture2D" uid="uid://csnamw2r4rgvr" path="res://scene/entity/partical/e_单块碎片黑.png" id="3_abc1v"]
|
||||
|
||||
[sub_resource type="Curve" id="Curve_igcm1"]
|
||||
_data = [Vector2(0, 0.956044), 0.0, 0.0, 0, 0, Vector2(0.328947, 0.527472), 2.90961, 2.90961, 0, 0, Vector2(0.72807, 0.340659), 0.0, 0.0, 0, 0, Vector2(1, 1), 0.0, 0.0, 0, 0]
|
||||
point_count = 4
|
||||
|
||||
[sub_resource type="CurveTexture" id="CurveTexture_uoprq"]
|
||||
curve = SubResource("Curve_igcm1")
|
||||
|
||||
[sub_resource type="Curve" id="Curve_sbmii"]
|
||||
_data = [Vector2(0, 1), 0.0, -0.213234, 0, 0, Vector2(0.394872, 0.340659), 0.0, 0.0, 0, 0, Vector2(0.697436, 0.703297), 0.0, 0.0, 0, 0, Vector2(1, 0.131868), 0.0, 0.0, 0, 0]
|
||||
point_count = 4
|
||||
|
||||
[sub_resource type="CurveTexture" id="CurveTexture_1u1hv"]
|
||||
curve = SubResource("Curve_sbmii")
|
||||
|
||||
[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_44bc2"]
|
||||
particle_flag_disable_z = true
|
||||
emission_shape = 3
|
||||
emission_box_extents = Vector3(-5, 100, 1)
|
||||
direction = Vector3(-50, -2, 0)
|
||||
spread = 35.0
|
||||
initial_velocity_min = 5.0
|
||||
initial_velocity_max = 10.0
|
||||
angular_velocity_min = -10.0
|
||||
angular_velocity_max = 20.0
|
||||
angular_velocity_curve = SubResource("CurveTexture_uoprq")
|
||||
gravity = Vector3(0, 0, 0)
|
||||
scale_min = 0.1
|
||||
scale_max = 0.5
|
||||
scale_curve = SubResource("CurveTexture_1u1hv")
|
||||
|
||||
[sub_resource type="Curve" id="Curve_d6251"]
|
||||
_data = [Vector2(0, 1), 0.0, -6.37762, 0, 0, Vector2(0.377193, 0.78022), 0.0, 0.0, 0, 0, Vector2(0.736842, 0.428571), 0.0, 0.0, 0, 0, Vector2(1, 1), 0.0, 0.0, 0, 0]
|
||||
point_count = 4
|
||||
|
||||
[sub_resource type="CurveTexture" id="CurveTexture_kc481"]
|
||||
curve = SubResource("Curve_d6251")
|
||||
|
||||
[sub_resource type="Curve" id="Curve_231os"]
|
||||
_data = [Vector2(0, 1), 0.0, 0.0, 0, 0, Vector2(1, 0), -2.50549, 0.0, 0, 0]
|
||||
point_count = 2
|
||||
|
||||
[sub_resource type="CurveTexture" id="CurveTexture_y7l7i"]
|
||||
curve = SubResource("Curve_231os")
|
||||
|
||||
[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_3xiox"]
|
||||
particle_flag_disable_z = true
|
||||
emission_shape_scale = Vector3(1, 100, 1)
|
||||
emission_shape = 3
|
||||
emission_box_extents = Vector3(0, 1, 1)
|
||||
direction = Vector3(-50, 0, 0)
|
||||
spread = 38.0
|
||||
initial_velocity_min = 5.0
|
||||
initial_velocity_max = 10.0
|
||||
angular_velocity_min = -10.0
|
||||
angular_velocity_max = 20.0
|
||||
angular_velocity_curve = SubResource("CurveTexture_kc481")
|
||||
gravity = Vector3(0, 0, 0)
|
||||
scale_min = 0.1
|
||||
scale_max = 0.5
|
||||
scale_curve = SubResource("CurveTexture_y7l7i")
|
||||
|
||||
[sub_resource type="Curve" id="Curve_gabfw"]
|
||||
min_value = -360.0
|
||||
max_value = 360.0
|
||||
_data = [Vector2(0, -344.176), 0.0, 0.0, 0, 0, Vector2(0.214912, 360), 0.0, 0.0, 0, 0, Vector2(0.614035, -320.44), 0.0, 0.0, 0, 0, Vector2(0.982456, 360), 0.0, 0.0, 0, 0]
|
||||
point_count = 4
|
||||
|
||||
[sub_resource type="CurveTexture" id="CurveTexture_wrnlh"]
|
||||
curve = SubResource("Curve_gabfw")
|
||||
|
||||
[sub_resource type="Gradient" id="Gradient_rwi0m"]
|
||||
offsets = PackedFloat32Array(0, 0.99, 1)
|
||||
colors = PackedColorArray(1, 1, 1, 0.466667, 1, 1, 1, 0.965333, 1, 1, 1, 1)
|
||||
|
||||
[sub_resource type="GradientTexture1D" id="GradientTexture1D_5cty7"]
|
||||
gradient = SubResource("Gradient_rwi0m")
|
||||
|
||||
[sub_resource type="Curve" id="Curve_8ybmm"]
|
||||
_data = [Vector2(0, 1), 0.0, 0.0, 0, 0, Vector2(0.982456, 0.10989), -1.97802, 0.0, 0, 0]
|
||||
point_count = 2
|
||||
|
||||
[sub_resource type="CurveTexture" id="CurveTexture_jq14j"]
|
||||
curve = SubResource("Curve_8ybmm")
|
||||
|
||||
[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_wa8gc"]
|
||||
particle_flag_disable_z = true
|
||||
emission_shape_scale = Vector3(1, 100, 1)
|
||||
emission_shape = 3
|
||||
emission_box_extents = Vector3(0, 1, 1)
|
||||
direction = Vector3(-50, 0, 0)
|
||||
spread = 40.0
|
||||
initial_velocity_min = 5.0
|
||||
initial_velocity_max = 10.0
|
||||
angular_velocity_min = 10.0
|
||||
angular_velocity_max = 30.0
|
||||
angular_velocity_curve = SubResource("CurveTexture_wrnlh")
|
||||
gravity = Vector3(0, 0, 0)
|
||||
scale_min = 0.1
|
||||
scale_max = 0.5
|
||||
scale_curve = SubResource("CurveTexture_jq14j")
|
||||
color_ramp = SubResource("GradientTexture1D_5cty7")
|
||||
|
||||
[node name="ParticalsAsh" type="Node2D"]
|
||||
|
||||
[node name="white" type="GPUParticles2D" parent="."]
|
||||
amount = 150
|
||||
process_material = SubResource("ParticleProcessMaterial_44bc2")
|
||||
texture = ExtResource("1_lv5jb")
|
||||
lifetime = 100.0
|
||||
preprocess = 50.0
|
||||
visibility_rect = Rect2(0, -130, -1500, 260)
|
||||
trail_sections = 16
|
||||
metadata/_edit_vertical_guides_ = [-721.0]
|
||||
|
||||
[node name="grey" type="GPUParticles2D" parent="."]
|
||||
amount = 200
|
||||
process_material = SubResource("ParticleProcessMaterial_3xiox")
|
||||
texture = ExtResource("2_wgqpb")
|
||||
lifetime = 100.0
|
||||
preprocess = 51.0
|
||||
speed_scale = 1.2
|
||||
visibility_rect = Rect2(0, -130, -1500, 260)
|
||||
trail_sections = 16
|
||||
|
||||
[node name="black" type="GPUParticles2D" parent="."]
|
||||
amount = 180
|
||||
process_material = SubResource("ParticleProcessMaterial_wa8gc")
|
||||
texture = ExtResource("3_abc1v")
|
||||
lifetime = 100.0
|
||||
preprocess = 52.0
|
||||
visibility_rect = Rect2(0, -130, -1500, 260)
|
||||
trail_enabled = true
|
||||
trail_sections = 16
|
@ -4,7 +4,7 @@
|
||||
[ext_resource type="PackedScene" uid="uid://c85t6stvytvjn" path="res://scene/entity/ux/sfx.tscn" id="2_8s5wk"]
|
||||
[ext_resource type="Texture2D" uid="uid://dvg6wjwn1qxiv" path="res://asset/art/ui/action_mark/探索ui.png" id="2_bggcm"]
|
||||
[ext_resource type="Script" path="res://scene/entity/ux/sign.gd" id="3_hpbqf"]
|
||||
[ext_resource type="Texture2D" uid="uid://t526pexw4ng4" path="res://asset/art/neutral_point_light.webp" id="5_yhysn"]
|
||||
[ext_resource type="Texture2D" uid="uid://t526pexw4ng4" path="res://asset/art/tool/neutral_point_light.webp" id="5_yhysn"]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_k6och"]
|
||||
resource_local_to_scene = true
|
||||
|
@ -22,6 +22,7 @@ func _ready() -> void:
|
||||
|
||||
func _reload_sfx():
|
||||
if file and dir:
|
||||
print("reload sfx", sfx_root_path + dir + "/" + file)
|
||||
sfx = load(sfx_root_path + dir + "/" + file) as AudioStream
|
||||
else:
|
||||
sfx = null
|
||||
@ -79,7 +80,7 @@ func _set(property: StringName, value: Variant) -> bool:
|
||||
if property == &"file":
|
||||
file = value
|
||||
_reload_sfx()
|
||||
notify_property_list_changed()
|
||||
# notify_property_list_changed()
|
||||
return true
|
||||
return false
|
||||
|
||||
|
24
scene/ground/environment.tres
Normal file
@ -0,0 +1,24 @@
|
||||
[gd_resource type="Environment" load_steps=3 format=3 uid="uid://c6ri8tn5qt6fe"]
|
||||
|
||||
[sub_resource type="Gradient" id="Gradient_lavi0"]
|
||||
|
||||
[sub_resource type="GradientTexture1D" id="GradientTexture1D_2vv87"]
|
||||
gradient = SubResource("Gradient_lavi0")
|
||||
|
||||
[resource]
|
||||
background_mode = 3
|
||||
background_color = Color(1, 1, 1, 1)
|
||||
background_canvas_max_layer = 10
|
||||
ssr_fade_in = 0.344611
|
||||
ssr_fade_out = 1.6245
|
||||
glow_enabled = true
|
||||
glow_strength = 0.6
|
||||
glow_bloom = 0.08
|
||||
glow_blend_mode = 1
|
||||
glow_hdr_threshold = 0.1
|
||||
fog_light_color = Color(0.330344, 0.359666, 0.405758, 1)
|
||||
fog_light_energy = 2.0
|
||||
fog_sun_scatter = 1.0
|
||||
fog_depth_curve = 0.466516
|
||||
adjustment_enabled = true
|
||||
adjustment_color_correction = SubResource("GradientTexture1D_2vv87")
|
@ -1,30 +1,36 @@
|
||||
@tool
|
||||
class_name Ground2D extends Node2D
|
||||
|
||||
@export var scene_config: SceneConfig
|
||||
@export var reload := false:
|
||||
set(new_val):
|
||||
reload = false
|
||||
load_config()
|
||||
|
||||
@onready var directional_light := %DirectionalLight2D as DirectionalLight2D
|
||||
@onready var foreground = %ParallaxForeground as ParallaxBackground
|
||||
|
||||
var footstep_audio = RandomAudioStreamPlayer.new()
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
foreground.layer = GlobalConfig.CANVAS_LAYER_FG
|
||||
# %ColorRectTop.visible = true
|
||||
# %ColorRectBottom.visible = true
|
||||
add_child(footstep_audio)
|
||||
reload()
|
||||
load_config()
|
||||
|
||||
|
||||
func reload():
|
||||
func load_config():
|
||||
if not scene_config:
|
||||
footstep_audio.audio_collections.clear()
|
||||
return
|
||||
var type = scene_config.footstep_type
|
||||
if type == "none":
|
||||
return
|
||||
# foot step sound
|
||||
footstep_audio.audio_collections.clear()
|
||||
var audio = SceneConfig.FOOTSTEP_AUDIO[type] as AudioStreamCollection
|
||||
footstep_audio.audio_collections.append(audio)
|
||||
if type != "none":
|
||||
var audio = SceneConfig.FOOTSTEP_AUDIO[type] as AudioStreamCollection
|
||||
footstep_audio.audio_collections.append(audio)
|
||||
# light color
|
||||
# directional_light.color = scene_config.light_color
|
||||
|
||||
|
||||
func play_footstep_sound() -> void:
|
||||
|
@ -2,7 +2,6 @@
|
||||
|
||||
[ext_resource type="Script" path="res://scene/ground/ground.gd" id="1_0vrlo"]
|
||||
[ext_resource type="Script" path="res://config/deploy/scene_config.gd" id="2_bx7rv"]
|
||||
[ext_resource type="Texture2D" uid="uid://cjyk6lbbdxiwf" path="res://asset/art/scene/c02/s06_院子回忆版/bg_院子1楼(黄昏有人).png" id="3_amw1x"]
|
||||
[ext_resource type="Texture2D" uid="uid://by8h2yuqve7fw" path="res://asset/art/scene/c02/s06_院子回忆版/fg_有人.png" id="5_i5hii"]
|
||||
|
||||
[sub_resource type="Resource" id="Resource_6ux50"]
|
||||
@ -13,22 +12,30 @@ player_y = 45
|
||||
footstep_type = "concrete"
|
||||
bgm = ""
|
||||
|
||||
[sub_resource type="GDScript" id="GDScript_qxugl"]
|
||||
script/source = "extends CanvasLayer
|
||||
|
||||
func _ready() -> void:
|
||||
layer = GlobalConfig.CANVAS_LAYER_HD_ENTITY
|
||||
"
|
||||
|
||||
[node name="Ground" type="Node2D"]
|
||||
script = ExtResource("1_0vrlo")
|
||||
scene_config = SubResource("Resource_6ux50")
|
||||
|
||||
[node name="BGSprite2D" type="Sprite2D" parent="."]
|
||||
unique_name_in_owner = true
|
||||
texture = ExtResource("3_amw1x")
|
||||
centered = false
|
||||
offset = Vector2(0, -119)
|
||||
|
||||
[node name="DeployLayer" type="Node2D" parent="."]
|
||||
unique_name_in_owner = true
|
||||
|
||||
[node name="AmbientLayer" type="Node2D" parent="."]
|
||||
|
||||
[node name="ParallaxForeground" type="ParallaxBackground" parent="."]
|
||||
unique_name_in_owner = true
|
||||
layer = 10
|
||||
layer = 2
|
||||
|
||||
[node name="BGParallaxLayer" type="ParallaxLayer" parent="ParallaxForeground"]
|
||||
|
||||
@ -54,3 +61,12 @@ size = Vector2i(2256, 1268)
|
||||
render_target_update_mode = 4
|
||||
|
||||
[node name="HdLayer" type="CanvasLayer" parent="SubViewportContainer/SubViewport"]
|
||||
script = SubResource("GDScript_qxugl")
|
||||
|
||||
[node name="DirectionalLight2D" type="DirectionalLight2D" parent="."]
|
||||
unique_name_in_owner = true
|
||||
blend_mode = 2
|
||||
range_layer_max = 2
|
||||
shadow_enabled = true
|
||||
shadow_color = Color(0.333333, 0.333333, 0.333333, 0.34902)
|
||||
height = 0.5
|
||||
|
@ -1,9 +1,17 @@
|
||||
@tool
|
||||
class_name GroundLoader extends Node2D
|
||||
|
||||
@export_group("Scene")
|
||||
@export var ignore_archive := false
|
||||
@export var current_scene := "c02_s01"
|
||||
@export var entrance_portal := "left"
|
||||
@export var debug_reload := false:
|
||||
set(new_val):
|
||||
debug_reload = false
|
||||
if current_scene and entrance_portal:
|
||||
transition_to_scene(current_scene, entrance_portal, true)
|
||||
@export var archive_scene := ""
|
||||
@export var archive_portal := ""
|
||||
|
||||
var ground: Ground2D
|
||||
|
||||
@ -13,10 +21,14 @@ var ground_dict = {}
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
if not ignore_archive:
|
||||
_load_save()
|
||||
_read_grounds()
|
||||
ground = get_node_or_null("Ground")
|
||||
# load save
|
||||
if not ignore_archive:
|
||||
_load_save()
|
||||
if archive_scene and archive_portal:
|
||||
current_scene = archive_scene
|
||||
entrance_portal = archive_portal
|
||||
if current_scene and entrance_portal:
|
||||
transition_to_scene(current_scene, entrance_portal, true)
|
||||
elif ground:
|
||||
@ -27,9 +39,9 @@ func _ready() -> void:
|
||||
func _load_save():
|
||||
if not Engine.is_editor_hint() and ArchiveManager.archive:
|
||||
if ArchiveManager.archive.current_scene:
|
||||
current_scene = ArchiveManager.archive.current_scene
|
||||
archive_scene = ArchiveManager.archive.current_scene
|
||||
if ArchiveManager.archive.entrance_portal:
|
||||
entrance_portal = ArchiveManager.archive.entrance_portal
|
||||
archive_portal = ArchiveManager.archive.entrance_portal
|
||||
|
||||
|
||||
func _read_grounds():
|
||||
@ -47,13 +59,13 @@ func play_footstep_sound() -> void:
|
||||
ground.play_footstep_sound()
|
||||
|
||||
|
||||
func transition_to_scene(key: String, portal: String, load_save := false) -> void:
|
||||
func transition_to_scene(key: String, portal: String, immediately := false) -> void:
|
||||
var scene_path = ground_dict[key]
|
||||
if scene_path:
|
||||
var scene = load(scene_path).instantiate()
|
||||
current_scene = key
|
||||
entrance_portal = portal
|
||||
if load_save:
|
||||
if immediately:
|
||||
_do_transition(scene)
|
||||
# 更新玩家位置
|
||||
_update_player_position()
|
||||
@ -119,6 +131,8 @@ func _update_archive():
|
||||
if not Engine.is_editor_hint() and ArchiveManager.archive:
|
||||
ArchiveManager.archive.current_scene = current_scene
|
||||
ArchiveManager.archive.entrance_portal = entrance_portal
|
||||
archive_scene = current_scene
|
||||
archive_portal = entrance_portal
|
||||
|
||||
|
||||
var update_watcher: Timer
|
||||
|
@ -1,15 +1,18 @@
|
||||
[gd_scene load_steps=13 format=3 uid="uid://djc2uaefhmu7"]
|
||||
[gd_scene load_steps=17 format=3 uid="uid://djc2uaefhmu7"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://dayyx4jerj7io" path="res://scene/ground/ground.tscn" id="1_lheeb"]
|
||||
[ext_resource type="Texture2D" uid="uid://loyaw4wke6em" path="res://asset/art/scene/c02/s04_院子现实版/e_铁门栏杆背景部分.png" id="2_221ny"]
|
||||
[ext_resource type="PackedScene" uid="uid://0sofmhrl358m" path="res://scene/entity/npc.tscn" id="2_r5smg"]
|
||||
[ext_resource type="Script" path="res://config/deploy/scene_config.gd" id="2_uifea"]
|
||||
[ext_resource type="PackedScene" uid="uid://jr1yd46wm5je" path="res://scene/entity/note.tscn" id="3_6x7xl"]
|
||||
[ext_resource type="Texture2D" uid="uid://bb3f72fla7mvs" path="res://asset/art/scene/c02/s03_院子切换/bg_院子1楼(黄昏无人).png" id="3_78bcp"]
|
||||
[ext_resource type="PackedScene" uid="uid://61pis75a8fdq" path="res://scene/entity/portal.tscn" id="4_gvtrn"]
|
||||
[ext_resource type="Texture2D" uid="uid://dqsl8rcues8hs" path="res://asset/art/scene/c02/s03_院子切换/n_院子1楼(黄昏无人).png" id="4_nef6w"]
|
||||
[ext_resource type="PackedScene" uid="uid://wyj4qdjyn4ql" path="res://scene/entity/old/inspectable.tscn" id="5_0xh53"]
|
||||
[ext_resource type="PackedScene" uid="uid://bnf3lkcbpx1ar" path="res://scene/entity/ambush.tscn" id="6_gg4jv"]
|
||||
[ext_resource type="Texture2D" uid="uid://0yip10ue5r4x" path="res://asset/art/scene/c02/s04_院子现实版/fg_楼梯.png" id="7_icddm"]
|
||||
[ext_resource type="PackedScene" uid="uid://cw3q5pvciumil" path="res://scene/entity/interactable.tscn" id="8_vdelk"]
|
||||
[ext_resource type="PackedScene" uid="uid://svvlohuicvhf" path="res://scene/entity/ambient/light.tscn" id="10_uxbu3"]
|
||||
[ext_resource type="PackedScene" uid="uid://b8ncf4d0jda8r" path="res://scene/entity/partical/particals_ash.tscn" id="13_kq517"]
|
||||
|
||||
[sub_resource type="Resource" id="Resource_vdo00"]
|
||||
resource_local_to_scene = true
|
||||
@ -19,6 +22,10 @@ player_y = 45
|
||||
footstep_type = "concrete"
|
||||
bgm = ""
|
||||
|
||||
[sub_resource type="CanvasTexture" id="CanvasTexture_41q0k"]
|
||||
diffuse_texture = ExtResource("3_78bcp")
|
||||
normal_texture = ExtResource("4_nef6w")
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_ik5u6"]
|
||||
resource_local_to_scene = true
|
||||
size = Vector2(45, 130)
|
||||
@ -28,9 +35,8 @@ size = Vector2(45, 130)
|
||||
[node name="Ground" parent="." instance=ExtResource("1_lheeb")]
|
||||
scene_config = SubResource("Resource_vdo00")
|
||||
|
||||
[node name="Sprite2D" type="Sprite2D" parent="Ground/BGSprite2D" index="0"]
|
||||
position = Vector2(1072, 22)
|
||||
texture = ExtResource("2_221ny")
|
||||
[node name="BGSprite2D" parent="Ground" index="0"]
|
||||
texture = SubResource("CanvasTexture_41q0k")
|
||||
|
||||
[node name="Npc" parent="Ground/DeployLayer" index="0" instance=ExtResource("2_r5smg")]
|
||||
position = Vector2(465, 23)
|
||||
@ -69,6 +75,17 @@ hook_cg = "c02_胖子说话"
|
||||
[node name="Interactable" parent="Ground/DeployLayer" index="6" instance=ExtResource("8_vdelk")]
|
||||
position = Vector2(1072, 22)
|
||||
|
||||
[node name="灯笼" parent="Ground/AmbientLayer" index="0" instance=ExtResource("10_uxbu3")]
|
||||
position = Vector2(845, -25)
|
||||
ambient_light_scale = 2.0
|
||||
ambient_light_energy = 2.0
|
||||
|
||||
[node name="ParticalsAsh" parent="Ground/AmbientLayer" index="1" instance=ExtResource("13_kq517")]
|
||||
position = Vector2(1120, 5)
|
||||
|
||||
[node name="BGParallaxLayer" parent="Ground/ParallaxForeground" index="0"]
|
||||
use_parent_material = true
|
||||
|
||||
[node name="楼梯" type="Sprite2D" parent="Ground/ParallaxForeground/BGParallaxLayer" index="0"]
|
||||
position = Vector2(1250, 2)
|
||||
scale = Vector2(1.05, 1.05)
|
||||
@ -78,5 +95,8 @@ texture = ExtResource("7_icddm")
|
||||
position = Vector2(-12, -143)
|
||||
scale = Vector2(1.08, 1.08)
|
||||
|
||||
[node name="DirectionalLight2D" parent="Ground" index="5"]
|
||||
color = Color(0.368627, 0.447059, 0.882353, 1)
|
||||
|
||||
[editable path="Ground"]
|
||||
[editable path="Ground/DeployLayer/Portal"]
|
||||
|
151
scene/little_game/八音盒.gd
Normal file
@ -0,0 +1,151 @@
|
||||
extends Sprite2D
|
||||
|
||||
# answer for the puzzle, by columns
|
||||
@export var current_answer := [0, 0, 0, 0, 0, 0, 0, 0, 0]
|
||||
@export_enum("closed", "opened", "playing", "finished") var mode := "closed"
|
||||
|
||||
@export var answer := [1, 0, 0, 0, 0, 0, 0, 0, 0]
|
||||
# @export var answer := [1, 4, 3, 1, 3, 6, 4, 3, 2]
|
||||
|
||||
@onready var points_polygon = $ButtonPositionPoints as Polygon2D
|
||||
@onready var box = $Box as Sprite2D
|
||||
@onready var side_handle = $SideHandle as AnimatedSprite2D
|
||||
@onready var inside_handle = $Handle as TextureButton
|
||||
@onready var audio_player = $MusicPlayer2D as AudioStreamPlayer2D
|
||||
|
||||
var button_texture = preload("res://asset/art/little_game/八音盒/小猫.png")
|
||||
var button_highlight_texture = preload("res://asset/art/little_game/八音盒/小猫高亮.png")
|
||||
|
||||
var box_closed_texture = preload("res://asset/art/little_game/八音盒/无按钮.png")
|
||||
var box_opened_texture = preload("res://asset/art/little_game/八音盒/打开盒子.png")
|
||||
var box_finished_texture = preload("res://asset/art/little_game/八音盒/有按钮.png")
|
||||
|
||||
var sfx_interact = preload("res://asset/audio/sfx/game/八音盒/八音盒互动.mp3") as AudioStream
|
||||
var sfx_drag = preload("res://asset/audio/sfx/game/八音盒/拖动放置.mp3") as AudioStream
|
||||
var sfx_open = preload("res://asset/audio/sfx/game/八音盒/八音盒打开.mp3") as AudioStream
|
||||
var sfx_close = preload("res://asset/audio/sfx/game/八音盒/关盖子.mp3") as AudioStream
|
||||
var sfx_exit = preload("res://asset/audio/sfx/game/八音盒/退出界面.mp3") as AudioStream
|
||||
|
||||
var audio_manual = preload("res://asset/audio/sfx/game/八音盒/操纵八音盒.mp3") as AudioStream
|
||||
var audio_auto = preload("res://asset/audio/sfx/game/八音盒/自走八音盒.mp3") as AudioStream
|
||||
|
||||
var dragging = false
|
||||
|
||||
var current_selected_btn := 0:
|
||||
set(value):
|
||||
if has_node("button_root"):
|
||||
# set previous button to normal
|
||||
var root = get_node("button_root")
|
||||
root.get_node(str(current_selected_btn)).texture = button_texture
|
||||
# set current button to highlight
|
||||
root.get_node(str(value)).texture = button_highlight_texture
|
||||
current_selected_btn = value
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
_chechout_mode()
|
||||
inside_handle.pressed.connect(_on_handle_pressed)
|
||||
|
||||
|
||||
func _chechout_mode(play_sfx := false) -> void:
|
||||
$Handle.visible = mode == "opened"
|
||||
$SideHandle.visible = mode == "playing" or mode == "finished"
|
||||
_reset_buttons()
|
||||
match mode:
|
||||
"closed":
|
||||
audio_player.stream = sfx_interact
|
||||
audio_player.play()
|
||||
box.texture = box_closed_texture
|
||||
_reset_buttons()
|
||||
audio_player.stream = sfx_drag
|
||||
"opened":
|
||||
if play_sfx:
|
||||
audio_player.stream = sfx_open
|
||||
audio_player.play()
|
||||
box.texture = box_opened_texture
|
||||
"playing":
|
||||
audio_player.stream = sfx_drag
|
||||
box.texture = box_opened_texture
|
||||
"finished":
|
||||
if play_sfx:
|
||||
audio_player.stream = sfx_close
|
||||
audio_player.play()
|
||||
box.texture = box_finished_texture
|
||||
|
||||
|
||||
func _reset_buttons():
|
||||
if mode != "closed":
|
||||
if has_node("button_root"):
|
||||
get_node("button_root").visible = false
|
||||
return
|
||||
# create buttons if not exists
|
||||
if not has_node("button_root"):
|
||||
var root = Node2D.new()
|
||||
root.name = "button_root"
|
||||
add_child(root)
|
||||
for i in range(9):
|
||||
var button = Sprite2D.new()
|
||||
button.name = str(i)
|
||||
root.add_child(button)
|
||||
# reset buttons' position and texture
|
||||
for i in range(9):
|
||||
var button = get_node("button_root" + "/" + str(i))
|
||||
if i == current_selected_btn:
|
||||
button.texture = button_highlight_texture
|
||||
else:
|
||||
button.texture = button_texture
|
||||
# load current_answer
|
||||
button.position = _get_position(i, current_answer[i])
|
||||
|
||||
|
||||
# 自动计算的位置会有偏差,使用 polygon 的点进行标记
|
||||
# row rom bottom to top, 7 rows in total
|
||||
# col from left to right, 9 cols in total
|
||||
func _get_position(col: int, row: int) -> Vector2:
|
||||
# var col_gap = col_gap_down + (col_gap_up - col_gap_down) * row / 6
|
||||
# return Vector2(origin_position.x + col_gap * col, origin_position.y - row_gap * row)
|
||||
var index = col + row * 9
|
||||
if points_polygon.polygon and index < points_polygon.polygon.size():
|
||||
return points_polygon.polygon[index]
|
||||
else:
|
||||
return Vector2(0, 0)
|
||||
|
||||
|
||||
# 1 up 2 down
|
||||
func _move_button(delta: int) -> void:
|
||||
if mode != "closed":
|
||||
return
|
||||
var current_row = current_answer[current_selected_btn]
|
||||
var target_row = clampi(current_answer[current_selected_btn] + delta, 0, 6)
|
||||
current_answer[current_selected_btn] = target_row
|
||||
# tween if not in correct position
|
||||
if current_row != target_row:
|
||||
var target_position = _get_position(current_selected_btn, target_row)
|
||||
var node = get_node("button_root/" + str(current_selected_btn))
|
||||
create_tween().tween_property(node, "position", target_position, .5)
|
||||
# play sfx
|
||||
audio_player.stream = sfx_drag
|
||||
audio_player.play()
|
||||
# check if all buttons are in correct position
|
||||
if current_answer == answer:
|
||||
mode = "opened"
|
||||
_chechout_mode(true)
|
||||
|
||||
|
||||
func _unhandled_input(event: InputEvent) -> void:
|
||||
if mode == "closed":
|
||||
# move button
|
||||
if event.is_action_pressed("up"):
|
||||
_move_button(1)
|
||||
elif event.is_action_pressed("down"):
|
||||
_move_button(-1)
|
||||
elif event.is_action_pressed("left"):
|
||||
current_selected_btn = clampi(current_selected_btn - 1, 0, 8)
|
||||
elif event.is_action_pressed("right"):
|
||||
current_selected_btn = clampi(current_selected_btn + 1, 0, 8)
|
||||
|
||||
|
||||
func _on_handle_pressed() -> void:
|
||||
if mode == "opened":
|
||||
mode = "playing"
|
||||
_chechout_mode(true)
|
109
scene/little_game/八音盒.tscn
Normal file
@ -6,6 +6,8 @@ extends Node2D
|
||||
_load_scene_config()
|
||||
|
||||
func _ready() -> void:
|
||||
if GlobalConfig.DEBUG:
|
||||
get_window().always_on_top = true
|
||||
$UILayer.layer = GlobalConfig.CANVAS_LAYER_UI
|
||||
_load_scene_config()
|
||||
|
||||
|
@ -7,22 +7,18 @@
|
||||
[ext_resource type="PackedScene" uid="uid://5g07x6q7wwr1" path="res://scene/notification/notification.tscn" id="5_3gg5t"]
|
||||
[ext_resource type="PackedScene" uid="uid://cekhj65axie0p" path="res://scene/popup/prop_inspector.tscn" id="5_ux0rw"]
|
||||
[ext_resource type="PackedScene" uid="uid://cjhw5ecygrqty" path="res://scene/player/main_player.tscn" id="6_6geb0"]
|
||||
[ext_resource type="Environment" uid="uid://c6ri8tn5qt6fe" path="res://scene/ground/environment.tres" id="9_jsof5"]
|
||||
[ext_resource type="PackedScene" uid="uid://clxgkj80yin2" path="res://scene/ground/ground_loader.tscn" id="10_8rc5n"]
|
||||
|
||||
[sub_resource type="Environment" id="Environment_5qls2"]
|
||||
background_mode = 3
|
||||
background_color = Color(1, 1, 1, 1)
|
||||
ambient_light_color = Color(0.470076, 0.470076, 0.470076, 1)
|
||||
ambient_light_energy = 10.0
|
||||
glow_enabled = true
|
||||
glow_blend_mode = 1
|
||||
glow_hdr_threshold = 0.0
|
||||
|
||||
[node name="Main" type="Node2D"]
|
||||
script = ExtResource("1_pks84")
|
||||
|
||||
[node name="WorldEnvironment" type="WorldEnvironment" parent="."]
|
||||
environment = ExtResource("9_jsof5")
|
||||
|
||||
[node name="GroundLoader" parent="." instance=ExtResource("10_8rc5n")]
|
||||
position = Vector2(1, 0)
|
||||
current_scene = "c02_s03"
|
||||
|
||||
[node name="MainPlayer" parent="." instance=ExtResource("6_6geb0")]
|
||||
unique_name_in_owner = true
|
||||
@ -30,10 +26,9 @@ position = Vector2(80, 42)
|
||||
scale = Vector2(0.6, 0.6)
|
||||
|
||||
[node name="ShadingLayer" parent="." instance=ExtResource("2_d1re1")]
|
||||
visible = false
|
||||
|
||||
[node name="UILayer" type="CanvasLayer" parent="."]
|
||||
layer = 100
|
||||
layer = 11
|
||||
|
||||
[node name="ColorRectTop" type="ColorRect" parent="UILayer"]
|
||||
custom_minimum_size = Vector2(564, 38.5)
|
||||
@ -78,10 +73,3 @@ metadata/_edit_use_anchors_ = true
|
||||
|
||||
[node name="PropInspector" parent="." instance=ExtResource("5_ux0rw")]
|
||||
unique_name_in_owner = true
|
||||
|
||||
[node name="WorldEnvironment" type="WorldEnvironment" parent="."]
|
||||
environment = SubResource("Environment_5qls2")
|
||||
|
||||
[node name="DirectionalLight2D" type="DirectionalLight2D" parent="WorldEnvironment"]
|
||||
visible = false
|
||||
color = Color(0.242105, 0.549533, 0.590841, 1)
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
[ext_resource type="Script" path="res://scene/player/main_player.gd" id="1_3a78y"]
|
||||
[ext_resource type="SpriteFrames" uid="uid://c3s8u4ifaucpj" path="res://config/animation/entity_sprite_frames.tres" id="2_3w63u"]
|
||||
[ext_resource type="Texture2D" uid="uid://t526pexw4ng4" path="res://asset/art/neutral_point_light.webp" id="3_scilj"]
|
||||
[ext_resource type="Texture2D" uid="uid://may55b2uerbw" path="res://asset/art/neutral_point_light.png" id="3_h4uja"]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_fno82"]
|
||||
size = Vector2(78.25, 205.062)
|
||||
@ -23,10 +23,9 @@ animation = &"idle_r"
|
||||
shape = SubResource("RectangleShape2D_fno82")
|
||||
|
||||
[node name="PointLight2D" type="PointLight2D" parent="."]
|
||||
visible = false
|
||||
position = Vector2(-2, -29)
|
||||
position = Vector2(1, -44)
|
||||
scale = Vector2(0.810547, 0.849609)
|
||||
energy = 0.4
|
||||
texture = ExtResource("3_scilj")
|
||||
texture_scale = 1.5
|
||||
height = 50.0
|
||||
energy = 0.7
|
||||
texture = ExtResource("3_h4uja")
|
||||
texture_scale = 2.5
|
||||
height = 20.0
|
||||
|
@ -8,7 +8,7 @@ line_spacing = 1.0
|
||||
font_size = 11
|
||||
|
||||
[node name="PropInspector" type="CanvasLayer"]
|
||||
layer = 110
|
||||
layer = 12
|
||||
script = ExtResource("1_2wpwe")
|
||||
|
||||
[node name="TextureRect" type="TextureRect" parent="."]
|
||||
|
@ -4,7 +4,7 @@
|
||||
[ext_resource type="Shader" path="res://asset/shader/vignette.gdshader" id="1_akp6k"]
|
||||
[ext_resource type="Texture2D" uid="uid://kc4726andgy2" path="res://asset/art/scene/c02/s01_街道/bg_公寓入口.png" id="2_r3a31"]
|
||||
[ext_resource type="Shader" path="res://asset/shader/glitcheffect.gdshader" id="3_qjv5u"]
|
||||
[ext_resource type="Shader" path="res://asset/shader/huabu.gdshader" id="4_n5nu8"]
|
||||
[ext_resource type="Shader" path="res://asset/shader/palette.gdshader" id="4_n5nu8"]
|
||||
[ext_resource type="Shader" path="res://asset/shader/fog.gdshader" id="4_sglhm"]
|
||||
[ext_resource type="Texture2D" uid="uid://benc6ebkr0nd1" path="res://asset/shader/palette/bloodmoon21-1x.png" id="5_ios50"]
|
||||
[ext_resource type="Shader" path="res://asset/shader/chromatic_abberation.gdshader" id="8_b0unx"]
|
||||
@ -45,9 +45,9 @@ shader_parameter/vignette_intensity = 0.4
|
||||
shader_parameter/vignette_rgb = Color(0.247, 0.149, 0.192, 1)
|
||||
|
||||
[node name="ShadingLayer" type="CanvasLayer"]
|
||||
layer = 90
|
||||
layer = 10
|
||||
script = ExtResource("1_6w7er")
|
||||
mode = Array[String](["vignette"])
|
||||
mode = Array[String]([])
|
||||
fog_base_color = Color(0.52549, 0.0196078, 0.141176, 0.513726)
|
||||
|
||||
[node name="Sprite2D" type="Sprite2D" parent="."]
|
||||
@ -125,10 +125,3 @@ mouse_filter = 2
|
||||
|
||||
[node name="BackBufferCopy" type="BackBufferCopy" parent="Vignette"]
|
||||
copy_mode = 2
|
||||
|
||||
[node name="EnvironmentLight" type="Panel" parent="."]
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
|
@ -1,14 +1,24 @@
|
||||
@tool
|
||||
extends TextureButton
|
||||
|
||||
class_name SoundTextureButton
|
||||
|
||||
@export var audio_collections: Array[AudioStreamCollection]
|
||||
@export var generate_click_mask := false:
|
||||
set(val):
|
||||
generate_click_mask = false
|
||||
if val and texture_normal:
|
||||
var mask_image := texture_normal.get_image()
|
||||
texture_click_mask = BitMap.new()
|
||||
texture_click_mask.create_from_image_alpha(mask_image)
|
||||
@export var audio_streams := [preload("res://asset/audio/sfx/ui/click.wav")] as Array[AudioStream]
|
||||
@export var audio_collections = [] as Array[AudioStreamCollection]
|
||||
|
||||
|
||||
func _ready():
|
||||
if !audio_collections:
|
||||
audio_collections.append(preload("res://config/audio/ui/ui_click.tres"))
|
||||
#print("sound button loaded default ui_click.tres")
|
||||
|
||||
if audio_streams:
|
||||
var collection := AudioStreamCollection.new()
|
||||
collection.audios = audio_streams
|
||||
audio_collections.append(collection)
|
||||
if audio_collections:
|
||||
#print("sound button load audio_collections into audio_player")
|
||||
var audio_player := RandomAudioStreamPlayer.new()
|
||||
@ -16,13 +26,12 @@ func _ready():
|
||||
button_down.connect(audio_player.play_random)
|
||||
add_child(audio_player)
|
||||
else:
|
||||
printerr("sound button has no audio_collections! ignore initialization of audio_player")
|
||||
push_warning("sound button has no audio_collections! ignore initialization of audio_player")
|
||||
#button_down.connect(_on_press_down)
|
||||
#button_up.connect(_on_press_up)
|
||||
|
||||
|
||||
#func _on_press_down():
|
||||
#InputUtil.set_cursor_hand_patting()
|
||||
#InputUtil.set_cursor_hand_patting()
|
||||
#
|
||||
#func _on_press_up():
|
||||
#InputUtil.set_cursor_hand_rest()
|
||||
#InputUtil.set_cursor_hand_rest()
|
||||
|