关卡连接关系测试

master
chendian 2 years ago
parent cda4f6d74e
commit aab9e30783

@ -126,7 +126,6 @@ func get_explored_ratio(layer := -1):
## [br][br][param position] should be position in the room's coordinates, i.e. with [code](0, 0)[/code] being the top-left corner of the scene assigned to the room (which in most cases simply equals to global position of the player).
func set_player_position(position: Vector2):
exact_player_position = position
var player_pos := Vector2i((position / settings.in_game_cell_size).floor()) + current_room.min_cell
var player_pos_3d := Vector3i(player_pos.x, player_pos.y, current_layer)
if player_pos_3d != last_player_position:

@ -48,7 +48,6 @@ window/size/viewport_width=640
window/size/viewport_height=360
window/size/always_on_top=true
window/stretch/mode="canvas_items"
window/stretch/aspect="keep_width"
window/stretch/scale_mode="integer"
[editor]

Binary file not shown.

@ -0,0 +1,18 @@
[remap]
importer="MagicaVoxel.With.Extensions.To.Mesh"
type="Mesh"
uid="uid://7gy8vxvh5jqa"
path="res://.godot/imported/window1.vox-7c2fd104eec3b8fedfd530461eeebc53.mesh"
[deps]
source_file="res://resource/mesh_level/window1.vox"
dest_files=["res://.godot/imported/window1.vox-7c2fd104eec3b8fedfd530461eeebc53.mesh"]
[params]
Scale=0.02
GreedyMeshGenerator=true
SnapToGround=false
FirstKeyframeOnly=true

Binary file not shown.

@ -0,0 +1,18 @@
[remap]
importer="MagicaVoxel.With.Extensions.To.Mesh"
type="Mesh"
uid="uid://b20130pl5hfvy"
path="res://.godot/imported/window2.vox-ac912af7740998671332b09c16515e4a.mesh"
[deps]
source_file="res://resource/mesh_level/window2.vox"
dest_files=["res://.godot/imported/window2.vox-ac912af7740998671332b09c16515e4a.mesh"]
[params]
Scale=0.02
GreedyMeshGenerator=true
SnapToGround=false
FirstKeyframeOnly=true

File diff suppressed because one or more lines are too long

