实现前三个街景传送机制,基本的自动存档与加载机制
This commit is contained in:
parent
f269e57507
commit
27b9a5a50f
File diff suppressed because one or more lines are too long
@ -1,6 +1,10 @@
|
|||||||
class_name AssembledArchive extends Resource
|
class_name AssembledArchive extends Resource
|
||||||
|
|
||||||
@export var archive_id := 0
|
@export var archive_id := 0
|
||||||
|
@export var current_scene := ""
|
||||||
|
@export var entrance_portal := ""
|
||||||
|
@export var player_global_position := Vector2(0, 0)
|
||||||
|
@export var player_direction := Vector2(0, 0)
|
||||||
@export var current_chapter := 0
|
@export var current_chapter := 0
|
||||||
@export var current_section := 0
|
@export var current_section := 0
|
||||||
@export var game_seconds_all := 0
|
@export var game_seconds_all := 0
|
||||||
|
@ -11,6 +11,8 @@ var autosave_timer := Timer.new()
|
|||||||
|
|
||||||
|
|
||||||
func _ready() -> void:
|
func _ready() -> void:
|
||||||
|
# disable auto quit
|
||||||
|
get_tree().set_auto_accept_quit(false)
|
||||||
if not _check_dirs_and_archives():
|
if not _check_dirs_and_archives():
|
||||||
_handle_load_error("存档目录", "读写")
|
_handle_load_error("存档目录", "读写")
|
||||||
return
|
return
|
||||||
@ -27,6 +29,21 @@ func _ready() -> void:
|
|||||||
GlobalConfigManager.config.current_selected_archive_id = archives[0]
|
GlobalConfigManager.config.current_selected_archive_id = archives[0]
|
||||||
|
|
||||||
|
|
||||||
|
func _notification(what):
|
||||||
|
# handle window close request
|
||||||
|
if what == NOTIFICATION_WM_CLOSE_REQUEST:
|
||||||
|
# player_global_position
|
||||||
|
var player = SceneManager.get_player() as MainPlayer
|
||||||
|
if archive and player:
|
||||||
|
archive.player_global_position = player.global_position
|
||||||
|
archive.player_direction = player.facing_direction
|
||||||
|
save_all()
|
||||||
|
print("Saved all success before Quit")
|
||||||
|
SceneManager.pop_notification("已保存所有数据")
|
||||||
|
var tree = get_tree()
|
||||||
|
tree.create_timer(1.5).timeout.connect(tree.quit)
|
||||||
|
|
||||||
|
|
||||||
func _archive_id_changed():
|
func _archive_id_changed():
|
||||||
var selected_id = GlobalConfigManager.config.current_selected_archive_id
|
var selected_id = GlobalConfigManager.config.current_selected_archive_id
|
||||||
if archive:
|
if archive:
|
||||||
|
@ -26,4 +26,4 @@ signal auto_save_seconds_changed
|
|||||||
@export var auto_save_seconds := 60:
|
@export var auto_save_seconds := 60:
|
||||||
set(val):
|
set(val):
|
||||||
auto_save_seconds = val
|
auto_save_seconds = val
|
||||||
auto_save_seconds_changed.emit()
|
auto_save_seconds_changed.emit()
|
@ -1,5 +1,35 @@
|
|||||||
extends Node
|
extends Node
|
||||||
|
|
||||||
|
# SceneManager.set_camera_boundary(bg.texture.get_size())
|
||||||
|
# SceneManager.set_player_boundary(bg.texture.get_size())
|
||||||
|
|
||||||
|
|
||||||
|
func set_camera_boundary(size: Vector2) -> void:
|
||||||
|
var camera = (
|
||||||
|
get_node_or_null("/root/Main/MainPlayer/CameraFocusMarker/MainCamera") as MainCamera
|
||||||
|
)
|
||||||
|
if camera:
|
||||||
|
camera.limit_left = 0
|
||||||
|
camera.limit_right = size.x
|
||||||
|
if GlobalConfig.DEBUG:
|
||||||
|
print("set camera boundary:", size)
|
||||||
|
# camera.limit_top = -size.y / 2
|
||||||
|
# camera.limit_bottom = size.y / 2
|
||||||
|
else:
|
||||||
|
printerr("Camera node not found")
|
||||||
|
|
||||||
|
|
||||||
|
func set_player_boundary(size: Vector2) -> void:
|
||||||
|
var player = get_node_or_null("/root/Main/MainPlayer") as MainPlayer
|
||||||
|
if player:
|
||||||
|
size.x = size.x - 30
|
||||||
|
var rect = Rect2(Vector2(15, -size.y / 2), size)
|
||||||
|
player.player_movement_rect = rect
|
||||||
|
if GlobalConfig.DEBUG:
|
||||||
|
print("set player boundary:", rect)
|
||||||
|
else:
|
||||||
|
printerr("Player node not found")
|
||||||
|
|
||||||
|
|
||||||
func get_player() -> MainPlayer:
|
func get_player() -> MainPlayer:
|
||||||
return get_node_or_null("/root/Main/MainPlayer") as MainPlayer
|
return get_node_or_null("/root/Main/MainPlayer") as MainPlayer
|
||||||
|
@ -18,7 +18,8 @@ func test():
|
|||||||
# append_dialog("吕萍", "Hello, 2! very very long message, very very loooonnnggggggg!")
|
# append_dialog("吕萍", "Hello, 2! very very long message, very very loooonnnggggggg!")
|
||||||
# append_note("Hello, 3!")
|
# append_note("Hello, 3!")
|
||||||
# append_note("Hello, blue!", "blue", 1)
|
# append_note("Hello, blue!", "blue", 1)
|
||||||
append_dialog("车夫", "你好!", "green")
|
# append_dialog("车夫", "你好!", "green")
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
func append_note(note: String, note_color := "white", duration := 2.5) -> void:
|
func append_note(note: String, note_color := "white", duration := 2.5) -> void:
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_iwrfx"]
|
[sub_resource type="RectangleShape2D" id="RectangleShape2D_iwrfx"]
|
||||||
resource_local_to_scene = true
|
resource_local_to_scene = true
|
||||||
size = Vector2(60, 100)
|
size = Vector2(40, 70)
|
||||||
|
|
||||||
[node name="Ambush" type="Node2D"]
|
[node name="Ambush" type="Node2D"]
|
||||||
script = ExtResource("1_rxgbr")
|
script = ExtResource("1_rxgbr")
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
|
|
||||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_k6och"]
|
[sub_resource type="RectangleShape2D" id="RectangleShape2D_k6och"]
|
||||||
resource_local_to_scene = true
|
resource_local_to_scene = true
|
||||||
size = Vector2(45, 100)
|
size = Vector2(40, 60)
|
||||||
|
|
||||||
[node name="Note" type="Marker2D"]
|
[node name="Note" type="Marker2D"]
|
||||||
script = ExtResource("1_3igk8")
|
script = ExtResource("1_3igk8")
|
||||||
@ -16,7 +16,7 @@ notes = Array[String](["(note)"])
|
|||||||
|
|
||||||
[node name="Sign" type="Sprite2D" parent="."]
|
[node name="Sign" type="Sprite2D" parent="."]
|
||||||
unique_name_in_owner = true
|
unique_name_in_owner = true
|
||||||
position = Vector2(0, -63)
|
position = Vector2(0, -3.8147e-06)
|
||||||
scale = Vector2(0.2, 0.2)
|
scale = Vector2(0.2, 0.2)
|
||||||
texture = ExtResource("1_eew1k")
|
texture = ExtResource("1_eew1k")
|
||||||
script = ExtResource("2_36okt")
|
script = ExtResource("2_36okt")
|
||||||
@ -24,7 +24,6 @@ audio_collection = ExtResource("4_14cx5")
|
|||||||
|
|
||||||
[node name="PointLight2D" type="PointLight2D" parent="."]
|
[node name="PointLight2D" type="PointLight2D" parent="."]
|
||||||
unique_name_in_owner = true
|
unique_name_in_owner = true
|
||||||
position = Vector2(0, -35)
|
|
||||||
scale = Vector2(0.2, 0.2)
|
scale = Vector2(0.2, 0.2)
|
||||||
energy = 0.0
|
energy = 0.0
|
||||||
texture = ExtResource("3_xb81s")
|
texture = ExtResource("3_xb81s")
|
||||||
|
@ -1,32 +1,81 @@
|
|||||||
extends Sprite2D
|
extends Sprite2D
|
||||||
|
|
||||||
@export var portal_name := "0":
|
@export_enum("left", "right", "1", "2", "3", "4", "5", "6", "7", "8", "9") var portal_name := "left":
|
||||||
set(value):
|
set(value):
|
||||||
|
#if portal_name:
|
||||||
|
#remove_from_group("portal_"+portal_name)
|
||||||
portal_name = value
|
portal_name = value
|
||||||
|
#add_to_group("portal_"+value)
|
||||||
|
name = "portal_" + value
|
||||||
|
@export var target_scene := "c02_s00"
|
||||||
|
@export_enum("none", "left", "right", "1", "2", "3", "4", "5", "6", "7", "8", "9")
|
||||||
|
var target_portal := "none"
|
||||||
|
|
||||||
@onready var sign_mark = %Sign as Sprite2D
|
@onready var sign_mark = %Sign as Sprite2D
|
||||||
@onready var area2d = %Area2D as Area2D
|
@onready var area2d = %Area2D as Area2D
|
||||||
|
|
||||||
|
var activated := false
|
||||||
|
var action_times := 0
|
||||||
|
|
||||||
|
|
||||||
# Called when the node enters the scene tree for the first time.
|
# Called when the node enters the scene tree for the first time.
|
||||||
func _ready() -> void:
|
func _ready() -> void:
|
||||||
|
name = "portal_" + portal_name
|
||||||
area2d.body_entered.connect(_reset)
|
area2d.body_entered.connect(_reset)
|
||||||
area2d.body_exited.connect(_on_cancel)
|
area2d.body_exited.connect(_on_cancel)
|
||||||
sign_mark.interacted.connect(_on_interacted)
|
sign_mark.interacted.connect(_on_interacted)
|
||||||
sign_mark.cancel.connect(_on_cancel)
|
sign_mark.cancel.connect(_on_cancel)
|
||||||
|
if target_portal == "none":
|
||||||
|
sign_mark.show_sign = false
|
||||||
|
|
||||||
# if GlobalConfig.DEBUG:
|
# if GlobalConfig.DEBUG:
|
||||||
# var label = Label.new()
|
# var label = Label.new()
|
||||||
# label.text = portal_name
|
# label.text = portal_name
|
||||||
# label.name = "Label"
|
# label.name = "Label"
|
||||||
# add_child(label)
|
# add_child(label)
|
||||||
|
|
||||||
|
|
||||||
func _on_interacted() -> void:
|
func _on_interacted() -> void:
|
||||||
|
if target_portal == "none":
|
||||||
|
return
|
||||||
# 传送
|
# 传送
|
||||||
print("传送")
|
if GlobalConfig.DEBUG:
|
||||||
pass
|
print("传送前往", target_scene, target_portal)
|
||||||
|
var ground_loader = SceneManager.get_ground_loader() as GroundLoader
|
||||||
|
if ground_loader:
|
||||||
|
ground_loader.transition_to_scene(target_scene, target_portal)
|
||||||
|
|
||||||
|
|
||||||
func _on_cancel(_body = null):
|
func _on_cancel(_body = null):
|
||||||
pass
|
activated = false
|
||||||
|
|
||||||
|
|
||||||
func _reset(_body):
|
func _reset(_body):
|
||||||
pass
|
activated = true
|
||||||
|
|
||||||
|
|
||||||
|
func _input(event: InputEvent) -> void:
|
||||||
|
# 长按自动传送
|
||||||
|
if activated:
|
||||||
|
if portal_name == "left" and target_portal == "right":
|
||||||
|
if event.is_action("left"):
|
||||||
|
action_times += 1
|
||||||
|
elif event.is_action("right"):
|
||||||
|
action_times = 0
|
||||||
|
if action_times >= 10:
|
||||||
|
activated = false
|
||||||
|
action_times = 0
|
||||||
|
if sign_mark.random_audio_player:
|
||||||
|
sign_mark.random_audio_player.play_random()
|
||||||
|
_on_interacted()
|
||||||
|
if portal_name == "right" and target_portal == "left":
|
||||||
|
if event.is_action("right"):
|
||||||
|
action_times += 1
|
||||||
|
elif event.is_action("left"):
|
||||||
|
action_times = 0
|
||||||
|
if action_times >= 10:
|
||||||
|
activated = false
|
||||||
|
action_times = 0
|
||||||
|
if sign_mark.random_audio_player:
|
||||||
|
sign_mark.random_audio_player.play_random()
|
||||||
|
_on_interacted()
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
|
|
||||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_munml"]
|
[sub_resource type="RectangleShape2D" id="RectangleShape2D_munml"]
|
||||||
resource_local_to_scene = true
|
resource_local_to_scene = true
|
||||||
size = Vector2(70, 130)
|
size = Vector2(45, 130)
|
||||||
|
|
||||||
[node name="Portal" type="Sprite2D"]
|
[node name="Portal" type="Sprite2D"]
|
||||||
texture = ExtResource("1_ynrqg")
|
texture = ExtResource("1_ynrqg")
|
||||||
@ -20,7 +20,7 @@ position = Vector2(0, -73)
|
|||||||
scale = Vector2(0.05, 0.05)
|
scale = Vector2(0.05, 0.05)
|
||||||
texture = ExtResource("2_ay30q")
|
texture = ExtResource("2_ay30q")
|
||||||
script = ExtResource("4_lu5q5")
|
script = ExtResource("4_lu5q5")
|
||||||
show_sign = null
|
volume_db = -15.0
|
||||||
audio_collection = ExtResource("5_7e0co")
|
audio_collection = ExtResource("5_7e0co")
|
||||||
|
|
||||||
[node name="PointLight2D" type="PointLight2D" parent="."]
|
[node name="PointLight2D" type="PointLight2D" parent="."]
|
||||||
|
@ -10,6 +10,11 @@ extends Node2D
|
|||||||
# # base_scale = val
|
# # base_scale = val
|
||||||
# # sprite2d.scale = base_scale
|
# # sprite2d.scale = base_scale
|
||||||
@export var show_sign := true
|
@export var show_sign := true
|
||||||
|
@export var volume_db := -5.0:
|
||||||
|
set(val):
|
||||||
|
volume_db = val
|
||||||
|
if random_audio_player:
|
||||||
|
random_audio_player.volume_db = volume_db
|
||||||
@export var audio_collection: AudioStreamCollection
|
@export var audio_collection: AudioStreamCollection
|
||||||
|
|
||||||
signal interacted
|
signal interacted
|
||||||
@ -23,11 +28,12 @@ static var _pending_callables: Array[Callable]
|
|||||||
var own_callable
|
var own_callable
|
||||||
|
|
||||||
var activated = false
|
var activated = false
|
||||||
var random_audio_player
|
var random_audio_player: RandomAudioStreamPlayer
|
||||||
|
|
||||||
# var sprite2d = Sprite2D.new()
|
# var sprite2d = Sprite2D.new()
|
||||||
var base_scale = Vector2.ONE
|
var base_scale = Vector2.ONE
|
||||||
|
|
||||||
|
|
||||||
func _ready() -> void:
|
func _ready() -> void:
|
||||||
base_scale = scale
|
base_scale = scale
|
||||||
# layer = GlobalConfig.CANVAS_LAYER_FG
|
# layer = GlobalConfig.CANVAS_LAYER_FG
|
||||||
@ -49,6 +55,7 @@ func _ready() -> void:
|
|||||||
random_audio_player = RandomAudioStreamPlayer.new()
|
random_audio_player = RandomAudioStreamPlayer.new()
|
||||||
random_audio_player.audio_collections.append(audio_collection)
|
random_audio_player.audio_collections.append(audio_collection)
|
||||||
random_audio_player.bus = GlobalConfig.AUDIO_BUS_SFX
|
random_audio_player.bus = GlobalConfig.AUDIO_BUS_SFX
|
||||||
|
random_audio_player.volume_db = volume_db
|
||||||
add_child(random_audio_player)
|
add_child(random_audio_player)
|
||||||
|
|
||||||
|
|
||||||
@ -60,7 +67,7 @@ func _ready() -> void:
|
|||||||
func activate(_body: Node2D) -> void:
|
func activate(_body: Node2D) -> void:
|
||||||
# point_light.energy = 1.0
|
# point_light.energy = 1.0
|
||||||
mutex.lock()
|
mutex.lock()
|
||||||
if occupied:
|
if occupied and occupied != get_path():
|
||||||
own_callable = activate.bind(_body)
|
own_callable = activate.bind(_body)
|
||||||
_pending_callables.append(own_callable)
|
_pending_callables.append(own_callable)
|
||||||
else:
|
else:
|
||||||
@ -78,8 +85,11 @@ func activate(_body: Node2D) -> void:
|
|||||||
func disactivate(_body: Node2D) -> void:
|
func disactivate(_body: Node2D) -> void:
|
||||||
activated = false
|
activated = false
|
||||||
if _unoccupy():
|
if _unoccupy():
|
||||||
if _pending_callables.size() > 0:
|
while _pending_callables.size() > 0:
|
||||||
_pending_callables.pop_front().call()
|
var callable = _pending_callables.pop_front() as Callable
|
||||||
|
if callable.is_valid():
|
||||||
|
callable.call()
|
||||||
|
break
|
||||||
# point_light.energy = 0.0
|
# point_light.energy = 0.0
|
||||||
if show_sign:
|
if show_sign:
|
||||||
create_tween().tween_property(self, "modulate:a", 0.0, 0.2)
|
create_tween().tween_property(self, "modulate:a", 0.0, 0.2)
|
||||||
@ -89,7 +99,7 @@ func _input(event: InputEvent) -> void:
|
|||||||
if activated:
|
if activated:
|
||||||
if event.is_action_pressed("interact"):
|
if event.is_action_pressed("interact"):
|
||||||
interacted.emit()
|
interacted.emit()
|
||||||
if random_audio_player:
|
if show_sign and random_audio_player:
|
||||||
random_audio_player.play_random()
|
random_audio_player.play_random()
|
||||||
elif event.is_action_pressed("cancel"):
|
elif event.is_action_pressed("cancel"):
|
||||||
cancel.emit()
|
cancel.emit()
|
||||||
@ -97,19 +107,22 @@ func _input(event: InputEvent) -> void:
|
|||||||
|
|
||||||
func _exit_tree() -> void:
|
func _exit_tree() -> void:
|
||||||
if _unoccupy():
|
if _unoccupy():
|
||||||
if _pending_callables.size() > 0:
|
while _pending_callables.size() > 0:
|
||||||
_pending_callables.pop_front().call()
|
var callable = _pending_callables.pop_front() as Callable
|
||||||
|
if callable.is_valid():
|
||||||
|
callable.call()
|
||||||
|
break
|
||||||
cancel.emit()
|
cancel.emit()
|
||||||
|
|
||||||
|
|
||||||
func _unoccupy() -> bool:
|
func _unoccupy() -> bool:
|
||||||
var is_occupied = false
|
var self_occupied = false
|
||||||
mutex.lock()
|
mutex.lock()
|
||||||
if occupied == get_path():
|
if occupied == get_path():
|
||||||
occupied = ""
|
occupied = ""
|
||||||
is_occupied = true
|
self_occupied = true
|
||||||
elif own_callable:
|
elif own_callable:
|
||||||
_pending_callables.erase(own_callable)
|
_pending_callables.erase(own_callable)
|
||||||
own_callable = null
|
own_callable = null
|
||||||
mutex.unlock()
|
mutex.unlock()
|
||||||
return is_occupied
|
return self_occupied
|
||||||
|
@ -3,15 +3,13 @@ extends Node2D
|
|||||||
@export var scene_config: SceneConfig
|
@export var scene_config: SceneConfig
|
||||||
|
|
||||||
@onready var foreground = %ParallaxForeground as ParallaxBackground
|
@onready var foreground = %ParallaxForeground as ParallaxBackground
|
||||||
@onready var bg_sprite = %BGSprite2D as Sprite2D
|
|
||||||
@onready var fg_sprite = %FGSprite2D as Sprite2D
|
|
||||||
@onready var deploy_layer = %DeployLayer as Node2D
|
|
||||||
|
|
||||||
@onready var footstep_audio = %FootstepAudioStreamPlayer as RandomAudioStreamPlayer
|
var footstep_audio = RandomAudioStreamPlayer.new()
|
||||||
|
|
||||||
|
|
||||||
func _ready() -> void:
|
func _ready() -> void:
|
||||||
foreground.layer = GlobalConfig.CANVAS_LAYER_FG
|
foreground.layer = GlobalConfig.CANVAS_LAYER_FG
|
||||||
|
add_child(footstep_audio)
|
||||||
reload()
|
reload()
|
||||||
|
|
||||||
|
|
||||||
@ -19,8 +17,6 @@ func reload():
|
|||||||
if not scene_config:
|
if not scene_config:
|
||||||
footstep_audio.audio_collections.clear()
|
footstep_audio.audio_collections.clear()
|
||||||
return
|
return
|
||||||
#TODO load background and foreground etc.
|
|
||||||
|
|
||||||
var type = scene_config.footstep_type
|
var type = scene_config.footstep_type
|
||||||
if type == "none":
|
if type == "none":
|
||||||
return
|
return
|
||||||
@ -30,5 +26,5 @@ func reload():
|
|||||||
|
|
||||||
|
|
||||||
func play_footstep_sound() -> void:
|
func play_footstep_sound() -> void:
|
||||||
if footstep_audio.audio_collections:
|
if not footstep_audio.audio_collections.is_empty():
|
||||||
footstep_audio.play_random()
|
footstep_audio.play_random()
|
||||||
|
@ -1,14 +1,9 @@
|
|||||||
[gd_scene load_steps=12 format=3 uid="uid://dayyx4jerj7io"]
|
[gd_scene load_steps=6 format=3 uid="uid://dayyx4jerj7io"]
|
||||||
|
|
||||||
[ext_resource type="Script" path="res://scene/ground/ground.gd" id="1_0vrlo"]
|
[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="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://cjyk6lbbdxiwf" path="res://asset/art/scene/c02/s06_院子回忆版/bg_院子1楼(黄昏有人).png" id="3_amw1x"]
|
||||||
[ext_resource type="PackedScene" uid="uid://jr1yd46wm5je" path="res://scene/entity/note.tscn" id="4_i8g3k"]
|
|
||||||
[ext_resource type="PackedScene" uid="uid://0sofmhrl358m" path="res://scene/entity/npc.tscn" id="4_n74on"]
|
|
||||||
[ext_resource type="Texture2D" uid="uid://by8h2yuqve7fw" path="res://asset/art/scene/c02/s06_院子回忆版/fg_有人.png" id="5_i5hii"]
|
[ext_resource type="Texture2D" uid="uid://by8h2yuqve7fw" path="res://asset/art/scene/c02/s06_院子回忆版/fg_有人.png" id="5_i5hii"]
|
||||||
[ext_resource type="PackedScene" uid="uid://61pis75a8fdq" path="res://scene/entity/portal.tscn" id="6_lalit"]
|
|
||||||
[ext_resource type="PackedScene" uid="uid://wyj4qdjyn4ql" path="res://scene/entity/inspectable.tscn" id="7_vhjr5"]
|
|
||||||
[ext_resource type="PackedScene" uid="uid://bnf3lkcbpx1ar" path="res://scene/entity/ambush.tscn" id="8_wig1g"]
|
|
||||||
|
|
||||||
[sub_resource type="Resource" id="Resource_6ux50"]
|
[sub_resource type="Resource" id="Resource_6ux50"]
|
||||||
script = ExtResource("2_bx7rv")
|
script = ExtResource("2_bx7rv")
|
||||||
@ -23,46 +18,19 @@ player_movement_rect = Rect2(0, 0, 0, 0)
|
|||||||
camera_rect = Rect2(0, -1000, 664, 2317)
|
camera_rect = Rect2(0, -1000, 664, 2317)
|
||||||
footstep_type = "concrete"
|
footstep_type = "concrete"
|
||||||
|
|
||||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_i13cb"]
|
|
||||||
resource_local_to_scene = true
|
|
||||||
size = Vector2(45, 100)
|
|
||||||
|
|
||||||
[node name="Ground" type="Node2D"]
|
[node name="Ground" type="Node2D"]
|
||||||
script = ExtResource("1_0vrlo")
|
script = ExtResource("1_0vrlo")
|
||||||
scene_config = SubResource("Resource_6ux50")
|
scene_config = SubResource("Resource_6ux50")
|
||||||
|
|
||||||
[node name="BGSprite2D" type="Sprite2D" parent="."]
|
[node name="BGSprite2D" type="Sprite2D" parent="."]
|
||||||
unique_name_in_owner = true
|
unique_name_in_owner = true
|
||||||
scale = Vector2(1.1, 1.1)
|
|
||||||
texture = ExtResource("3_amw1x")
|
texture = ExtResource("3_amw1x")
|
||||||
centered = false
|
centered = false
|
||||||
offset = Vector2(0, -120)
|
offset = Vector2(0, -119)
|
||||||
|
|
||||||
[node name="DeployLayer" type="Node2D" parent="."]
|
[node name="DeployLayer" type="Node2D" parent="."]
|
||||||
unique_name_in_owner = true
|
unique_name_in_owner = true
|
||||||
|
|
||||||
[node name="Npc" parent="DeployLayer" instance=ExtResource("4_n74on")]
|
|
||||||
position = Vector2(465, 23)
|
|
||||||
|
|
||||||
[node name="Note" parent="DeployLayer" instance=ExtResource("4_i8g3k")]
|
|
||||||
position = Vector2(278, 11)
|
|
||||||
notes = Array[String](["(门牌号: 1012)", "(似乎是用血来写的)"])
|
|
||||||
|
|
||||||
[node name="CollisionShape2D" parent="DeployLayer/Note/Area2D" index="0"]
|
|
||||||
position = Vector2(1, -6)
|
|
||||||
shape = SubResource("RectangleShape2D_i13cb")
|
|
||||||
|
|
||||||
[node name="Portal" parent="DeployLayer" instance=ExtResource("6_lalit")]
|
|
||||||
position = Vector2(213, 3)
|
|
||||||
scale = Vector2(1.02941, 1.06667)
|
|
||||||
|
|
||||||
[node name="Inspectable" parent="DeployLayer" instance=ExtResource("7_vhjr5")]
|
|
||||||
position = Vector2(381, -12)
|
|
||||||
|
|
||||||
[node name="Ambush" parent="DeployLayer" instance=ExtResource("8_wig1g")]
|
|
||||||
position = Vector2(567, 28)
|
|
||||||
hook_cg = "c02_胖子说话"
|
|
||||||
|
|
||||||
[node name="ParallaxForeground" type="ParallaxBackground" parent="."]
|
[node name="ParallaxForeground" type="ParallaxBackground" parent="."]
|
||||||
unique_name_in_owner = true
|
unique_name_in_owner = true
|
||||||
layer = 10
|
layer = 10
|
||||||
@ -104,5 +72,3 @@ grow_horizontal = 2
|
|||||||
grow_vertical = 0
|
grow_vertical = 0
|
||||||
mouse_filter = 2
|
mouse_filter = 2
|
||||||
color = Color(0.0519829, 0.0179176, 0.00269875, 1)
|
color = Color(0.0519829, 0.0179176, 0.00269875, 1)
|
||||||
|
|
||||||
[editable path="DeployLayer/Note"]
|
|
||||||
|
@ -1,9 +1,10 @@
|
|||||||
|
@tool
|
||||||
class_name GroundLoader extends Node2D
|
class_name GroundLoader extends Node2D
|
||||||
|
|
||||||
@export var chapter := 2
|
@export var current_scene := "c02_s01"
|
||||||
@export var section := 1
|
@export var entrance_portal := "left"
|
||||||
|
|
||||||
@onready var ground = %Ground
|
var ground: Node2D
|
||||||
|
|
||||||
var scenes_dir = "res://scene/ground/scene/"
|
var scenes_dir = "res://scene/ground/scene/"
|
||||||
|
|
||||||
@ -11,31 +12,92 @@ var ground_dict = {}
|
|||||||
|
|
||||||
|
|
||||||
func _ready() -> void:
|
func _ready() -> void:
|
||||||
|
_load_save()
|
||||||
_read_grounds()
|
_read_grounds()
|
||||||
|
if current_scene and entrance_portal:
|
||||||
|
transition_to_scene(current_scene, entrance_portal, true)
|
||||||
|
|
||||||
|
func _load_save():
|
||||||
|
if ArchiveManager.archive:
|
||||||
|
if ArchiveManager.archive.current_scene:
|
||||||
|
current_scene = ArchiveManager.archive.current_scene
|
||||||
|
if ArchiveManager.archive.entrance_portal:
|
||||||
|
entrance_portal = ArchiveManager.archive.entrance_portal
|
||||||
|
|
||||||
func _read_grounds():
|
func _read_grounds():
|
||||||
var dir = DirAccess.open(scenes_dir)
|
var dir = DirAccess.open(scenes_dir)
|
||||||
for c_dir in dir.get_directories():
|
for c_dir in dir.get_directories():
|
||||||
var c = int(c_dir.substr(1))
|
|
||||||
var c_path = scenes_dir + c_dir + "/"
|
var c_path = scenes_dir + c_dir + "/"
|
||||||
for s_file in DirAccess.open(c_path).get_files():
|
for s_file in DirAccess.open(c_path).get_files():
|
||||||
if s_file.ends_with(".tscn"):
|
if s_file.ends_with(".tscn"):
|
||||||
var s = int(s_file.substr(1, 2))
|
|
||||||
var s_path = c_path + s_file
|
var s_path = c_path + s_file
|
||||||
ground_dict[str(c + s)] = s_path
|
ground_dict[c_dir.substr(0, 3) + "_" + s_file.substr(0, 3)] = s_path
|
||||||
|
|
||||||
|
|
||||||
func play_footstep_sound() -> void:
|
func play_footstep_sound() -> void:
|
||||||
ground.play_footstep_sound()
|
if ground and ground.is_visible_in_tree():
|
||||||
|
ground.play_footstep_sound()
|
||||||
|
|
||||||
|
|
||||||
func transition_to_scene(c: int, s: int, portal: String) -> void:
|
func transition_to_scene(key: String, portal: String, load_save := false) -> void:
|
||||||
var scene_path = ground_dict[str(c + s)]
|
var scene_path = ground_dict[key]
|
||||||
if scene_path:
|
if scene_path:
|
||||||
ground.scene_config = load(scene_path)
|
current_scene = key
|
||||||
ground.reload()
|
entrance_portal = portal
|
||||||
chapter = c
|
if load_save:
|
||||||
section = s
|
_do_transition(scene_path)
|
||||||
|
# 更新玩家位置
|
||||||
|
_update_player_position()
|
||||||
|
else:
|
||||||
|
var tween = create_tween()
|
||||||
|
var player = SceneManager.get_player() as MainPlayer
|
||||||
|
if player:
|
||||||
|
player.action_locked = true
|
||||||
|
#TODO 转场效果
|
||||||
|
#
|
||||||
|
tween.tween_interval(1.0)
|
||||||
|
tween.tween_callback(_do_transition.bind(scene_path))
|
||||||
|
tween.tween_callback(func(): player.action_locked = false)
|
||||||
else:
|
else:
|
||||||
print("Scene not found: " + str(c) + "-" + str(s))
|
print("Scene not found: " + key)
|
||||||
|
|
||||||
|
func _update_player_position():
|
||||||
|
var player = SceneManager.get_player() as MainPlayer
|
||||||
|
if player and ArchiveManager.archive:
|
||||||
|
# if GlobalConfig.DEBUG:
|
||||||
|
# print("update player position", ArchiveManager.archive.player_global_position)
|
||||||
|
player.global_position = ArchiveManager.archive.player_global_position
|
||||||
|
player.set_facing_direction(ArchiveManager.archive.player_direction)
|
||||||
|
|
||||||
|
func _do_transition(scene_path):
|
||||||
|
var new_ground = load(scene_path) as PackedScene
|
||||||
|
if ground:
|
||||||
|
ground.queue_free()
|
||||||
|
# 提前移除,防止命名冲突
|
||||||
|
remove_child(ground)
|
||||||
|
var scene = new_ground.instantiate()
|
||||||
|
ground = scene.get_child(0)
|
||||||
|
scene.remove_child(ground)
|
||||||
|
scene.queue_free()
|
||||||
|
add_child(ground)
|
||||||
|
ground.name = "Ground"
|
||||||
|
_set_camera_and_player_boundary()
|
||||||
|
_update_archive()
|
||||||
|
var portal_node = get_node_or_null("./Ground/DeployLayer/portal_" + entrance_portal) as Node2D
|
||||||
|
if portal_node:
|
||||||
|
print("set player to portal:", entrance_portal)
|
||||||
|
var player = SceneManager.get_player()
|
||||||
|
if player:
|
||||||
|
player.global_position.x = portal_node.global_position.x
|
||||||
|
|
||||||
|
|
||||||
|
func _set_camera_and_player_boundary():
|
||||||
|
var bg = ground.get_node("BGSprite2D")
|
||||||
|
if bg.texture:
|
||||||
|
SceneManager.set_camera_boundary(bg.texture.get_size())
|
||||||
|
SceneManager.set_player_boundary(bg.texture.get_size())
|
||||||
|
|
||||||
|
|
||||||
|
func _update_archive():
|
||||||
|
ArchiveManager.archive.current_scene = current_scene
|
||||||
|
ArchiveManager.archive.entrance_portal = entrance_portal
|
||||||
|
@ -1,29 +1,6 @@
|
|||||||
[gd_scene load_steps=5 format=3 uid="uid://clxgkj80yin2"]
|
[gd_scene load_steps=2 format=3 uid="uid://clxgkj80yin2"]
|
||||||
|
|
||||||
[ext_resource type="Script" path="res://scene/ground/ground_loader.gd" id="1_6mjre"]
|
[ext_resource type="Script" path="res://scene/ground/ground_loader.gd" id="1_6mjre"]
|
||||||
[ext_resource type="PackedScene" uid="uid://dayyx4jerj7io" path="res://scene/ground/ground.tscn" id="2_2ob1l"]
|
|
||||||
[ext_resource type="Script" path="res://config/audio/random_audio_stream_player.gd" id="3_vvkgn"]
|
|
||||||
|
|
||||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_51reu"]
|
|
||||||
resource_local_to_scene = true
|
|
||||||
size = Vector2(45, 100)
|
|
||||||
|
|
||||||
[node name="GroundLoader" type="Node2D"]
|
[node name="GroundLoader" type="Node2D"]
|
||||||
script = ExtResource("1_6mjre")
|
script = ExtResource("1_6mjre")
|
||||||
|
|
||||||
[node name="Ground" parent="." instance=ExtResource("2_2ob1l")]
|
|
||||||
unique_name_in_owner = true
|
|
||||||
|
|
||||||
[node name="CollisionShape2D" parent="Ground/DeployLayer/Note/Area2D" index="0"]
|
|
||||||
shape = SubResource("RectangleShape2D_51reu")
|
|
||||||
|
|
||||||
[node name="FootstepAudioStreamPlayer" type="AudioStreamPlayer" parent="."]
|
|
||||||
unique_name_in_owner = true
|
|
||||||
volume_db = -10.0
|
|
||||||
pitch_scale = 0.6
|
|
||||||
bus = &"game_sfx"
|
|
||||||
script = ExtResource("3_vvkgn")
|
|
||||||
audio_collections = Array[Object]([])
|
|
||||||
|
|
||||||
[editable path="Ground"]
|
|
||||||
[editable path="Ground/DeployLayer/Note"]
|
|
||||||
|
35
scene/ground/scene/c02/s00_demo.tscn
Normal file
35
scene/ground/scene/c02/s00_demo.tscn
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
[gd_scene load_steps=7 format=3 uid="uid://e381spnutx62"]
|
||||||
|
|
||||||
|
[ext_resource type="PackedScene" uid="uid://dayyx4jerj7io" path="res://scene/ground/ground.tscn" id="1_klnwh"]
|
||||||
|
[ext_resource type="PackedScene" uid="uid://0sofmhrl358m" path="res://scene/entity/npc.tscn" id="2_upqk5"]
|
||||||
|
[ext_resource type="PackedScene" uid="uid://jr1yd46wm5je" path="res://scene/entity/note.tscn" id="3_heu4h"]
|
||||||
|
[ext_resource type="PackedScene" uid="uid://61pis75a8fdq" path="res://scene/entity/portal.tscn" id="4_eejqb"]
|
||||||
|
[ext_resource type="PackedScene" uid="uid://wyj4qdjyn4ql" path="res://scene/entity/inspectable.tscn" id="5_pirce"]
|
||||||
|
[ext_resource type="PackedScene" uid="uid://bnf3lkcbpx1ar" path="res://scene/entity/ambush.tscn" id="6_fiskb"]
|
||||||
|
|
||||||
|
[node name="S00" type="Node2D"]
|
||||||
|
|
||||||
|
[node name="Ground" parent="." instance=ExtResource("1_klnwh")]
|
||||||
|
|
||||||
|
[node name="Npc" parent="Ground/DeployLayer" index="0" instance=ExtResource("2_upqk5")]
|
||||||
|
position = Vector2(465, 23)
|
||||||
|
|
||||||
|
[node name="Note" parent="Ground/DeployLayer" index="1" instance=ExtResource("3_heu4h")]
|
||||||
|
position = Vector2(268, -36)
|
||||||
|
notes = Array[String](["(门牌号: 1012)", "(似乎是用血来写的)"])
|
||||||
|
|
||||||
|
[node name="Portal" parent="Ground/DeployLayer" index="2" instance=ExtResource("4_eejqb")]
|
||||||
|
position = Vector2(99, 9)
|
||||||
|
scale = Vector2(1.02941, 1.06667)
|
||||||
|
portal_name = "right"
|
||||||
|
target_scene = "c02_s01"
|
||||||
|
target_portal = "left"
|
||||||
|
|
||||||
|
[node name="Inspectable" parent="Ground/DeployLayer" index="3" instance=ExtResource("5_pirce")]
|
||||||
|
position = Vector2(376, 36)
|
||||||
|
|
||||||
|
[node name="Ambush" parent="Ground/DeployLayer" index="4" instance=ExtResource("6_fiskb")]
|
||||||
|
position = Vector2(567, 28)
|
||||||
|
hook_cg = "c02_胖子说话"
|
||||||
|
|
||||||
|
[editable path="Ground"]
|
@ -1,3 +1,43 @@
|
|||||||
[gd_scene format=3 uid="uid://djc2uaefhmu7"]
|
[gd_scene load_steps=7 format=3 uid="uid://bbs7yy5aofw1v"]
|
||||||
|
|
||||||
|
[ext_resource type="PackedScene" uid="uid://dayyx4jerj7io" path="res://scene/ground/ground.tscn" id="1_gdcov"]
|
||||||
|
[ext_resource type="Texture2D" uid="uid://kc4726andgy2" path="res://asset/art/scene/c02/s01_街道/bg_公寓入口.png" id="2_ni1a4"]
|
||||||
|
[ext_resource type="PackedScene" uid="uid://jr1yd46wm5je" path="res://scene/entity/note.tscn" id="3_6lnxd"]
|
||||||
|
[ext_resource type="PackedScene" uid="uid://61pis75a8fdq" path="res://scene/entity/portal.tscn" id="4_i5pa0"]
|
||||||
|
[ext_resource type="PackedScene" uid="uid://wyj4qdjyn4ql" path="res://scene/entity/inspectable.tscn" id="5_g5fsn"]
|
||||||
|
[ext_resource type="PackedScene" uid="uid://bnf3lkcbpx1ar" path="res://scene/entity/ambush.tscn" id="6_vgxa0"]
|
||||||
|
|
||||||
[node name="S01" type="Node2D"]
|
[node name="S01" type="Node2D"]
|
||||||
|
|
||||||
|
[node name="Ground" parent="." instance=ExtResource("1_gdcov")]
|
||||||
|
|
||||||
|
[node name="BGSprite2D" parent="Ground" index="0"]
|
||||||
|
texture = ExtResource("2_ni1a4")
|
||||||
|
|
||||||
|
[node name="Note" parent="Ground/DeployLayer" index="0" instance=ExtResource("3_6lnxd")]
|
||||||
|
position = Vector2(250, -22)
|
||||||
|
notes = Array[String](["(门牌号: 1012)", "(似乎是用血来写的)"])
|
||||||
|
|
||||||
|
[node name="PortalL" parent="Ground/DeployLayer" index="1" instance=ExtResource("4_i5pa0")]
|
||||||
|
position = Vector2(68, 23)
|
||||||
|
scale = Vector2(1.02941, 1.06667)
|
||||||
|
texture = null
|
||||||
|
|
||||||
|
[node name="Portal" parent="Ground/DeployLayer" index="2" instance=ExtResource("4_i5pa0")]
|
||||||
|
position = Vector2(400, 13)
|
||||||
|
scale = Vector2(1.02941, 1.06667)
|
||||||
|
texture = null
|
||||||
|
portal_name = "1"
|
||||||
|
target_scene = "c02_s02"
|
||||||
|
target_portal = "left"
|
||||||
|
|
||||||
|
[node name="Inspectable" parent="Ground/DeployLayer" index="3" instance=ExtResource("5_g5fsn")]
|
||||||
|
position = Vector2(311, -7)
|
||||||
|
|
||||||
|
[node name="Ambush" parent="Ground/DeployLayer" index="4" instance=ExtResource("6_vgxa0")]
|
||||||
|
position = Vector2(135, 56)
|
||||||
|
|
||||||
|
[node name="FGSprite2D" parent="Ground/ParallaxForeground/FGParallaxLayer" index="0"]
|
||||||
|
texture = null
|
||||||
|
|
||||||
|
[editable path="Ground"]
|
||||||
|
59
scene/ground/scene/c02/s02_走道.tscn
Normal file
59
scene/ground/scene/c02/s02_走道.tscn
Normal file
@ -0,0 +1,59 @@
|
|||||||
|
[gd_scene load_steps=9 format=3 uid="uid://brck77w81fhvc"]
|
||||||
|
|
||||||
|
[ext_resource type="PackedScene" uid="uid://dayyx4jerj7io" path="res://scene/ground/ground.tscn" id="1_wrr6r"]
|
||||||
|
[ext_resource type="Texture2D" uid="uid://c4647gof464ws" path="res://asset/art/scene/c02/s02_走道/bg_过道.png" id="2_cn1s8"]
|
||||||
|
[ext_resource type="PackedScene" uid="uid://jr1yd46wm5je" path="res://scene/entity/note.tscn" id="3_fy0o1"]
|
||||||
|
[ext_resource type="PackedScene" uid="uid://61pis75a8fdq" path="res://scene/entity/portal.tscn" id="4_vwh5u"]
|
||||||
|
[ext_resource type="PackedScene" uid="uid://wyj4qdjyn4ql" path="res://scene/entity/inspectable.tscn" id="5_nhtbp"]
|
||||||
|
[ext_resource type="PackedScene" uid="uid://bnf3lkcbpx1ar" path="res://scene/entity/ambush.tscn" id="6_70vqn"]
|
||||||
|
[ext_resource type="Texture2D" uid="uid://dd0sn5e4hwq5m" path="res://asset/art/scene/c02/s02_走道/e_纸人.png" id="7_xsghn"]
|
||||||
|
|
||||||
|
[sub_resource type="RectangleShape2D" id="RectangleShape2D_0xrg2"]
|
||||||
|
size = Vector2(40, 150)
|
||||||
|
|
||||||
|
[node name="S02" type="Node2D"]
|
||||||
|
|
||||||
|
[node name="Ground" parent="." instance=ExtResource("1_wrr6r")]
|
||||||
|
|
||||||
|
[node name="BGSprite2D" parent="Ground" index="0"]
|
||||||
|
texture = ExtResource("2_cn1s8")
|
||||||
|
|
||||||
|
[node name="Note" parent="Ground/DeployLayer" index="0" instance=ExtResource("3_fy0o1")]
|
||||||
|
position = Vector2(506, 74)
|
||||||
|
notes = Array[String](["(门牌号: 1012)", "(似乎是用血来写的)"])
|
||||||
|
|
||||||
|
[node name="Portal" parent="Ground/DeployLayer" index="1" instance=ExtResource("4_vwh5u")]
|
||||||
|
position = Vector2(18, 54)
|
||||||
|
scale = Vector2(1.02941, 1.06667)
|
||||||
|
texture = null
|
||||||
|
target_scene = "c02_s01"
|
||||||
|
|
||||||
|
[node name="Portal2" parent="Ground/DeployLayer" index="2" instance=ExtResource("4_vwh5u")]
|
||||||
|
position = Vector2(684, 34)
|
||||||
|
texture = null
|
||||||
|
portal_name = "right"
|
||||||
|
target_scene = "c02_s03"
|
||||||
|
target_portal = "left"
|
||||||
|
|
||||||
|
[node name="鼠疫海报" parent="Ground/DeployLayer" index="3" instance=ExtResource("5_nhtbp")]
|
||||||
|
position = Vector2(277, -6)
|
||||||
|
flip_h = true
|
||||||
|
|
||||||
|
[node name="纸人" parent="Ground/DeployLayer" index="4" instance=ExtResource("5_nhtbp")]
|
||||||
|
position = Vector2(601, 44)
|
||||||
|
texture = ExtResource("7_xsghn")
|
||||||
|
flip_h = true
|
||||||
|
|
||||||
|
[node name="StaticBody2D" type="StaticBody2D" parent="Ground/DeployLayer/纸人"]
|
||||||
|
|
||||||
|
[node name="CollisionShape2D" type="CollisionShape2D" parent="Ground/DeployLayer/纸人/StaticBody2D"]
|
||||||
|
shape = SubResource("RectangleShape2D_0xrg2")
|
||||||
|
|
||||||
|
[node name="Ambush" parent="Ground/DeployLayer" index="5" instance=ExtResource("6_70vqn")]
|
||||||
|
position = Vector2(377, 62)
|
||||||
|
hook_cg = "c02_胖子说话"
|
||||||
|
|
||||||
|
[node name="FGSprite2D" parent="Ground/ParallaxForeground/FGParallaxLayer" index="0"]
|
||||||
|
texture = null
|
||||||
|
|
||||||
|
[editable path="Ground"]
|
42
scene/ground/scene/c02/s03_院子切换.tscn
Normal file
42
scene/ground/scene/c02/s03_院子切换.tscn
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
[gd_scene load_steps=7 format=3 uid="uid://djc2uaefhmu7"]
|
||||||
|
|
||||||
|
[ext_resource type="PackedScene" uid="uid://dayyx4jerj7io" path="res://scene/ground/ground.tscn" id="1_lheeb"]
|
||||||
|
[ext_resource type="PackedScene" uid="uid://0sofmhrl358m" path="res://scene/entity/npc.tscn" id="2_r5smg"]
|
||||||
|
[ext_resource type="PackedScene" uid="uid://jr1yd46wm5je" path="res://scene/entity/note.tscn" id="3_6x7xl"]
|
||||||
|
[ext_resource type="PackedScene" uid="uid://61pis75a8fdq" path="res://scene/entity/portal.tscn" id="4_gvtrn"]
|
||||||
|
[ext_resource type="PackedScene" uid="uid://wyj4qdjyn4ql" path="res://scene/entity/inspectable.tscn" id="5_0xh53"]
|
||||||
|
[ext_resource type="PackedScene" uid="uid://bnf3lkcbpx1ar" path="res://scene/entity/ambush.tscn" id="6_gg4jv"]
|
||||||
|
|
||||||
|
[node name="S03" type="Node2D"]
|
||||||
|
|
||||||
|
[node name="Ground" parent="." instance=ExtResource("1_lheeb")]
|
||||||
|
|
||||||
|
[node name="Npc" parent="Ground/DeployLayer" index="0" instance=ExtResource("2_r5smg")]
|
||||||
|
position = Vector2(465, 23)
|
||||||
|
|
||||||
|
[node name="Note" parent="Ground/DeployLayer" index="1" instance=ExtResource("3_6x7xl")]
|
||||||
|
position = Vector2(268, -36)
|
||||||
|
notes = Array[String](["(门牌号: 1012)", "(似乎是用血来写的)"])
|
||||||
|
|
||||||
|
[node name="Portal" parent="Ground/DeployLayer" index="2" instance=ExtResource("4_gvtrn")]
|
||||||
|
position = Vector2(19, 21)
|
||||||
|
scale = Vector2(1.02941, 1.06667)
|
||||||
|
texture = null
|
||||||
|
target_scene = "c02_s02"
|
||||||
|
target_portal = "right"
|
||||||
|
|
||||||
|
[node name="Portal2" parent="Ground/DeployLayer" index="3" instance=ExtResource("4_gvtrn")]
|
||||||
|
position = Vector2(192, 8)
|
||||||
|
scale = Vector2(1.02941, 1.06667)
|
||||||
|
portal_name = "1"
|
||||||
|
target_scene = "c02_s03"
|
||||||
|
target_portal = "left"
|
||||||
|
|
||||||
|
[node name="Inspectable" parent="Ground/DeployLayer" index="4" instance=ExtResource("5_0xh53")]
|
||||||
|
position = Vector2(376, 36)
|
||||||
|
|
||||||
|
[node name="Ambush" parent="Ground/DeployLayer" index="5" instance=ExtResource("6_gg4jv")]
|
||||||
|
position = Vector2(567, 28)
|
||||||
|
hook_cg = "c02_胖子说话"
|
||||||
|
|
||||||
|
[editable path="Ground"]
|
@ -34,7 +34,6 @@ metadata/_edit_use_anchors_ = true
|
|||||||
metadata/_edit_use_anchors_ = true
|
metadata/_edit_use_anchors_ = true
|
||||||
|
|
||||||
[node name="VignetteShading" parent="." instance=ExtResource("2_d1re1")]
|
[node name="VignetteShading" parent="." instance=ExtResource("2_d1re1")]
|
||||||
intensity = 0.1
|
|
||||||
|
|
||||||
[node name="PropInspector2D" parent="." instance=ExtResource("5_ux0rw")]
|
[node name="PropInspector2D" parent="." instance=ExtResource("5_ux0rw")]
|
||||||
|
|
||||||
@ -51,7 +50,7 @@ unique_name_in_owner = true
|
|||||||
position = Vector2(1.66667, 0)
|
position = Vector2(1.66667, 0)
|
||||||
limit_left = 0
|
limit_left = 0
|
||||||
limit_top = -1000
|
limit_top = -1000
|
||||||
limit_right = 1500
|
limit_right = 820
|
||||||
limit_bottom = 1000
|
limit_bottom = 1000
|
||||||
limit_smoothed = true
|
limit_smoothed = true
|
||||||
position_smoothing_enabled = true
|
position_smoothing_enabled = true
|
||||||
|
@ -20,6 +20,8 @@ func test():
|
|||||||
|
|
||||||
|
|
||||||
func show_notification(msg, number):
|
func show_notification(msg, number):
|
||||||
|
if not label:
|
||||||
|
return
|
||||||
if tweening:
|
if tweening:
|
||||||
pending_notifications.append([msg, number])
|
pending_notifications.append([msg, number])
|
||||||
else:
|
else:
|
||||||
|
@ -47,7 +47,7 @@ enum MOVEMENT_STATUS {
|
|||||||
|
|
||||||
|
|
||||||
func _ready() -> void:
|
func _ready() -> void:
|
||||||
_reset_face_direction()
|
# _reset_face_direction()
|
||||||
footstep_timer.timeout.connect(_on_footstep_timer_timeout)
|
footstep_timer.timeout.connect(_on_footstep_timer_timeout)
|
||||||
footstep_timer.stop()
|
footstep_timer.stop()
|
||||||
|
|
||||||
@ -106,6 +106,10 @@ func _check_status(direction) -> bool:
|
|||||||
return true
|
return true
|
||||||
return false
|
return false
|
||||||
|
|
||||||
|
func set_facing_direction(direction: Vector2) -> void:
|
||||||
|
facing_direction = direction
|
||||||
|
# update status
|
||||||
|
_check_status(direction)
|
||||||
|
|
||||||
func _play_animation() -> void:
|
func _play_animation() -> void:
|
||||||
match current_status:
|
match current_status:
|
||||||
|
Loading…
Reference in New Issue
Block a user