diff --git a/BodyConfig/LoadBodyParts.gd b/BodyConfig/LoadBodyParts.gd new file mode 100644 index 0000000..f84967f --- /dev/null +++ b/BodyConfig/LoadBodyParts.gd @@ -0,0 +1,13 @@ +extends VBoxContainer + + +# Called when the node enters the scene tree for the first time. +func _ready(): + for entry in BodyPartLoader.bodyparts: + var button = Button.new() + button.text = entry.key + + +# Called every frame. 'delta' is the elapsed time since the previous frame. +#func _process(delta): +# pass diff --git a/BodyConfig/bodyBuilderMenu.tscn b/BodyConfig/bodyBuilderMenu.tscn index 38939cd..bb409dc 100644 --- a/BodyConfig/bodyBuilderMenu.tscn +++ b/BodyConfig/bodyBuilderMenu.tscn @@ -1,8 +1,8 @@ -[gd_scene load_steps=3 format=2] +[gd_scene load_steps=4 format=2] -[ext_resource path="res://BodyParts/Tesso.tscn" type="PackedScene" id=1] +[ext_resource path="res://BodyParts/BodyBase/BodyBase.tscn" type="PackedScene" id=1] [ext_resource path="res://BodyConfig/bodyBuildingScript.gd" type="Script" id=2] - +[ext_resource path="res://BodyConfig/LoadBodyParts.gd" type="Script" id=3] [node name="Body Builder Menu" type="Spatial"] script = ExtResource( 2 ) @@ -30,29 +30,7 @@ __meta__ = { margin_right = 300.0 margin_bottom = 600.0 rect_min_size = Vector2( 300, 500 ) - -[node name="Button" type="Button" parent="GUI/HBoxC/VBoxC"] -margin_right = 300.0 -margin_bottom = 20.0 -text = "Button 1" - -[node name="Button2" type="Button" parent="GUI/HBoxC/VBoxC"] -margin_top = 24.0 -margin_right = 300.0 -margin_bottom = 44.0 -text = "Button 2" - -[node name="Button3" type="Button" parent="GUI/HBoxC/VBoxC"] -margin_top = 48.0 -margin_right = 300.0 -margin_bottom = 68.0 -text = "Button 3" - -[node name="Button4" type="Button" parent="GUI/HBoxC/VBoxC"] -margin_top = 72.0 -margin_right = 300.0 -margin_bottom = 92.0 -text = "Button 4" +script = ExtResource( 3 ) [node name="ViewportContainer" type="ViewportContainer" parent="GUI/HBoxC"] margin_left = 304.0 @@ -73,5 +51,7 @@ transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 3 ) [node name="MouseLook" type="RayCast" parent="GUI/HBoxC/ViewportContainer/Viewport"] enabled = true +collide_with_areas = true +collide_with_bodies = false [node name="Torso" parent="." instance=ExtResource( 1 )] diff --git a/BodyParts/BodyBase/BodyBase.tscn b/BodyParts/BodyBase/BodyBase.tscn index 130277f..d7e8c79 100644 --- a/BodyParts/BodyBase/BodyBase.tscn +++ b/BodyParts/BodyBase/BodyBase.tscn @@ -2,7 +2,6 @@ [ext_resource path="res://BodyParts/BodyBase/BodyBase.gd" type="Script" id=1] - [sub_resource type="CapsuleMesh" id=1] [sub_resource type="CapsuleShape" id=2] @@ -21,6 +20,7 @@ mesh = SubResource( 1 ) material/0 = null [node name="TorsoCollider" type="CollisionShape" parent="."] +transform = Transform( 0.8, 0, 0, 0, 0.8, 0, 0, 0, 0.8, 0, 0, 0 ) shape = SubResource( 2 ) [node name="FrontLeft" type="Spatial" parent="."] diff --git a/Global/BodyPartLoader.gd b/Global/BodyPartLoader.gd new file mode 100644 index 0000000..9e968b2 --- /dev/null +++ b/Global/BodyPartLoader.gd @@ -0,0 +1,7 @@ +extends Node + +var bodyparts : Dictionary + +# Called when the node enters the scene tree for the first time. +func _ready(): + bodyparts["Arm"] = load("res://BodyParts/Arm.tscn") diff --git a/project.godot b/project.godot index 4b61df9..b3782d6 100644 --- a/project.godot +++ b/project.godot @@ -33,12 +33,11 @@ _global_script_class_icons={ [application] config/name="BodyPartFighter" -run/main_scene="res://Ingame/Testing.tscn" config/icon="res://icon.png" [autoload] -InGameState="*res://Global/InGameState.gd" +BodyPartLoader="*res://Global/BodyPartLoader.gd" [rendering]