场景迭代 hud fix

master
chendian 2 years ago
parent 4782f4f2b1
commit d90f26d1e6

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

@ -0,0 +1,18 @@
[remap]
importer="MagicaVoxel.With.Extensions.To.Mesh"
type="Mesh"
uid="uid://lqibalayi2fk"
path="res://.godot/imported/f_ground_out2.vox-f2cb45eca60695c334c4edaaff2e9fd8.mesh"
[deps]
source_file="res://resource/mesh_level/f_ground_out2.vox"
dest_files=["res://.godot/imported/f_ground_out2.vox-f2cb45eca60695c334c4edaaff2e9fd8.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://bv2b3ctcdbvuy"
path="res://.godot/imported/f_water.vox-c73767b64a0012d154467d15b2c28c85.mesh"
[deps]
source_file="res://resource/mesh_level/f_water.vox"
dest_files=["res://.godot/imported/f_water.vox-c73767b64a0012d154467d15b2c28c85.mesh"]
[params]
Scale=0.02
GreedyMeshGenerator=true
SnapToGround=false
FirstKeyframeOnly=true

File diff suppressed because one or more lines are too long

@ -0,0 +1,30 @@
[gd_scene load_steps=3 format=3 uid="uid://oinirq6pb5sw"]
[ext_resource type="PackedScene" uid="uid://do7abukgd54js" path="res://addons/MetroidvaniaSystem/Nodes/RoomInstance.tscn" id="1_s04lr"]
[ext_resource type="MeshLibrary" uid="uid://bhmla7vrwht8d" path="res://resource/mesh_library/mesh_library.tres" id="2_qn02p"]
[node name="Level" type="Node3D"]
[node name="RoomInstance" parent="." instance=ExtResource("1_s04lr")]
[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.52)
use_collision = true
size = Vector3(12.8, 2, 7.04)
[node name="GridMap" type="GridMap" parent="."]
mesh_library = ExtResource("2_qn02p")
cell_size = Vector3(0.64, 0.64, 0.64)
data = {
"cells": PackedInt32Array(0, 0, 16, 0, 1, 16, 0, 2, 16, 0, 3, 16, 0, 4, 16, 0, 5, 16, 0, 6, 16, 0, 7, 16, 0, 8, 16, 0, 9, 16, 0, 10, 16, 0, 65535, 16, 1, 65535, 16, 2, 65535, 16, 3, 65535, 16, 4, 65535, 16, 5, 65535, 16, 6, 65535, 16, 7, 65535, 16, 8, 65535, 16, 9, 65535, 16, 10, 65535, 16, 11, 65535, 16, 12, 65535, 16, 13, 65535, 16, 14, 65535, 16, 15, 65535, 16, 16, 65535, 16, 17, 65535, 16, 18, 65535, 16, 19, 65535, 16, 19, 0, 16, 19, 1, 16, 19, 2, 16, 19, 3, 16, 19, 4, 16, 19, 5, 16, 19, 6, 16, 19, 7, 16, 19, 8, 16, 19, 9, 16, 19, 10, 16, 18, 10, 16, 17, 10, 16, 16, 10, 16, 15, 10, 16, 14, 10, 16, 1, 10, 16, 2, 10, 16, 3, 10, 16, 4, 10, 16, 5, 10, 16, 6, 10, 16, 7, 10, 16, 8, 10, 16, 9, 10, 16, 10, 10, 16, 11, 10, 16, 12, 10, 16, 13, 10, 16, 65555, 10, 16, 65555, 9, 16, 65555, 8, 16, 65555, 7, 16, 65555, 6, 16, 65555, 5, 16, 65555, 4, 16, 65555, 3, 16, 65555, 2, 16, 65555, 1, 16, 65555, 0, 16, 65555, 65535, 16, 65554, 65535, 16, 65553, 65535, 16, 65552, 65535, 16, 65551, 65535, 16, 65550, 65535, 16, 65549, 65535, 16, 65548, 65535, 16, 65547, 65535, 16, 65546, 65535, 16, 65545, 65535, 16, 65544, 65535, 16, 65543, 65535, 16, 65542, 65535, 16, 65541, 65535, 16, 65540, 65535, 16, 65539, 65535, 16, 65538, 65535, 16, 65537, 65535, 16, 65536, 65535, 16, 65536, 0, 16, 65536, 1, 16, 65536, 2, 16, 65536, 3, 16, 65536, 4, 16, 65536, 5, 16, 65536, 6, 16, 65536, 7, 16, 65536, 8, 16, 65536, 9, 16, 65536, 10, 16, 65537, 10, 16, 65538, 10, 16, 65539, 10, 16, 65540, 10, 16, 65541, 10, 16, 65542, 10, 16, 65543, 10, 16, 65544, 10, 16, 65545, 10, 16, 65546, 10, 16, 65547, 10, 16, 65548, 10, 16, 65549, 10, 16, 65550, 10, 16, 65551, 10, 16, 65552, 10, 16, 65553, 10, 16, 65554, 10, 16, 131091, 10, 16, 131091, 9, 16, 131091, 8, 16, 131091, 7, 16, 131091, 6, 16, 131091, 5, 16, 131091, 4, 16, 131091, 3, 16, 131091, 2, 16, 131091, 1, 16, 131091, 0, 16, 131091, 65535, 16, 131090, 65535, 16, 131089, 65535, 16, 131088, 65535, 16, 131087, 65535, 16, 131086, 65535, 16, 131085, 65535, 16, 131084, 65535, 16, 131083, 65535, 16, 131082, 65535, 16, 131081, 65535, 16, 131080, 65535, 16, 131079, 65535, 16, 131078, 65535, 16, 131077, 65535, 16, 131076, 65535, 16, 131075, 65535, 16, 131074, 65535, 16, 131073, 65535, 16, 131072, 65535, 16, 131072, 0, 16, 131072, 1, 16, 131072, 2, 16, 131072, 3, 16, 131072, 4, 16, 131072, 5, 16, 131072, 6, 16, 131072, 7, 16, 131072, 8, 16, 131072, 9, 16, 131072, 10, 16, 131073, 10, 16, 131074, 10, 16, 131075, 10, 16, 131076, 10, 16, 131077, 10, 16, 131078, 10, 16, 131079, 10, 16, 131080, 10, 16, 131081, 10, 16, 131082, 10, 16, 131083, 10, 16, 131084, 10, 16, 131085, 10, 16, 131086, 10, 16, 131087, 10, 16, 131088, 10, 16, 131089, 10, 16, 131090, 10, 16)
}
metadata/_editor_floor_ = Vector3(0, 2, 0)

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -11,6 +11,7 @@ const drag_ground : float = 20
const drag_air : float = 5
#地图
const starting_level : String = "level01_forecourt.tscn"
#const starting_level : String = "level01_forecourt.tscn"
const starting_level : String = "level00_test1.tscn"
const level_loading_min_time : float = 0.2
const level_loading_control_time : float = 0.2

@ -8,6 +8,7 @@ var target_pos_now:Vector2 = Vector2.ZERO
var level_size:Vector2
var offset:float = 5
var camera_limit = Vector3(6.4,1.04,3.6) #x,up,z-downd
var screen_pos_scale = Vector2(3,1.5/cos(deg_to_rad(45.0)))
func _ready():
Global.camera_mgr = self
@ -60,3 +61,10 @@ func on_level_size_change(size:Vector2):level_size = size
func on_level_loading_end():
target_pos_now.x = target_pos.x
target_pos_now.y = target_pos.y
func get_screen_pos(pos:Vector3) -> Vector2:
var ret = unproject_position(pos)
ret.x /= screen_pos_scale.x
ret.y /= screen_pos_scale.y
return ret

@ -37,7 +37,7 @@ func create_character(cfg:CharacterCfg,team:Enum.ETeam,pos:Vector3):
character.init(character_idx,cfg,team)
character.set_material(ResourceManager.material_character.duplicate())
character.set_pos(pos)
SignalManager.character_create.emit(character_idx,team,pos)
SignalManager.character_create.emit(character_idx,team,character.ui_pos())
character.init_after()
if cfg.type == Enum.ECharacterType.Player:

@ -20,15 +20,13 @@ func _ready():
func _process(delta):
var camera_pos = camera.position
for k in headbar_map:
var headbar_meta = headbar_map[k] as HeadbarMeta
headbar_meta.headbar.position = camera.unproject_position(headbar_meta.pos)
headbar_meta.headbar.position = camera.get_screen_pos(headbar_meta.pos)
func on_character_create(id:int,team:Enum.ETeam,pos:Vector3):
#if team == Enum.ETeam.Player:
# return
return
var new_headbar_meta = HeadbarMeta.new()
new_headbar_meta.pos = pos
var new_headbar = headbar_scene.instantiate()
@ -43,7 +41,7 @@ func on_character_ui_pos_changed(id:int,pos:Vector3):
var headbar_meta = headbar_map[id]
var headbar = headbar_meta.headbar as Headbar
headbar_meta.pos = pos
headbar.position = camera.unproject_position(pos)
headbar.position = camera.get_screen_pos(pos)
func on_character_destroy(id:int):
if not id in headbar_map:

@ -1,7 +1,7 @@
[1,0,0]
0,0,1,-1|||/level01_right_courtyard.tscn
[1,1,0]
-1,0,1,0|||/level01_right_alley.tscn
-1,1,1,0|||/level01_right_alley.tscn
[0,2,0]
-1,1,-1,1|||/level01_front_alley.tscn
[2,1,0]
@ -17,7 +17,7 @@
[-1,2,0]
-1,0,1,0|||/level01_front_alley.tscn
[1,2,0]
1,0,-1,0|||/level01_front_alley.tscn
1,0,-1,1|||/level01_front_alley.tscn
[0,0,0]
1,-1,1,1|||/level01_forecourt.tscn
[0,1,0]
@ -31,9 +31,9 @@
[1,-1,0]
0,-1,0,0|||/level01_right_courtyard.tscn
[-1,-1,0]
0,-1,0,0|||
0,-1,0,0|||/level01_left_courtyard.tscn
[-1,0,0]
1,0,0,-1|||
1,0,0,-1|||/level01_left_courtyard.tscn
[-2,-1,0]
0,-1,0,0|11d4e3,,,,||
[-2,0,0]
@ -248,3 +248,19 @@
0,-1,0,0|||
[2,3,1]
0,0,0,-1|||
[2,8,0]
0,0,0,0|||/level00_test1.tscn
[3,8,0]
-1,0,0,0|||
[4,8,0]
-1,0,-1,0|||
[5,8,0]
0,0,-1,0|||
[6,8,0]
-1,-1,0,0|||
[6,9,0]
-1,0,0,-1|||
[7,8,0]
0,-1,-1,0|||
[7,9,0]
0,0,-1,-1|||

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Loading…
Cancel
Save