Fix initial spawn, center thrown item a bit more

This commit is contained in:
2025-02-11 02:53:45 -08:00
parent 556f12de1e
commit 9352e4c0fd
4 changed files with 13 additions and 6 deletions

View File

@@ -162,7 +162,7 @@ public partial class Game : Node3D, IGame
var thrown = thrownScene.Instantiate<ThrownItem>();
thrown.ItemThatIsThrown = item;
AddChild(thrown);
thrown.Position += new Vector3(0, 1.5f, -0.5f);
thrown.Position += new Vector3(-0.5f, 1.5f, -0.5f);
thrown.Throw();
}

View File

@@ -7,7 +7,6 @@
size = Vector3(0.46632, 0.507293, 0.586082)
[node name="Hitbox" type="RigidBody3D"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 2, 0)
collision_layer = 16
collision_mask = 25
gravity_scale = 0.25

View File

@@ -10,8 +10,15 @@ public partial class Floor0 : Node3D, IDungeonFloor
[Node] public Marker3D PlayerSpawnPoint { get; set; } = default!;
[Dependency] protected IPlayer Player => this.DependOn<IPlayer>();
[Node] public Marker3D ExitSpawnPoint { get; set; } = default!;
public void Setup()
{
Player.TeleportPlayer(new Vector3(PlayerSpawnPoint.Position.X, -1.75f, PlayerSpawnPoint.Position.Z));
}
public Transform3D GetPlayerSpawnPoint()
{
return PlayerSpawnPoint.GlobalTransform;
@@ -24,5 +31,6 @@ public partial class Floor0 : Node3D, IDungeonFloor
public void InitializeDungeon()
{
Show();
}
}

View File

@@ -1,6 +1,6 @@
[gd_scene load_steps=60 format=4 uid="uid://dl6h1djc27ddl"]
[ext_resource type="Script" uid="uid://cuhfkyh3d7noa" path="res://src/map/dungeon/code/Overworld.cs" id="1_vwmxx"]
[ext_resource type="Script" uid="uid://c1nhqlem1ew3m" path="res://src/map/dungeon/code/Floor0.cs" id="1_db2o3"]
[ext_resource type="Texture2D" uid="uid://b27ksiyfefb33" path="res://src/map/dungeon/models/altar/02_ALTAR_FLOOR_ZER0_VER_outside_desert.png" id="2_xh2ej"]
[ext_resource type="Texture2D" uid="uid://cmfhbi07s4v5x" path="res://src/map/dungeon/models/altar/02_ALTAR_FLOOR_ZER0_VER_BOULDER_DARK.png" id="3_aqomv"]
[ext_resource type="Texture2D" uid="uid://cfo5c1twdrnea" path="res://src/map/dungeon/models/altar/02_ALTAR_FLOOR_ZER0_VER_concrete_0025_color_1k.jpg" id="4_db2o3"]
@@ -726,11 +726,11 @@ size = Vector3(1.53375, 1.46143, 3.13956)
[node name="Floor0" type="Node3D"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.63488, -5.13176)
script = ExtResource("1_vwmxx")
script = ExtResource("1_db2o3")
[node name="PlayerSpawnPoint" type="Marker3D" parent="."]
unique_name_in_owner = true
transform = Transform3D(0.0152187, 0, 0.999884, 0, 1, 0, -0.999884, 0, 0.0152187, 3.6247, -2.61166, -1.03518)
transform = Transform3D(0.0152187, 0, 0.999884, 0, 1, 0, -0.999884, 0, 0.0152187, 3.6247, -3.07997, -1.03518)
[node name="ExitSpawnPoint" type="Marker3D" parent="."]
unique_name_in_owner = true
@@ -841,5 +841,5 @@ transform = Transform3D(0.857993, 0, 0.513661, 0, 1, 0, -0.513661, 0, 0.857993,
shape = SubResource("BoxShape3D_xh2ej")
[node name="ThrowableItem" parent="." instance=ExtResource("16_db2o3")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -3.46917, -1.74655, 0)
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -3.469, -2.5, 0)
_throwableItemStats = ExtResource("17_ntxe5")