@ -1,8 +1,10 @@
[gd_scene load_steps=7 format=3 uid="uid://b3rp0a5do2mm6"]
[gd_scene load_steps=9 format=3 uid="uid://b3rp0a5do2mm6"]
[ext_resource type="ArrayMesh" uid="uid://caii2ypk4lb1k" path="res://resource/mesh_level/block_center.vox" id="1_8nl8s"]
[ext_resource type="ArrayMesh" uid="uid://c6g1c31dd86yp" path="res://resource/mesh_level/block_corner.vox" id="2_870el"]
[ext_resource type="ArrayMesh" uid="uid://d1awgblbh4vmq" path="res://resource/mesh_level/block_edge.vox" id="3_0q8sx"]
[ext_resource type="ArrayMesh" uid="uid://7gy8vxvh5jqa" path="res://resource/mesh_level/window1.vox" id="4_glrv6"]
[ext_resource type="ArrayMesh" uid="uid://b20130pl5hfvy" path="res://resource/mesh_level/window2.vox" id="5_7lr01"]
[sub_resource type="ConcavePolygonShape3D" id="ConcavePolygonShape3D_stlyj"]
data = PackedVector3Array(-0.32, 0.32, -0.32, 0.32, 0.32, -0.32, 0.32, 0.32, 0.32, 0.32, 0.32, 0.32, -0.32, 0.32, 0.32, -0.32, 0.32, -0.32, 0.32, -0.32, 0.32, 0.32, -0.32, -0.32, -0.32, -0.32, -0.32, -0.32, -0.32, -0.32, -0.32, -0.32, 0.32, 0.32, -0.32, 0.32, -0.32, 0.32, -0.32, -0.32, 0.32, 0.32, -0.32, -0.32, 0.32, -0.32, -0.32, 0.32, -0.32, -0.32, -0.32, -0.32, 0.32, -0.32, 0.32, 0.32, -0.32, 0.32, -0.32, -0.32, 0.32, -0.32, 0.32, 0.32, -0.32, 0.32, 0.32, 0.32, 0.32, 0.32, 0.32, -0.32, -0.32, -0.32, 0.32, -0.32, 0.32, 0.32, 0.32, 0.32, 0.32, 0.32, 0.32, 0.32, 0.32, -0.32, 0.32, -0.32, -0.32, 0.32, 0.32, 0.32, -0.32, -0.32, 0.32, -0.32, -0.32, -0.32, -0.32, -0.32, -0.32, -0.32, 0.32, -0.32, -0.32, 0.32, 0.32, -0.32)
@ -15,7 +17,15 @@ data = PackedVector3Array(-0.32, 0.32, -0.32, -0.3, 0.32, -0.32, -0.3, 0.32, 0.3
[node name="MeshLibrary" type="Node3D"]
[node name="BlockAirWall" type="MeshInstance3D" parent="."]
[node name="StaticBody3D" type="StaticBody3D" parent="BlockAirWall"]
[node name="CollisionShape3D" type="CollisionShape3D" parent="BlockAirWall/StaticBody3D"]
shape = SubResource("ConcavePolygonShape3D_stlyj")
[node name="BlockCenter" type="MeshInstance3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 1, 0, 0)
mesh = ExtResource("1_8nl8s")
[node name="StaticBody3D" type="StaticBody3D" parent="BlockCenter"]
@ -24,6 +34,7 @@ mesh = ExtResource("1_8nl8s")
shape = SubResource("ConcavePolygonShape3D_stlyj")
[node name="BlockCorner" type="MeshInstance3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 2, 0, 0)
mesh = ExtResource("2_870el")
[node name="StaticBody3D" type="StaticBody3D" parent="BlockCorner"]
@ -32,9 +43,20 @@ mesh = ExtResource("2_870el")
shape = SubResource("ConcavePolygonShape3D_urjlt")
[node name="BlockEdge" type="MeshInstance3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 3, 0, 0)
mesh = ExtResource("3_0q8sx")
[node name="StaticBody3D" type="StaticBody3D" parent="BlockEdge"]
[node name="CollisionShape3D" type="CollisionShape3D" parent="BlockEdge/StaticBody3D"]
shape = SubResource("ConcavePolygonShape3D_wreew")
[node name="Window" type="MeshInstance3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1)
cast_shadow = 0
mesh = ExtResource("4_glrv6")
[node name="Window2" type="MeshInstance3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 1, 0, 1)
cast_shadow = 0
mesh = ExtResource("5_7lr01")

@ -1,8 +1,9 @@
[gd_scene load_steps=4 format=3 uid="uid://ba7pkdaq5y8nl"]
[gd_scene load_steps=5 format=3 uid="uid://ba7pkdaq5y8nl"]
[ext_resource type="PackedScene" uid="uid://ksxwg0alt2us" path="res://scene/character/character.tscn" id="1_pot50"]
[ext_resource type="Script" path="res://script/character/player/combo.gd" id="2_i44w8"]
[ext_resource type="Script" path="res://script/character/player/player_input.gd" id="3_n07go"]
[ext_resource type="Script" path="res://script/character/player/player_info.gd" id="4_mi1lk"]
[node name="Character" instance=ExtResource("1_pot50")]
@ -17,3 +18,6 @@ script = ExtResource("3_n07go")
[node name="Combo" type="Node3D" parent="." index="9"]
unique_name_in_owner = true
script = ExtResource("2_i44w8")
[node name="PlayerInfo" type="Node3D" parent="." index="10"]
script = ExtResource("4_mi1lk")

@ -1,27 +0,0 @@
[gd_scene load_steps=3 format=3 uid="uid://cmyn7g0lp71uj"]
[ext_resource type="PackedScene" uid="uid://do7abukgd54js" path="res://addons/MetroidvaniaSystem/Nodes/RoomInstance.tscn" id="1_y5r6k"]
[ext_resource type="MeshLibrary" uid="uid://bbya6804fmu42" path="res://resource/mesh_library/default.tres" id="2_qmegy"]
[node name="Level" type="Node3D"]
[node name="RoomInstance" parent="." instance=ExtResource("1_y5r6k")]
[node name="Light" type="Node3D" parent="."]
[node name="DirectionalLight3D" type="DirectionalLight3D" parent="Light"]
transform = Transform3D(0.707107, -0.5, 0.5, 0, 0.707107, 0.707107, -0.707107, -0.5, 0.5, 0, 0, 0)
[node name="Ground" type="CSGBox3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 6.4, -1, 7.2)
use_collision = true
size = Vector3(12.8, 2, 14.4)
[node name="GridMap" type="GridMap" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0.4)
mesh_library = ExtResource("2_qmegy")
cell_size = Vector3(0.64, 0.64, 0.64)
data = {
"cells": PackedInt32Array(0, 1, 655362, 0, 0, 0, 19, 1, 0, 19, 0, 0, 19, 2, 0, 19, 3, 0, 19, 7, 0, 19, 8, 0, 19, 9, 0, 19, 10, 0, 0, 2, 655362, 0, 3, 655362, 0, 9, 655362, 0, 5, 655362, 0, 4, 655362, 0, 10, 0, 0, 65535, 1376258, 1, 65535, 1376258, 2, 65535, 1376258, 3, 65535, 1376258, 4, 65535, 1376258, 5, 65535, 1376258, 6, 65535, 1376258, 7, 65535, 1376258, 8, 65535, 1376258, 9, 65535, 1376258, 12, 65535, 1376258, 13, 65535, 1376258, 14, 65535, 1376258, 15, 65535, 1376258, 16, 65535, 1376258, 17, 65535, 1376258, 18, 65535, 1376258, 19, 65535, 1376258, 19, 11, 2, 19, 12, 2, 19, 13, 2, 19, 14, 2, 19, 15, 2, 19, 16, 2, 19, 17, 2, 19, 18, 2, 19, 19, 2, 19, 20, 2, 19, 21, 2, 17, 21, 0, 18, 21, 0, 16, 21, 0, 15, 21, 0, 14, 21, 0, 13, 21, 0, 12, 21, 0, 7, 21, 0, 6, 21, 0, 5, 21, 0, 4, 21, 0, 3, 21, 0, 2, 21, 0, 1, 21, 0, 0, 21, 0, 0, 20, 0, 0, 19, 0, 0, 18, 0, 0, 17, 0, 0, 16, 0, 0, 15, 0, 0, 14, 0, 0, 13, 0, 65535, 13, 0, 0, 11, 0, 0, 12, 0)
}
metadata/_editor_floor_ = Vector3(0, 0, 0)

@ -0,0 +1,37 @@
[gd_scene load_steps=3 format=3 uid="uid://blcei7idgavbg"]
[ext_resource type="PackedScene" uid="uid://do7abukgd54js" path="res://addons/MetroidvaniaSystem/Nodes/RoomInstance.tscn" id="1_pwg14"]
[ext_resource type="MeshLibrary" uid="uid://bbya6804fmu42" path="res://resource/mesh_library/default.tres" id="2_4ejwk"]
[node name="Level" type="Node3D"]
[node name="RoomInstance" parent="." instance=ExtResource("1_pwg14")]
[node name="Light" type="Node3D" parent="."]
[node name="DirectionalLight3D" type="DirectionalLight3D" parent="Light"]
transform = Transform3D(0.707107, -0.5, 0.5, 0, 0.707107, 0.707107, -0.707107, -0.5, 0.5, 4.395, 4.76584, 0)
light_energy = 0.738
shadow_enabled = true
shadow_transmittance_bias = -16.0
shadow_opacity = 0.5
shadow_blur = 0.0
[node name="OmniLight3D" type="OmniLight3D" parent="Light"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 1.65528, 1.65104, 2.25257)
visible = false
omni_range = 12.6107
[node name="Ground" type="CSGBox3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 6.4, -1, 3.6)
use_collision = true
size = Vector3(12.8, 2, 7.2)
[node name="GridMap" type="GridMap" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0.4)
mesh_library = ExtResource("2_4ejwk")
cell_size = Vector3(0.64, 0.64, 0.64)
data = {
"cells": PackedInt32Array(0, 1, 917504, 0, 0, 917504, 19, 1, 917504, 19, 0, 917504, 19, 2, 0, 19, 3, 0, 19, 7, 917504, 19, 8, 0, 19, 9, 0, 19, 10, 0, 18, 10, 0, 17, 10, 0, 16, 10, 0, 0, 2, 917504, 0, 3, 917504, 0, 9, 917504, 0, 5, 917504, 0, 4, 917504, 15, 10, 0, 14, 10, 0, 13, 10, 0, 12, 10, 0, 11, 10, 0, 8, 10, 0, 7, 10, 0, 6, 10, 0, 5, 10, 0, 4, 10, 0, 3, 10, 0, 2, 10, 0, 1, 10, 0, 0, 10, 0, 0, 65535, 917504, 1, 65535, 917504, 2, 65535, 917504, 3, 65535, 917504, 4, 65535, 917504, 5, 65535, 917504, 6, 65535, 917504, 7, 65535, 917504, 8, 65535, 917504, 9, 65535, 917504, 12, 65535, 917504, 13, 65535, 917504, 14, 65535, 917504, 15, 65535, 917504, 16, 65535, 917504, 65549, 65535, 917507, 65550, 65535, 917507, 65551, 65535, 917507, 65552, 65535, 917507, 65553, 65535, 917507, 65554, 65535, 917507, 131084, 65535, 917507, 131085, 65535, 917507, 131086, 65535, 917507, 131087, 65535, 917507, 131088, 65535, 917507, 131089, 65535, 917507, 131090, 65535, 917507, 9, 10, 917504, 10, 10, 917504, 19, 6, 917504, 19, 5, 917504, 19, 4, 917504, 19, 65535, 917504, 18, 65535, 917504, 17, 65535, 917504, 11, 65535, 917504, 10, 65535, 917504, 0, 6, 917504, 0, 7, 917504, 0, 8, 917504, 65545, 65535, 917504, 131081, 65535, 917504, 131080, 65535, 917504, 131079, 65535, 917504, 131078, 65535, 917504, 131077, 65535, 917504, 131076, 65535, 917504, 131075, 65535, 917504, 131074, 65535, 917504, 131073, 65535, 917504, 131072, 65535, 917504, 65544, 65535, 917504, 65543, 65535, 917504, 65634, 7, 917504, 65542, 65535, 917504, 65541, 65535, 917504, 65540, 65535, 917504, 65538, 65535, 917504, 65537, 65535, 917504, 65536, 65535, 917504, 65539, 65535, 917504, 65547, 65535, 917507, 65546, 65535, 917507, 65548, 65535, 917507, 131083, 65535, 917507, 131082, 65535, 917507, 196609, 65535, 786432, 196610, 65535, 786432, 196613, 65535, 196608, 196616, 65535, 196608, 196615, 65535, 196608, 196612, 65535, 196608, 196611, 65535, 262144, 196614, 65535, 262144, 65555, 65535, 262144, 131091, 65535, 262144, 196627, 65535, 262144, 196618, 65535, 917507, 196619, 65535, 917507, 196620, 65535, 917507, 196621, 65535, 917507, 196622, 65535, 917507, 196623, 65535, 917507, 196624, 65535, 917507, 196625, 65535, 917507, 196626, 65535, 917507, 262163, 65535, 196608, 262162, 65535, 196608, 262161, 65535, 196608, 262160, 65535, 196608, 262159, 65535, 196608, 262158, 65535, 196608, 262157, 65535, 196608, 262156, 65535, 196608, 262155, 65535, 196608, 262154, 65535, 196608, 262150, 65535, 196608, 262151, 65535, 196608, 262152, 65535, 196608, 262153, 65535, 196608, 262149, 65535, 196608, 262148, 65535, 196608, 262147, 65535, 196608, 262144, 65535, 196608, 262145, 65535, 196608, 262146, 65535, 196608, 196608, 65535, 196608, 196617, 65535, 196608, 196615, 0, 786436, 196612, 0, 786436, 196609, 0, 786436, 196610, 0, 917508, 196613, 0, 917508, 196616, 0, 917508)
}
metadata/_editor_floor_ = Vector3(0, 0, 0)

@ -0,0 +1,27 @@
[gd_scene load_steps=3 format=3 uid="uid://cmyn7g0lp71uj"]
[ext_resource type="PackedScene" uid="uid://do7abukgd54js" path="res://addons/MetroidvaniaSystem/Nodes/RoomInstance.tscn" id="1_m78sp"]
[ext_resource type="MeshLibrary" uid="uid://bbya6804fmu42" path="res://resource/mesh_library/default.tres" id="2_fqw73"]
[node name="Level" type="Node3D"]
[node name="RoomInstance" parent="." instance=ExtResource("1_m78sp")]
[node name="Light" type="Node3D" parent="."]
[node name="DirectionalLight3D" type="DirectionalLight3D" parent="Light"]
transform = Transform3D(0.707107, -0.5, 0.5, 0, 0.707107, 0.707107, -0.707107, -0.5, 0.5, 0, 0, 0)
[node name="Ground" type="CSGBox3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 6.4, -1, 7.2)
use_collision = true
size = Vector3(12.8, 2, 14.4)
[node name="GridMap" type="GridMap" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0.4)
mesh_library = ExtResource("2_fqw73")
cell_size = Vector3(0.64, 0.64, 0.64)
data = {
"cells": PackedInt32Array(19, 7, 917504, 19, 8, 917504, 19, 9, 0, 19, 10, 0, 0, 2, 917504, 0, 3, 917504, 0, 9, 917504, 0, 5, 917504, 0, 4, 917504, 0, 65535, 1376258, 1, 65535, 1376258, 2, 65535, 1376258, 3, 65535, 1376258, 4, 65535, 1376258, 5, 65535, 1376258, 6, 65535, 1376258, 7, 65535, 1376258, 12, 65535, 1376258, 13, 65535, 1376258, 14, 65535, 1376258, 15, 65535, 1376258, 16, 65535, 1376258, 17, 65535, 1376258, 18, 65535, 1376258, 19, 65535, 1376258, 19, 21, 2, 17, 21, 0, 18, 21, 0, 16, 21, 0, 15, 21, 0, 14, 21, 0, 13, 21, 0, 12, 21, 0, 7, 21, 0, 6, 21, 0, 5, 21, 0, 4, 21, 0, 3, 21, 0, 2, 21, 0, 1, 21, 0, 0, 21, 0, 0, 6, 917504, 0, 7, 917504, 0, 8, 917504, 11, 65535, 917504, 8, 65535, 917504, 19, 2, 917504, 19, 3, 917504, 19, 4, 917504, 19, 5, 917504, 19, 6, 917504)
}
metadata/_editor_floor_ = Vector3(0, 0, 0)

@ -0,0 +1,31 @@
[gd_scene load_steps=3 format=3 uid="uid://hhl8u75m4bgu"]
[ext_resource type="PackedScene" uid="uid://do7abukgd54js" path="res://addons/MetroidvaniaSystem/Nodes/RoomInstance.tscn" id="1_yj4gm"]
[ext_resource type="MeshLibrary" uid="uid://bbya6804fmu42" path="res://resource/mesh_library/default.tres" id="2_q76ck"]
[node name="Level" type="Node3D"]
[node name="RoomInstance" parent="." instance=ExtResource("1_yj4gm")]
[node name="Light" type="Node3D" parent="."]
[node name="DirectionalLight3D" type="DirectionalLight3D" parent="Light"]
transform = Transform3D(0.707107, -0.5, 0.5, 0, 0.707107, 0.707107, -0.707107, -0.5, 0.5, 0, 0, 0)
shadow_enabled = true
shadow_transmittance_bias = -16.0
shadow_opacity = 0.5
shadow_blur = 0.0
[node name="Ground" type="CSGBox3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 19.2, -1, 3.6)
use_collision = true
size = Vector3(38.4, 2, 7.2)
[node name="GridMap" type="GridMap" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0.4)
mesh_library = ExtResource("2_q76ck")
cell_size = Vector3(0.64, 0.64, 0.64)
data = {
"cells": PackedInt32Array(19, 10, 0, 18, 10, 0, 17, 10, 0, 16, 10, 0, 15, 10, 917504, 14, 10, 917504, 13, 10, 917504, 12, 10, 917504, 11, 10, 917504, 8, 10, 917504, 7, 10, 917504, 6, 10, 0, 5, 10, 0, 4, 10, 0, 3, 10, 0, 2, 10, 0, 1, 10, 0, 0, 10, 0, 0, 65535, 917504, 1, 65535, 917504, 2, 65535, 917504, 3, 65535, 917504, 4, 65535, 917504, 5, 65535, 917504, 6, 65535, 917504, 7, 65535, 917504, 8, 65535, 917504, 9, 65535, 917504, 12, 65535, 917504, 13, 65535, 917504, 14, 65535, 917504, 15, 65535, 917504, 16, 65535, 917504, 17, 65535, 917504, 18, 65535, 917504, 19, 65535, 917504, 10, 65535, 917504, 11, 65535, 917504, 20, 65535, 917504, 21, 65535, 917504, 22, 65535, 917504, 23, 65535, 917504, 24, 65535, 917504, 25, 65535, 917504, 34, 65535, 1245184, 35, 65535, 917504, 36, 65535, 917504, 37, 65535, 917504, 38, 65535, 917504, 39, 65535, 917504, 39, 10, 917504, 38, 10, 917504, 37, 10, 917504, 36, 10, 917504, 35, 10, 917504, 34, 10, 917504, 29, 10, 917504, 28, 10, 917504, 27, 10, 917504, 26, 10, 917504, 25, 10, 917504, 24, 10, 917504, 23, 10, 917504, 22, 10, 917504, 21, 10, 917504, 20, 10, 917504, 9, 10, 917504, 10, 10, 917504, 40, 65535, 1245184, 41, 65535, 1245184, 42, 65535, 1245184, 43, 65535, 1245184, 44, 65535, 1245184, 45, 65535, 1245184, 46, 65535, 1245184, 47, 65535, 1245184, 48, 65535, 1245184, 59, 65535, 1245184, 58, 65535, 1245184, 57, 65535, 1245184, 56, 65535, 1245184, 55, 65535, 1245184, 54, 65535, 1245184, 53, 65535, 1245184, 52, 65535, 1245184, 51, 65535, 1245184, 50, 65535, 1245184, 49, 65535, 1245184, 59, 0, 1245184, 59, 1, 1245184, 59, 2, 1245184, 59, 3, 1245184, 59, 6, 1245184, 59, 7, 1245184, 59, 8, 1245184, 59, 9, 1245184, 59, 10, 1245184, 58, 10, 1245184, 57, 10, 1245184, 56, 10, 1245184, 55, 10, 1245184, 54, 10, 1245184, 53, 10, 1245184, 52, 10, 1245184, 51, 10, 1245184, 50, 10, 1245184, 49, 10, 1245184, 48, 10, 1245184, 47, 10, 1245184, 46, 10, 1245184, 45, 10, 1245184, 44, 10, 1245184, 43, 10, 1245184, 42, 10, 1245184, 41, 10, 1245184, 40, 10, 1245184, 0, 0, 1245184, 0, 1, 1245184, 0, 2, 1245184, 0, 3, 1245184, 0, 6, 1245184, 0, 7, 1245184, 0, 8, 1245184, 0, 9, 1245184, 26, 65535, 1245184, 27, 65535, 1245184, 28, 65535, 1245184, 33, 65535, 1245184, 32, 65535, 1245184)
}
metadata/_editor_floor_ = Vector3(0, 0, 0)

@ -1,18 +1,20 @@
[gd_scene load_steps=3 format=3 uid="uid://viwd61u8u8h0"]
[ext_resource type="PackedScene" uid="uid://do7abukgd54js" path="res://addons/MetroidvaniaSystem/Nodes/RoomInstance.tscn" id="1_c4hhn"]
[ext_resource type="MeshLibrary" uid="uid://bbya6804fmu42" path="res://resource/mesh_library/default.tres" id="2_qqvc4"]
[ext_resource type="PackedScene" uid="uid://do7abukgd54js" path="res://addons/MetroidvaniaSystem/Nodes/RoomInstance.tscn" id="1_3iffo"]
[ext_resource type="MeshLibrary" uid="uid://bbya6804fmu42" path="res://resource/mesh_library/default.tres" id="2_dx1b7"]
[node name="Level" type="Node3D"]
[node name="RoomInstance" parent="." instance=ExtResource("1_c4hhn")]
[node name="RoomInstance" parent="." instance=ExtResource("1_3iffo")]
[node name="Light" type="Node3D" parent="."]
[node name="DirectionalLight3D" type="DirectionalLight3D" parent="Light"]
transform = Transform3D(0.707107, -0.5, 0.5, 0, 0.707107, 0.707107, -0.707107, -0.5, 0.5, 0, 0, 0)
shadow_enabled = true
shadow_transmittance_bias = -16.0
shadow_opacity = 0.5
shadow_blur = 0.0
[node name="Ground" type="CSGBox3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 6.4, -1, 3.6)
@ -21,7 +23,7 @@ size = Vector3(12.8, 2, 7.2)
[node name="GridMap" type="GridMap" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0.4)
mesh_library = ExtResource("2_qqvc4")
mesh_library = ExtResource("2_dx1b7")
cell_size = Vector3(0.64, 0.64, 0.64)
data = {
"cells": PackedInt32Array(0, 1, 655362, 0, 0, 0, 19, 1, 0, 19, 0, 0, 19, 2, 0, 19, 3, 0, 19, 7, 0, 19, 8, 0, 19, 9, 0, 19, 10, 0, 18, 10, 0, 17, 10, 0, 16, 10, 0, 0, 2, 655362, 0, 3, 655362, 0, 9, 655362, 0, 5, 655362, 0, 4, 655362, 15, 10, 0, 14, 10, 0, 13, 10, 0, 12, 10, 0, 11, 10, 0, 8, 10, 0, 7, 10, 0, 6, 10, 0, 5, 10, 0, 4, 10, 0, 3, 10, 0, 2, 10, 0, 1, 10, 0, 0, 10, 0, 0, 65535, 1376258, 1, 65535, 1376258, 2, 65535, 1376258, 3, 65535, 1376258, 4, 65535, 1376258, 5, 65535, 1376258, 6, 65535, 1376258, 7, 65535, 1376258, 8, 65535, 1376258, 9, 65535, 1376258, 12, 65535, 1376258, 13, 65535, 1376258, 14, 65535, 1376258, 15, 65535, 1376258, 16, 65535, 1376258, 17, 65535, 1376258, 18, 65535, 1376258, 19, 65535, 1376258)

@ -0,0 +1,31 @@
[gd_scene load_steps=3 format=3 uid="uid://b1kdn2586jbdn"]
[ext_resource type="PackedScene" uid="uid://do7abukgd54js" path="res://addons/MetroidvaniaSystem/Nodes/RoomInstance.tscn" id="1_wnjhu"]
[ext_resource type="MeshLibrary" uid="uid://bbya6804fmu42" path="res://resource/mesh_library/default.tres" id="2_qax75"]
[node name="Level" type="Node3D"]
[node name="RoomInstance" parent="." instance=ExtResource("1_wnjhu")]
[node name="Light" type="Node3D" parent="."]
[node name="DirectionalLight3D" type="DirectionalLight3D" parent="Light"]
transform = Transform3D(0.707107, -0.5, 0.5, 0, 0.707107, 0.707107, -0.707107, -0.5, 0.5, 0, 0, 0)
shadow_enabled = true
shadow_transmittance_bias = -16.0
shadow_opacity = 0.5
shadow_blur = 0.0
[node name="Ground" type="CSGBox3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 12.8, -1, 3.6)
use_collision = true
size = Vector3(25.6, 2, 7.2)
[node name="GridMap" type="GridMap" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0.4)
mesh_library = ExtResource("2_qax75")
cell_size = Vector3(0.64, 0.64, 0.64)
data = {
"cells": PackedInt32Array(19, 10, 0, 18, 10, 0, 17, 10, 0, 16, 10, 0, 15, 10, 917504, 14, 10, 917504, 13, 10, 917504, 12, 10, 917504, 11, 10, 917504, 8, 10, 917504, 7, 10, 917504, 6, 10, 0, 5, 10, 0, 4, 10, 0, 3, 10, 0, 2, 10, 0, 1, 10, 0, 0, 10, 0, 0, 65535, 917504, 1, 65535, 917504, 2, 65535, 917504, 3, 65535, 917504, 4, 65535, 917504, 5, 65535, 917504, 6, 65535, 917504, 7, 65535, 917504, 8, 65535, 917504, 9, 65535, 917504, 12, 65535, 917504, 13, 65535, 917504, 14, 65535, 917504, 15, 65535, 917504, 16, 65535, 917504, 17, 65535, 917504, 18, 65535, 917504, 19, 65535, 917504, 10, 65535, 917504, 11, 65535, 917504, 20, 65535, 917504, 21, 65535, 917504, 22, 65535, 917504, 23, 65535, 917504, 24, 65535, 917504, 25, 65535, 917504, 26, 65535, 917504, 27, 65535, 917504, 28, 65535, 917504, 29, 65535, 917504, 30, 65535, 917504, 31, 65535, 917504, 32, 65535, 917504, 33, 65535, 917504, 34, 65535, 917504, 35, 65535, 917504, 36, 65535, 917504, 37, 65535, 917504, 38, 65535, 917504, 39, 65535, 917504, 39, 0, 917504, 39, 1, 917504, 39, 2, 917504, 39, 3, 917504, 39, 7, 917504, 39, 8, 917504, 39, 9, 917504, 39, 10, 917504, 38, 10, 917504, 37, 10, 917504, 36, 10, 917504, 35, 10, 917504, 34, 10, 917504, 33, 10, 917504, 32, 10, 917504, 31, 10, 917504, 30, 10, 917504, 29, 10, 917504, 28, 10, 917504, 27, 10, 917504, 26, 10, 917504, 25, 10, 917504, 24, 10, 917504, 23, 10, 917504, 22, 10, 917504, 21, 10, 917504, 20, 10, 917504, 9, 10, 917504, 10, 10, 917504, 39, 6, 917504)
}
metadata/_editor_floor_ = Vector3(0, 0, 0)

@ -9,3 +9,6 @@ const input_alive_time : float = 0.5
#移动
const drag_ground : float = 20
const drag_air : float = 5
#地图
const starting_level : String = "level01_forecourt.tscn"

@ -17,7 +17,6 @@ func _physics_process(delta):
SignalManager.character_pos_changed.emit(character.id(),character.pos())
SignalManager.character_ui_pos_changed.emit(character.id(),character.ui_pos())
SignalManager.character_status_changed.emit(status.id,"pos2d",character.pos2D())
MetSys.set_player_position(character.pos2D())
func update_on_floor(delta) -> bool:
var is_on_floor = character.is_on_floor()

@ -0,0 +1,6 @@
extends Node3D
@onready var character = (get_owner() as Character)
func _process(delta):
MetSys.set_player_position(character.pos2D())

@ -23,8 +23,8 @@ func on_character_create(id:int,team:Enum.ETeam,pos:Vector3):
func on_character_pos_changed(id:int,pos:Vector3):
if id == target:
pos.x = clamp(pos.x,camera_limit.x,level_size.x-camera_limit.x)
pos.z = clamp(pos.z,camera_limit.y,level_size.y-camera_limit.y)
pos.y = clamp(pos.y,0,0.5)
pos.z = clamp(pos.z,camera_limit.y * 0.25,level_size.y-camera_limit.y)
pos.y = 0
position = Util.snap_vector3(pos + offset)
func on_character_destroy(id:int):

@ -2,37 +2,38 @@ extends Node3D
class_name LevelManager
var map: Node3D
var starting_map = "level0101.tscn"
var level: Node3D
func _ready():
Global.level_mgr = self
func init():
MetSys.set_save_data()
goto_map(MetSys.get_full_room_path(starting_map))
goto_level(MetSys.get_full_room_path(Setting.starting_level))
MetSys.room_changed.connect(on_room_changed)
func goto_map(map_path: String):
var prev_map_position := Vector2i.MAX
if map:
prev_map_position = MetSys.get_current_room_instance().get_base_coords()
map.queue_free()
map = null
func goto_level(level_path: String):
var prev_level_position := Vector2i.MAX
if level:
prev_level_position = MetSys.get_current_room_instance().get_base_coords()
level.queue_free()
level = null
map = load(map_path).instantiate()
add_child(map)
level = load(level_path).instantiate()
add_child(level)
MetSys.current_layer = MetSys.get_current_room_instance().get_layer()
var level_size = MetSys.get_current_room_instance().get_size()
SignalManager.level_size_change.emit(level_size)
if prev_map_position != Vector2i.MAX:
if prev_level_position != Vector2i.MAX:
var player = Global.character_mgr.get_player()
var pos_pre = player.pos()
var pos_change_xz = Vector2(MetSys.get_current_room_instance().get_base_coords() - prev_map_position) * MetSys.settings.in_game_cell_size
var level_position_now = MetSys.get_current_room_instance().get_base_coords()
var pos_change_xz = Vector2(level_position_now - prev_level_position) * MetSys.settings.in_game_cell_size
pos_pre.x -= pos_change_xz.x
pos_pre.z -= pos_change_xz.y
print(player.pos(),pos_pre)
player.set_pos(pos_pre)
func on_room_changed(target_map: String):
goto_map(MetSys.get_full_room_path(target_map))
func on_room_changed(target_level: String):
goto_level(MetSys.get_full_room_path(target_level))

@ -1,45 +1,45 @@
[1,0,0]
0,0,0,-1|||
0,0,1,-1|||
[1,1,0]
-1,0,0,0|||
-1,0,1,0|||/level01_right_alley.tscn
[0,2,0]
-1,0,-1,0|||
-1,0,-1,1|||/level01_front_alley.tscn
[2,1,0]
0,0,-1,0|||
1,0,-1,0|||/level01_right_alley.tscn
[2,-1,0]
0,-1,0,0|11d4e3,,,,||
[2,0,0]
0,0,0,-1|11d4e3,,,,||
[0,-1,0]
0,1,0,0|11d4e3,,,,||/level0101.tscn
0,1,0,0|11d4e3,,,,||/level01_living_room.tscn
[2,2,0]
0,0,0,0|11d4e3,,,,||
0,0,1,0|11d4e3,,,,||/level01_bedroom.tscn
[-1,2,0]
-1,0,0,0|||
-1,0,1,0|||/level01_front_alley.tscn
[1,2,0]
0,0,-1,0|||
1,0,-1,0|||/level01_front_alley.tscn
[0,0,0]
0,-1,0,1|||/level0102.tscn
1,-1,1,1|||/level01_forecourt.tscn
[0,1,0]
0,0,0,-1|||/level0102.tscn
1,1,1,-1|||/level01_forecourt.tscn
[3,1,0]
0,0,0,0|c70000,,,,||
1,0,1,0|c70000,,,,||
[-2,1,0]
-1,0,0,0|||
[-1,1,0]
0,0,-1,0|||
1,0,-1,0|||
[1,-1,0]
0,-1,0,0|||
[-1,-1,0]
0,-1,0,0|||
[-1,0,0]
0,0,0,-1|||
1,0,0,-1|||
[-2,-1,0]
0,-1,0,0|11d4e3,,,,||
[-2,0,0]
0,0,0,-1|11d4e3,,,,||
[-2,2,0]
0,0,0,0|11d4e3,,,,||
1,0,0,0|11d4e3,,,,||
[-1,-3,0]
-1,-1,0,0|||
[-1,-2,0]
@ -53,29 +53,29 @@
[1,-2,0]
0,0,-1,-1|||
[4,1,0]
0,0,0,-1|c70000,,,,||
0,0,1,-1|c70000,,,,||
[4,0,0]
0,-1,0,0|c70000,,,,||
1,-1,0,0|c70000,,,,||
[5,0,0]
-1,0,0,0|c70000,,,,||
-1,0,1,0|c70000,,,,||
[6,0,0]
0,0,-1,0|c70000,,,,||
1,1,-1,0|c70000,,,,||
[7,0,0]
0,0,0,0|660072,,,,||
1,0,1,0|660072,,,,||
[8,0,0]
-1,0,0,0|c70000,,,,||
-1,0,1,0|c70000,,,,||
[9,0,0]
0,0,-1,0|c70000,,,,||
1,0,-1,0|c70000,,,,||
[10,0,0]
0,0,0,0|11e31e,,,,||
1,0,1,0|11e31e,,,,||
[11,-1,0]
-1,-1,0,0|720000,,,,||
[11,0,0]
-1,0,0,-1|720000,,,,||
-1,0,1,-1|720000,,,,||
[12,-1,0]
0,-1,-1,0|720000,,,,||
[12,0,0]
0,0,-1,-1|720000,,,,||
0,1,-1,-1|720000,,,,||
[12,-3,0]
0,-1,0,0|||
[12,-2,0]
@ -97,7 +97,7 @@
[4,3,0]
0,0,-1,0|c70000,,,,||
[6,1,0]
0,-1,0,0|c70000,,,,||
0,-1,0,1|c70000,,,,||
[6,2,0]
0,0,0,-1|c70000,,,,||
[5,3,0]
@ -135,13 +135,13 @@
[9,4,0]
0,0,-1,0|c70000,,,,||
[12,1,0]
-1,0,0,0|c70000,,,,||
-1,0,0,1|c70000,,,,||
[13,1,0]
0,0,-1,0|c70000,,,,||
1,0,-1,0|c70000,,,,||
[14,0,0]
0,-1,0,0|c70000,,,,||
1,-1,0,0|c70000,,,,||
[14,1,0]
0,0,0,-1|c70000,,,,||
0,0,1,-1|c70000,,,,||
[10,3,0]
-1,-1,0,0|c70000,,,,||
[10,4,0]
@ -155,61 +155,61 @@
[12,3,0]
0,0,0,-1|c70000,,,,||
[15,0,0]
-1,0,0,0|||
-1,0,1,0|||
[16,0,0]
0,0,-1,0|||
1,0,-1,0|||
[5,5,0]
0,0,0,0|c04500,,,,||
[17,0,0]
0,0,0,0|||
0,0,1,1|||
[17,-1,0]
0,0,0,-1|11d4e3,,,,||
0,1,0,-1|11d4e3,,,,||
[17,-2,0]
0,-1,0,0|11d4e3,,,,||
0,-1,0,1|11d4e3,,,,||
[17,-3,0]
0,0,0,0|660072,,,,||
0,1,0,1|660072,,,,||
[17,-4,0]
-1,0,0,0|c70000,,,,||
-1,1,0,0|c70000,,,,||
[18,-4,0]
-1,0,-1,0|c70000,,,,||
[19,-4,0]
0,0,-1,0|c70000,,,,||
1,0,-1,0|c70000,,,,||
[20,-4,0]
-1,0,0,0|c70000,,,,||
-1,0,1,0|c70000,,,,||
[21,-4,0]
-1,0,-1,0|c70000,,,,||
[22,-4,0]
0,0,-1,0|c70000,,,,||
1,0,-1,0|c70000,,,,||
[23,-4,0]
-1,-1,0,0|c70000,,,,||
-1,-1,1,0|c70000,,,,||
[23,-3,0]
-1,0,0,-1|c70000,,,,||
[24,-4,0]
0,-1,-1,0|c70000,,,,||
1,-1,-1,0|c70000,,,,||
[24,-3,0]
0,0,-1,-1|c70000,,,,||
[25,-4,0]
0,0,0,0|11e31e,,,,||
0,0,1,1|11e31e,,,,||
[25,-5,0]
0,0,0,0|720000,,,,||
0,1,0,1|720000,,,,||
[25,-6,0]
0,0,0,0|660072,,,,||
0,1,1,0|660072,,,,||
[22,-6,0]
-1,0,0,0|c70000,,,,||
-1,0,1,0|c70000,,,,||
[23,-6,0]
-1,0,-1,0|c70000,,,,||
[24,-6,0]
0,0,-1,0|c70000,,,,||
1,0,-1,0|c70000,,,,||
[21,-6,0]
0,0,0,0|c04500,,,,||
1,0,0,1|c04500,,,,||
[21,-9,0]
0,-1,0,0|c70000,,,,||
0,-1,0,1|c70000,,,,||
[21,-8,0]
0,-1,0,-1|c70000,,,,||
[21,-7,0]
0,0,0,-1|c70000,,,,||
0,1,0,-1|c70000,,,,||
[21,-10,0]
0,0,0,0|660072,,,,||
0,1,0,0|660072,,,,||
[18,-10,0]
-1,0,0,0|c70000,,,,||
[19,-10,0]

Binary file not shown.

After

Width:  |  Height:  |  Size: 146 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 146 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 129 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 146 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 126 B

Loading…
Cancel
Save