mirror of
https://gitee.com/freeyz/godot-mota.git
synced 2025-04-11 16:37:18 +08:00
增加存档和读档功能
This commit is contained in:
parent
4c8fc6e087
commit
ce22c8a9d7
11
Main.gd
11
Main.gd
@ -5,6 +5,7 @@ class_name Main
|
||||
func _ready():
|
||||
connect_player_properties_update()
|
||||
connect_level_update()
|
||||
connect_button()
|
||||
init_bgm()
|
||||
|
||||
func connect_player_properties_update():
|
||||
@ -17,6 +18,10 @@ func connect_player_properties_update():
|
||||
player.connect("blue_key_changed",self,"on_blue_key_changed")
|
||||
player.connect("red_key_changed",self,"on_red_key_changed")
|
||||
|
||||
func connect_button():
|
||||
$"/root/Main/HUD/BottomBackground/VBoxContainer/SaveButton".connect("pressed",self,"on_save_button_clicked")
|
||||
$"/root/Main/HUD/BottomBackground/VBoxContainer/LoadButton".connect("pressed",self,"on_load_button_clicked")
|
||||
|
||||
func connect_level_update():
|
||||
get_level_manager().connect("level_changed",self,"on_level_changed")
|
||||
|
||||
@ -49,6 +54,12 @@ func on_level_changed(level):
|
||||
connect_player_properties_update()
|
||||
get_hud().get_level_view().text = "%s层" % level
|
||||
|
||||
func on_save_button_clicked():
|
||||
get_level_manager().save_persistent(0)
|
||||
|
||||
func on_load_button_clicked():
|
||||
get_level_manager().load_persistent(0)
|
||||
|
||||
func get_hud() -> Hud:
|
||||
return $HUD as Hud
|
||||
|
||||
|
26
Main.tscn
26
Main.tscn
@ -10,71 +10,57 @@
|
||||
[ext_resource path="res://Main.gd" type="Script" id=12]
|
||||
|
||||
[sub_resource type="AtlasTexture" id=1]
|
||||
flags = 4
|
||||
atlas = ExtResource( 7 )
|
||||
region = Rect2( 0, 0, 32, 32 )
|
||||
|
||||
[sub_resource type="AtlasTexture" id=2]
|
||||
flags = 4
|
||||
atlas = ExtResource( 7 )
|
||||
region = Rect2( 0, 96, 32, 32 )
|
||||
|
||||
[sub_resource type="AtlasTexture" id=3]
|
||||
flags = 4
|
||||
atlas = ExtResource( 7 )
|
||||
region = Rect2( 0, 128, 32, 32 )
|
||||
|
||||
[sub_resource type="AtlasTexture" id=4]
|
||||
flags = 4
|
||||
atlas = ExtResource( 7 )
|
||||
region = Rect2( 0, 160, 32, 32 )
|
||||
|
||||
[sub_resource type="AtlasTexture" id=5]
|
||||
flags = 4
|
||||
atlas = ExtResource( 7 )
|
||||
region = Rect2( 0, 192, 32, 32 )
|
||||
|
||||
[sub_resource type="StreamTexture" id=6]
|
||||
flags = 4
|
||||
load_path = "res://.import/icons_old.png-15488db7964fa7b4e69cdc7d96c7bd7f.stex"
|
||||
|
||||
[sub_resource type="AtlasTexture" id=7]
|
||||
flags = 4
|
||||
atlas = SubResource( 6 )
|
||||
region = Rect2( 0, 320, 32, 32 )
|
||||
|
||||
[sub_resource type="AtlasTexture" id=8]
|
||||
flags = 4
|
||||
atlas = SubResource( 6 )
|
||||
region = Rect2( 0, 352, 32, 32 )
|
||||
|
||||
[sub_resource type="AtlasTexture" id=9]
|
||||
flags = 4
|
||||
atlas = SubResource( 6 )
|
||||
region = Rect2( 0, 384, 32, 32 )
|
||||
|
||||
[sub_resource type="AtlasTexture" id=10]
|
||||
flags = 4
|
||||
atlas = SubResource( 6 )
|
||||
region = Rect2( 0, 544, 32, 32 )
|
||||
|
||||
[sub_resource type="AtlasTexture" id=11]
|
||||
flags = 4
|
||||
atlas = SubResource( 6 )
|
||||
region = Rect2( 0, 448, 32, 32 )
|
||||
|
||||
[sub_resource type="AtlasTexture" id=12]
|
||||
flags = 4
|
||||
atlas = SubResource( 6 )
|
||||
region = Rect2( 0, 480, 32, 32 )
|
||||
|
||||
[sub_resource type="AtlasTexture" id=13]
|
||||
flags = 4
|
||||
atlas = SubResource( 6 )
|
||||
region = Rect2( 0, 512, 32, 32 )
|
||||
|
||||
[sub_resource type="AtlasTexture" id=14]
|
||||
flags = 4
|
||||
atlas = SubResource( 6 )
|
||||
region = Rect2( 0, 544, 32, 32 )
|
||||
|
||||
@ -95,9 +81,9 @@ __meta__ = {
|
||||
|
||||
[node name="GridContainer" type="GridContainer" parent="HUD/HeaderBackground"]
|
||||
margin_left = 16.0
|
||||
margin_top = 1.0
|
||||
margin_top = 14.0
|
||||
margin_right = 398.0
|
||||
margin_bottom = 33.0
|
||||
margin_bottom = 46.0
|
||||
columns = 6
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
@ -170,9 +156,9 @@ __meta__ = {
|
||||
|
||||
[node name="GridContainer2" type="GridContainer" parent="HUD/HeaderBackground"]
|
||||
margin_left = 16.0
|
||||
margin_top = 33.0
|
||||
margin_top = 54.0
|
||||
margin_right = 268.0
|
||||
margin_bottom = 65.0
|
||||
margin_bottom = 86.0
|
||||
columns = 4
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
@ -223,9 +209,9 @@ __meta__ = {
|
||||
|
||||
[node name="GridContainer3" type="GridContainer" parent="HUD/HeaderBackground"]
|
||||
margin_left = 268.0
|
||||
margin_top = 33.0
|
||||
margin_top = 54.0
|
||||
margin_right = 360.0
|
||||
margin_bottom = 65.0
|
||||
margin_bottom = 86.0
|
||||
columns = 3
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
|
@ -20,7 +20,7 @@ compress/hdr_mode=0
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=true
|
||||
flags/filter=false
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
@ -30,5 +30,5 @@ process/HDR_as_SRGB=false
|
||||
process/invert_color=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=true
|
||||
detect_3d=false
|
||||
svg/scale=1.0
|
||||
|
@ -20,7 +20,7 @@ compress/hdr_mode=0
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=true
|
||||
flags/filter=false
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
@ -30,5 +30,5 @@ process/HDR_as_SRGB=false
|
||||
process/invert_color=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=true
|
||||
detect_3d=false
|
||||
svg/scale=1.0
|
||||
|
@ -23,7 +23,7 @@ flags/repeat=0
|
||||
flags/filter=false
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
flags/srgb=0
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
|
@ -20,7 +20,7 @@ compress/hdr_mode=0
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=true
|
||||
flags/filter=false
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
@ -30,5 +30,5 @@ process/HDR_as_SRGB=false
|
||||
process/invert_color=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=true
|
||||
detect_3d=false
|
||||
svg/scale=1.0
|
||||
|
@ -20,7 +20,7 @@ compress/hdr_mode=0
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=true
|
||||
flags/filter=false
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
@ -30,5 +30,5 @@ process/HDR_as_SRGB=false
|
||||
process/invert_color=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=true
|
||||
detect_3d=false
|
||||
svg/scale=1.0
|
||||
|
@ -20,7 +20,7 @@ compress/hdr_mode=0
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=true
|
||||
flags/filter=false
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
@ -30,5 +30,5 @@ process/HDR_as_SRGB=false
|
||||
process/invert_color=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=true
|
||||
detect_3d=false
|
||||
svg/scale=1.0
|
||||
|
@ -20,7 +20,7 @@ compress/hdr_mode=0
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=true
|
||||
flags/filter=false
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
@ -30,5 +30,5 @@ process/HDR_as_SRGB=false
|
||||
process/invert_color=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=true
|
||||
detect_3d=false
|
||||
svg/scale=1.0
|
||||
|
@ -20,7 +20,7 @@ compress/hdr_mode=0
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=true
|
||||
flags/filter=false
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
@ -30,5 +30,5 @@ process/HDR_as_SRGB=false
|
||||
process/invert_color=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=true
|
||||
detect_3d=false
|
||||
svg/scale=1.0
|
||||
|
@ -21,14 +21,14 @@ compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=false
|
||||
flags/mipmaps=1
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=0
|
||||
flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
process/invert_color=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=true
|
||||
detect_3d=false
|
||||
svg/scale=1.0
|
||||
|
@ -20,7 +20,7 @@ compress/hdr_mode=0
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=true
|
||||
flags/filter=false
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
@ -30,5 +30,5 @@ process/HDR_as_SRGB=false
|
||||
process/invert_color=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=true
|
||||
detect_3d=false
|
||||
svg/scale=1.0
|
||||
|
@ -20,7 +20,7 @@ compress/hdr_mode=0
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=true
|
||||
flags/filter=false
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
@ -30,5 +30,5 @@ process/HDR_as_SRGB=false
|
||||
process/invert_color=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=true
|
||||
detect_3d=false
|
||||
svg/scale=1.0
|
||||
|
@ -20,7 +20,7 @@ compress/hdr_mode=0
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=true
|
||||
flags/filter=false
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
@ -30,5 +30,5 @@ process/HDR_as_SRGB=false
|
||||
process/invert_color=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=true
|
||||
detect_3d=false
|
||||
svg/scale=1.0
|
||||
|
@ -20,7 +20,7 @@ compress/hdr_mode=0
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=true
|
||||
flags/filter=false
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
@ -30,5 +30,5 @@ process/HDR_as_SRGB=false
|
||||
process/invert_color=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=true
|
||||
detect_3d=false
|
||||
svg/scale=1.0
|
||||
|
@ -20,7 +20,7 @@ compress/hdr_mode=0
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=true
|
||||
flags/filter=false
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
@ -30,5 +30,5 @@ process/HDR_as_SRGB=false
|
||||
process/invert_color=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=true
|
||||
detect_3d=false
|
||||
svg/scale=1.0
|
||||
|
@ -7,7 +7,7 @@ custom_features=""
|
||||
export_filter="all_resources"
|
||||
include_filter=""
|
||||
exclude_filter=""
|
||||
export_path=""
|
||||
export_path="../../export/mota/index.html"
|
||||
patch_list=PoolStringArray( )
|
||||
script_export_mode=1
|
||||
script_encryption_key=""
|
||||
@ -15,8 +15,8 @@ script_encryption_key=""
|
||||
[preset.0.options]
|
||||
|
||||
vram_texture_compression/for_desktop=true
|
||||
vram_texture_compression/for_mobile=false
|
||||
vram_texture_compression/for_mobile=true
|
||||
html/custom_html_shell=""
|
||||
html/head_include=""
|
||||
custom_template/release=""
|
||||
custom_template/debug=""
|
||||
custom_template/release="D:/godot/source/godot/bin/godot.javascript.opt.64.zip"
|
||||
custom_template/debug="D:/godot/source/godot/bin/godot.javascript.opt.64.zip"
|
||||
|
@ -133,4 +133,5 @@ texture={
|
||||
|
||||
quality/driver/driver_name="GLES2"
|
||||
quality/2d/use_pixel_snap=true
|
||||
vram_compression/import_etc=true
|
||||
environment/default_environment="res://settings/default_env.tres"
|
||||
|
@ -5,3 +5,7 @@ class_name LevelInstance
|
||||
# 获取当前玩家
|
||||
func get_player() -> Player:
|
||||
return $Player as Player
|
||||
|
||||
# 获取楼层数
|
||||
func get_level() -> int:
|
||||
return name.replace("Level","") as int
|
||||
|
@ -29,15 +29,18 @@ func set_level(next_level:int):
|
||||
#保存数据
|
||||
save_instance_to_local()
|
||||
save_data_to_local()
|
||||
load_data(next_level)
|
||||
|
||||
func load_data(next_level:int):
|
||||
#加载数据
|
||||
var next_scene = load_scene_from_local(next_level)
|
||||
var next_scene = load_scene_from_local(next_level) as LevelInstance
|
||||
add_child(next_scene)
|
||||
get_current_level_instance().free()
|
||||
load_data_from_local(next_level)
|
||||
#设置数据
|
||||
level = next_level
|
||||
emit_signal("level_changed",next_level)
|
||||
|
||||
|
||||
# 设置楼层和位置
|
||||
func set_level_and_position(next_level:int,position:Vector2):
|
||||
set_level(next_level)
|
||||
@ -90,3 +93,60 @@ func load_data_from_local(next_level:int):
|
||||
data = {}
|
||||
for node in get_tree().get_nodes_in_group(group_name):
|
||||
node.load_data(data,global)
|
||||
|
||||
# 持久化数据
|
||||
func save_persistent(index:int)->void:
|
||||
#保存当前场景
|
||||
save_instance_to_local()
|
||||
save_data_to_local()
|
||||
#保存当前楼层
|
||||
var file = File.new()
|
||||
var dir = Directory.new()
|
||||
var dest_dir = "user://%s/" % index
|
||||
dir.make_dir(dest_dir)
|
||||
file.open(dest_dir + "level.data",File.WRITE)
|
||||
file.store_32(self.level)
|
||||
file.store_var(self.global,true)
|
||||
file.close()
|
||||
#迁移数据到持久化目录
|
||||
if dir.open(tmp_level_scene_path) == OK:
|
||||
dir.list_dir_begin()
|
||||
var file_name = dir.get_next()
|
||||
while file_name != "":
|
||||
if dir.current_is_dir():
|
||||
print("Found directory: " + file_name)
|
||||
else:
|
||||
var copy_result = dir.copy(tmp_level_scene_path + file_name,dest_dir + file_name)
|
||||
if copy_result != OK:
|
||||
print("保存存档失败",copy_result)
|
||||
file_name = dir.get_next()
|
||||
else:
|
||||
print("An error occurred when trying to access the path.")
|
||||
|
||||
# 加载持久化数据
|
||||
func load_persistent(index:int)->void:
|
||||
var file = File.new()
|
||||
var dir = Directory.new()
|
||||
var dest_dir = "user://%s/" % index
|
||||
dir.remove(tmp_level_scene_path)
|
||||
dir.make_dir(tmp_level_scene_path)
|
||||
#迁移持久化目录到临时目录
|
||||
if dir.open(dest_dir) == OK:
|
||||
dir.list_dir_begin()
|
||||
var file_name = dir.get_next()
|
||||
while file_name != "":
|
||||
if dir.current_is_dir():
|
||||
print("Found directory: " + file_name)
|
||||
else:
|
||||
var copy_result = dir.copy(dest_dir + file_name,tmp_level_scene_path + file_name)
|
||||
if copy_result != OK:
|
||||
print("读取存档失败",copy_result)
|
||||
file_name = dir.get_next()
|
||||
else:
|
||||
print("An error occurred when trying to access the path.")
|
||||
#读取楼层
|
||||
file.open(dest_dir + "level.data",File.READ)
|
||||
var level = file.get_32()
|
||||
self.global = file.get_var(true)
|
||||
file.close()
|
||||
load_data(level)
|
||||
|
@ -190,10 +190,12 @@ position = Vector2( 48, 464 )
|
||||
[node name="MonsterSprite" parent="Items" instance=ExtResource( 14 )]
|
||||
position = Vector2( 208, 176 )
|
||||
animation = "blueGuard"
|
||||
frame = 0
|
||||
|
||||
[node name="MonsterSprite2" parent="Items" instance=ExtResource( 14 )]
|
||||
position = Vector2( 272, 176 )
|
||||
animation = "blueGuard"
|
||||
frame = 0
|
||||
|
||||
[node name="Thief" type="StaticBody2D" parent="."]
|
||||
position = Vector2( 112, 336 )
|
||||
|
@ -1,4 +1,4 @@
|
||||
[gd_scene load_steps=9 format=2]
|
||||
[gd_scene load_steps=18 format=2]
|
||||
|
||||
[ext_resource path="res://src/level/LevelInstance.gd" type="Script" id=1]
|
||||
[ext_resource path="res://src/navigation/NavigationTileMap.gd" type="Script" id=2]
|
||||
@ -7,6 +7,15 @@
|
||||
[ext_resource path="res://src/stairs/StairsDown.tscn" type="PackedScene" id=5]
|
||||
[ext_resource path="res://assets/images/enemys.png" type="Texture" id=6]
|
||||
[ext_resource path="res://src/plot/HitPlot.gd" type="Script" id=7]
|
||||
[ext_resource path="res://src/door/YellowDoor.tscn" type="PackedScene" id=8]
|
||||
[ext_resource path="res://src/stairs/StairsUp.tscn" type="PackedScene" id=9]
|
||||
[ext_resource path="res://src/props/BlueKey.tscn" type="PackedScene" id=10]
|
||||
[ext_resource path="res://src/props/YellowKey.tscn" type="PackedScene" id=11]
|
||||
[ext_resource path="res://src/props/BlueDrug.tscn" type="PackedScene" id=12]
|
||||
[ext_resource path="res://src/props/RedDrug.tscn" type="PackedScene" id=13]
|
||||
[ext_resource path="res://src/props/BlueGemstone.tscn" type="PackedScene" id=14]
|
||||
[ext_resource path="res://src/props/RedGemstone.tscn" type="PackedScene" id=15]
|
||||
[ext_resource path="res://src/monster/Monster.tscn" type="PackedScene" id=16]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id=1]
|
||||
extents = Vector2( 0, 0.1 )
|
||||
@ -27,9 +36,111 @@ changed_cells = {
|
||||
|
||||
}
|
||||
|
||||
[node name="Stairs" parent="NavigationTileMap" instance=ExtResource( 5 )]
|
||||
[node name="Items" type="Node2D" parent="."]
|
||||
|
||||
[node name="Stairs" parent="Items" instance=ExtResource( 5 )]
|
||||
position = Vector2( 48, 464 )
|
||||
|
||||
[node name="YellowDoor" parent="Items" instance=ExtResource( 8 )]
|
||||
position = Vector2( 48, 304 )
|
||||
|
||||
[node name="YellowDoor2" parent="Items" instance=ExtResource( 8 )]
|
||||
position = Vector2( 48, 240 )
|
||||
|
||||
[node name="YellowDoor3" parent="Items" instance=ExtResource( 8 )]
|
||||
position = Vector2( 304, 176 )
|
||||
|
||||
[node name="YellowDoor4" parent="Items" instance=ExtResource( 8 )]
|
||||
position = Vector2( 304, 368 )
|
||||
|
||||
[node name="PlayerProps2" parent="Items" instance=ExtResource( 10 )]
|
||||
position = Vector2( 176, 208 )
|
||||
|
||||
[node name="PlayerProps7" parent="Items" instance=ExtResource( 12 )]
|
||||
position = Vector2( 144, 176 )
|
||||
|
||||
[node name="PlayerProps8" parent="Items" instance=ExtResource( 12 )]
|
||||
position = Vector2( 176, 144 )
|
||||
|
||||
[node name="PlayerProps9" parent="Items" instance=ExtResource( 12 )]
|
||||
position = Vector2( 208, 176 )
|
||||
|
||||
[node name="YellowKey" parent="Items" instance=ExtResource( 11 )]
|
||||
position = Vector2( 176, 176 )
|
||||
|
||||
[node name="BlueGemstone" parent="Items" instance=ExtResource( 14 )]
|
||||
position = Vector2( 80, 144 )
|
||||
|
||||
[node name="YellowKey7" parent="Items" instance=ExtResource( 11 )]
|
||||
position = Vector2( 48, 144 )
|
||||
|
||||
[node name="YellowKey2" parent="Items" instance=ExtResource( 11 )]
|
||||
position = Vector2( 144, 208 )
|
||||
|
||||
[node name="YellowKey3" parent="Items" instance=ExtResource( 11 )]
|
||||
position = Vector2( 208, 208 )
|
||||
|
||||
[node name="YellowKey4" parent="Items" instance=ExtResource( 11 )]
|
||||
position = Vector2( 208, 144 )
|
||||
|
||||
[node name="YellowKey5" parent="Items" instance=ExtResource( 11 )]
|
||||
position = Vector2( 144, 144 )
|
||||
|
||||
[node name="YellowKey8" parent="Items" instance=ExtResource( 11 )]
|
||||
position = Vector2( 80, 368 )
|
||||
|
||||
[node name="Stairs2" parent="Items" instance=ExtResource( 9 )]
|
||||
position = Vector2( 368, 464 )
|
||||
|
||||
[node name="MonsterSprite" parent="Items" instance=ExtResource( 16 )]
|
||||
position = Vector2( 240, 272 )
|
||||
|
||||
[node name="MonsterSprite2" parent="Items" instance=ExtResource( 16 )]
|
||||
position = Vector2( 112, 272 )
|
||||
animation = "bat"
|
||||
frame = 0
|
||||
|
||||
[node name="MonsterSprite6" parent="Items" instance=ExtResource( 16 )]
|
||||
position = Vector2( 336, 176 )
|
||||
animation = "bat"
|
||||
frame = 0
|
||||
|
||||
[node name="MonsterSprite3" parent="Items" instance=ExtResource( 16 )]
|
||||
position = Vector2( 48, 208 )
|
||||
animation = "bluePriest"
|
||||
frame = 0
|
||||
|
||||
[node name="MonsterSprite5" parent="Items" instance=ExtResource( 16 )]
|
||||
position = Vector2( 336, 368 )
|
||||
animation = "bluePriest"
|
||||
frame = 0
|
||||
|
||||
[node name="MonsterSprite4" parent="Items" instance=ExtResource( 16 )]
|
||||
position = Vector2( 48, 336 )
|
||||
animation = "skeleton"
|
||||
frame = 0
|
||||
|
||||
[node name="YellowDoor5" parent="Items" instance=ExtResource( 8 )]
|
||||
position = Vector2( 304, 464 )
|
||||
|
||||
[node name="PlayerProps4" parent="Items" instance=ExtResource( 13 )]
|
||||
position = Vector2( 48, 400 )
|
||||
|
||||
[node name="PlayerProps5" parent="Items" instance=ExtResource( 13 )]
|
||||
position = Vector2( 368, 144 )
|
||||
|
||||
[node name="YellowKey6" parent="Items" instance=ExtResource( 11 )]
|
||||
position = Vector2( 368, 368 )
|
||||
|
||||
[node name="PlayerProps6" parent="Items" instance=ExtResource( 13 )]
|
||||
position = Vector2( 368, 336 )
|
||||
|
||||
[node name="PlayerProps10" parent="Items" instance=ExtResource( 13 )]
|
||||
position = Vector2( 80, 176 )
|
||||
|
||||
[node name="RedGemstone" parent="Items" instance=ExtResource( 15 )]
|
||||
position = Vector2( 80, 400 )
|
||||
|
||||
[node name="Player" parent="." instance=ExtResource( 4 )]
|
||||
position = Vector2( 80, 464 )
|
||||
|
||||
|
@ -75,37 +75,37 @@ tracks/0/keys = {
|
||||
"values": [ 12, 13, 14, 15 ]
|
||||
}
|
||||
|
||||
[sub_resource type="AnimationNodeTimeScale" id=12]
|
||||
|
||||
[sub_resource type="AnimationNodeAnimation" id=6]
|
||||
animation = "left"
|
||||
[sub_resource type="AnimationNodeTimeScale" id=6]
|
||||
|
||||
[sub_resource type="AnimationNodeAnimation" id=7]
|
||||
animation = "up"
|
||||
animation = "left"
|
||||
|
||||
[sub_resource type="AnimationNodeAnimation" id=8]
|
||||
animation = "down"
|
||||
animation = "up"
|
||||
|
||||
[sub_resource type="AnimationNodeAnimation" id=9]
|
||||
animation = "down"
|
||||
|
||||
[sub_resource type="AnimationNodeAnimation" id=10]
|
||||
animation = "right"
|
||||
|
||||
[sub_resource type="AnimationNodeBlendSpace2D" id=10]
|
||||
blend_point_0/node = SubResource( 6 )
|
||||
[sub_resource type="AnimationNodeBlendSpace2D" id=11]
|
||||
blend_point_0/node = SubResource( 7 )
|
||||
blend_point_0/pos = Vector2( -1, 0 )
|
||||
blend_point_1/node = SubResource( 7 )
|
||||
blend_point_1/node = SubResource( 8 )
|
||||
blend_point_1/pos = Vector2( 0, -1 )
|
||||
blend_point_2/node = SubResource( 8 )
|
||||
blend_point_2/node = SubResource( 9 )
|
||||
blend_point_2/pos = Vector2( 0, 1 )
|
||||
blend_point_3/node = SubResource( 9 )
|
||||
blend_point_3/node = SubResource( 10 )
|
||||
blend_point_3/pos = Vector2( 1, 0 )
|
||||
blend_mode = 1
|
||||
|
||||
[sub_resource type="AnimationNodeBlendTree" id=11]
|
||||
[sub_resource type="AnimationNodeBlendTree" id=12]
|
||||
graph_offset = Vector2( -55, 58 )
|
||||
nodes/TimeScale/node = SubResource( 12 )
|
||||
nodes/TimeScale/node = SubResource( 6 )
|
||||
nodes/TimeScale/position = Vector2( 220, 100 )
|
||||
nodes/output/position = Vector2( 420, 100 )
|
||||
nodes/player/node = SubResource( 10 )
|
||||
nodes/player/node = SubResource( 11 )
|
||||
nodes/player/position = Vector2( 0, 100 )
|
||||
node_connections = [ "output", 0, "TimeScale", "TimeScale", 0, "player" ]
|
||||
|
||||
@ -135,7 +135,7 @@ script = ExtResource( 1 )
|
||||
duration = 0.1
|
||||
|
||||
[node name="AnimationTree" type="AnimationTree" parent="."]
|
||||
tree_root = SubResource( 11 )
|
||||
tree_root = SubResource( 12 )
|
||||
anim_player = NodePath("../AnimationPlayer")
|
||||
parameters/TimeScale/scale = 10.0
|
||||
parameters/player/blend_position = Vector2( 0, 0 )
|
||||
|
Loading…
x
Reference in New Issue
Block a user