Come collision stuff and stuff aand stuff hahahah

This commit is contained in:
Victor Turgeon
2023-06-11 12:54:09 -04:00
parent 004ba54cc0
commit 5ccf6a12ea
8 changed files with 74 additions and 91 deletions

View File

@@ -47,7 +47,7 @@ public partial class player : Camera3D
}
}
public Node3D CurrentBuilding { get; set; }
public base_building CurrentBuilding { get; set; }
public override void _Ready()
{
@@ -55,8 +55,7 @@ public partial class player : Camera3D
game_manager.CurrentState = game_manager.State.Building;
if (_test_building != null)
{
CurrentBuilding = _test_building.Instantiate<Node3D>();
GD.Print(CurrentBuilding);
CurrentBuilding = _test_building.Instantiate<base_building>();
GetTree().Root.CallDeferred("add_child", CurrentBuilding);
}
@@ -156,8 +155,11 @@ public partial class player : Camera3D
if (Input.IsActionJustPressed("build"))
{
Node3D tempBuilding = (Node3D)CurrentBuilding.Duplicate();
GetTree().Root.CallDeferred("add_child", tempBuilding);
if (CurrentBuilding.IsPlaceable)
{
base_building tempBuilding = (base_building)CurrentBuilding.Duplicate();
GetTree().Root.CallDeferred("add_child", tempBuilding);
}
}
}
}

View File

@@ -1,4 +1,4 @@
[gd_scene load_steps=19 format=3 uid="uid://b5gb5paiupum"]
[gd_scene load_steps=18 format=3 uid="uid://b5gb5paiupum"]
[ext_resource type="Script" path="res://player/player.cs" id="1_of2l4"]
@@ -63,10 +63,7 @@ height = 255
[sub_resource type="SphereMesh" id="SphereMesh_mtv4x"]
[sub_resource type="LabelSettings" id="LabelSettings_pws5q"]
font_size = 28
[node name="player" type="Camera3D" node_paths=PackedStringArray("_con", "_mousePosLabel", "_cursorPosLabel", "_cursor", "_cursorPoint", "_nuke", "_pr", "_kash", "_chatter", "_sndChtr", "_sndBtn", "_tmrChtr")]
[node name="player" type="Camera3D" node_paths=PackedStringArray("_con", "_mousePosLabel", "_cursorPosLabel", "_cursor", "_cursorPoint", "_nuke", "_pr", "_kash")]
attributes = SubResource("CameraAttributesPhysical_1ejpb")
script = ExtResource("1_of2l4")
_con = NodePath("Debug info/Label")
@@ -77,13 +74,8 @@ _cursorPoint = NodePath("cursorPoint")
_nuke = NodePath("NukeBar")
_pr = NodePath("PrBar")
_kash = NodePath("KashBar")
_chatter = NodePath("lbl_Chatter")
_sndChtr = NodePath("snd_Chatter")
_sndBtn = NodePath("snd_Button")
_tmrChtr = NodePath("tmr_Chatter")
[node name="Debug info" type="Control" parent="."]
visible = false
layout_mode = 3
anchors_preset = 0
offset_right = 40.0
@@ -194,19 +186,3 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 2)
transform = Transform3D(0.5, 0, 0, 0, 0.5, 0, 0, 0, 0.5, 0, 0, 0)
mesh = SubResource("SphereMesh_mtv4x")
skeleton = NodePath("../..")
[node name="lbl_Chatter" type="Label" parent="."]
offset_left = 314.0
offset_top = 270.0
offset_right = 756.0
offset_bottom = 513.0
text = "CHATTER"
label_settings = SubResource("LabelSettings_pws5q")
autowrap_mode = 3
[node name="snd_Chatter" type="AudioStreamPlayer" parent="."]
[node name="snd_Button" type="AudioStreamPlayer" parent="."]
[node name="tmr_Chatter" type="Timer" parent="."]
wait_time = 3.0