diff --git a/3D Input/Mensch_Bein.blend b/3D Input/Mensch_Bein.blend index 216ec85..fe92819 100644 Binary files a/3D Input/Mensch_Bein.blend and b/3D Input/Mensch_Bein.blend differ diff --git a/3D Input/Mensch_Bein.blend1 b/3D Input/Mensch_Bein.blend1 index 7113e98..216ec85 100644 Binary files a/3D Input/Mensch_Bein.blend1 and b/3D Input/Mensch_Bein.blend1 differ diff --git a/3D Input/Mensch_Hand.blend b/3D Input/Mensch_Hand.blend new file mode 100644 index 0000000..37550ce Binary files /dev/null and b/3D Input/Mensch_Hand.blend differ diff --git a/3D Input/Mensch_Hand.blend1 b/3D Input/Mensch_Hand.blend1 new file mode 100644 index 0000000..9c1b4a0 Binary files /dev/null and b/3D Input/Mensch_Hand.blend1 differ diff --git a/BodyConfig/LoadBodyParts.gd b/BodyConfig/LoadBodyParts.gd index 232e710..b54b8a7 100644 --- a/BodyConfig/LoadBodyParts.gd +++ b/BodyConfig/LoadBodyParts.gd @@ -1,6 +1,9 @@ extends VBoxContainer +onready var delete = get_node("Delete") + + # Called when the node enters the scene tree for the first time. func _ready(): for entry in BodyPartLoader.bodyparts: @@ -8,7 +11,8 @@ func _ready(): button.text = entry add_child(button) button.connect("pressed", get_parent().get_parent().get_parent(), "body_part_chosen", [button.text]) - + + delete.connect("pressed", get_parent().get_parent().get_parent(), "delete_body_part") func button_pressed(params): emit_signal("choose_bodypart", params[0]) diff --git a/BodyConfig/bodyBuilderMenu.tscn b/BodyConfig/bodyBuilderMenu.tscn index b0066b8..6dfdb6a 100644 --- a/BodyConfig/bodyBuilderMenu.tscn +++ b/BodyConfig/bodyBuilderMenu.tscn @@ -32,6 +32,17 @@ margin_bottom = 600.0 rect_min_size = Vector2( 300, 500 ) script = ExtResource( 3 ) +[node name="Start" type="Button" parent="GUI/HBoxC/VBoxC"] +margin_right = 300.0 +margin_bottom = 20.0 +text = "Start Game" + +[node name="Delete" type="Button" parent="GUI/HBoxC/VBoxC"] +margin_top = 24.0 +margin_right = 300.0 +margin_bottom = 44.0 +text = "Delete" + [node name="ViewportContainer" type="ViewportContainer" parent="GUI/HBoxC"] margin_left = 304.0 margin_right = 1024.0 @@ -55,5 +66,8 @@ collide_with_areas = true collide_with_bodies = false [node name="Torso" parent="." instance=ExtResource( 1 )] +[connection signal="pressed" from="GUI/HBoxC/VBoxC/Start" to="." method="_on_Button2_pressed"] [editable path="Torso"] + +[editable path="Torso/FrontLeft"] diff --git a/BodyConfig/bodyBuildingScript.gd b/BodyConfig/bodyBuildingScript.gd index e3e9c7a..9739736 100644 --- a/BodyConfig/bodyBuildingScript.gd +++ b/BodyConfig/bodyBuildingScript.gd @@ -87,9 +87,21 @@ func _input(event): func body_part_chosen(params): - _attachment_point.add_child(BodyPartLoader.bodyparts[params].instance()) + var limb = _attachment_point.get_node("Limb") + if limb != null: + limb.add_child(BodyPartLoader.bodyparts[params].instance()) func make_it_shine(highlight : bool): if _attachment_point != null: _attachment_point.get_node("OmniLight").visible = highlight + + +func delete_body_part(): + var body_part = _attachment_point.get_node("Limb").get_child(0) + if body_part != null: + body_part.queue_free() + + + + diff --git a/BodyParts/Arm.gd b/BodyParts/Arm.gd index 570f038..22985ae 100644 --- a/BodyParts/Arm.gd +++ b/BodyParts/Arm.gd @@ -15,7 +15,7 @@ func action(): func push(body): # We multiply by 0.1 because we only want it to spin slightly, it should mostly go up - base.apply_impulse(transform.basis.xform(global_transform.origin - touch_area.global_transform.origin) * 0.1, base.transform.basis.y * 5.0) + base.apply_impulse(transform.basis.xform(touch_area.global_transform.origin - global_transform.origin) * 0.1, base.transform.basis.y * 5.0) # Called every frame. 'delta' is the elapsed time since the previous frame. #func _process(delta: float) -> void: diff --git a/BodyParts/BodyBase/AttachmentPoint.tscn b/BodyParts/BodyBase/AttachmentPoint.tscn index 049c59b..c123639 100644 --- a/BodyParts/BodyBase/AttachmentPoint.tscn +++ b/BodyParts/BodyBase/AttachmentPoint.tscn @@ -5,7 +5,6 @@ [sub_resource type="SphereShape" id=2] [node name="AttachmentPoint" type="Spatial"] -transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 ) [node name="Mesh" type="MeshInstance" parent="."] transform = Transform( 0.3, 0, 0, 0, 0.3, 0, 0, 0, 0.3, 0, 0, 0 ) @@ -24,3 +23,5 @@ omni_range = 1.8 [node name="CollisionShape" type="CollisionShape" parent="Area"] transform = Transform( 0.5, 0, 0, 0, 0.5, 0, 0, 0, 0.5, 0, 0, 0 ) shape = SubResource( 2 ) + +[node name="Limb" type="Spatial" parent="."] diff --git a/BodyParts/BodyBase/BodyBase.tscn b/BodyParts/BodyBase/BodyBase.tscn index 2f9456f..b174b1d 100644 --- a/BodyParts/BodyBase/BodyBase.tscn +++ b/BodyParts/BodyBase/BodyBase.tscn @@ -4,14 +4,16 @@ [ext_resource path="res://BodyParts/BodyBase/AttachmentPoint.tscn" type="PackedScene" id=2] [ext_resource path="res://3D Input/Fertige GLBs/Torso.glb" type="PackedScene" id=3] -[sub_resource type="CapsuleShape" id=2] +[sub_resource type="CapsuleShape" id=1] -[node name="Torso" type="RigidBody"] +[node name="Torso" type="RigidBody" groups=[ +"Player", +]] script = ExtResource( 1 ) [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 ) +shape = SubResource( 1 ) [node name="FrontLeft" parent="." instance=ExtResource( 2 )] transform = Transform( 0.5, -1.62921e-07, -0.866025, -3.25841e-07, -1, 0, -0.866025, 2.82187e-07, -0.5, 0.6, 0, 1 ) diff --git a/BodyParts/BodyPart.gd b/BodyParts/BodyPart.gd index 18f6034..c0849d4 100644 --- a/BodyParts/BodyPart.gd +++ b/BodyParts/BodyPart.gd @@ -4,7 +4,7 @@ class_name BodyPart # Must be the direct child of an AttachmentPoint of the BodyBase -onready var base = get_parent().get_parent() +onready var base = get_parent().get_parent().get_parent() onready var physics_shape = get_node("PartCollider") export(int) var key @@ -15,8 +15,6 @@ var setup_done = false # Called when the node enters the scene tree for the first time. func _ready() -> void: assert(base is BodyBase) - - func _process(delta: float) -> void: diff --git a/BodyParts/BodyPart.tscn b/BodyParts/BodyPart.tscn index 8581c4b..ec58519 100644 --- a/BodyParts/BodyPart.tscn +++ b/BodyParts/BodyPart.tscn @@ -2,7 +2,6 @@ [ext_resource path="res://BodyParts/BodyPart.gd" type="Script" id=1] - [node name="BodyPart" type="Spatial"] script = ExtResource( 1 ) diff --git a/Ingame/Testing.tscn b/Ingame/Testing.tscn index d7b2beb..147d71c 100644 --- a/Ingame/Testing.tscn +++ b/Ingame/Testing.tscn @@ -10,37 +10,43 @@ [node name="InGame" type="Spatial"] script = ExtResource( 4 ) -[node name="Torso" parent="." instance=ExtResource( 3 )] -transform = Transform( -1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, 0, 3.02111, 28.4014 ) - -[node name="Arm" parent="Torso/FrontLeft" index="1" instance=ExtResource( 1 )] -transform = Transform( 1, 2.84217e-14, 0, -2.84217e-14, 1, 0, 0, 0, 1, 0, 0, 0 ) -key = 83 - -[node name="Arm" parent="Torso/FrontRight" index="1" instance=ExtResource( 1 )] -transform = Transform( 1, 7.10543e-15, 0, -2.13163e-14, 1, 0, 0, 7.10543e-15, 1, 0, 0, 0 ) -key = 65 - -[node name="Torso2" parent="." instance=ExtResource( 3 )] -transform = Transform( -0.866025, -0.353553, -0.353554, -1.0677e-07, -0.707107, 0.707106, -0.5, 0.612372, 0.612373, 0, 3.02111, -9 ) -player_id = 1 - -[node name="Arm" parent="Torso2/FrontLeft" index="1" instance=ExtResource( 1 )] -key = 81 - -[node name="Arm" parent="Torso2/FrontRight" index="1" instance=ExtResource( 1 )] -key = 87 - [node name="UI" parent="." instance=ExtResource( 2 )] [node name="Arena" parent="." instance=ExtResource( 5 )] +[node name="Torso" parent="." instance=ExtResource( 3 )] +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 2, 0 ) + +[node name="Arm" parent="Torso/FrontLeft/Limb" index="0" instance=ExtResource( 1 )] +key = 81 + +[node name="Arm" parent="Torso/FrontRight/Limb" index="0" instance=ExtResource( 1 )] +key = 87 + +[node name="Torso2" parent="." instance=ExtResource( 3 )] +transform = Transform( -1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, 0, 2, -10 ) + +[node name="Arm" parent="Torso2/FrontLeft/Limb" index="0" instance=ExtResource( 1 )] +transform = Transform( 1, 2.84217e-14, 0, -2.84217e-14, 1, 0, 0, 0, 1, 0, 0, 0 ) +key = 79 + +[node name="Arm" parent="Torso2/FrontRight/Limb" index="0" instance=ExtResource( 1 )] +key = 80 + [node name="CameraFocus" type="Spatial" parent="."] script = ExtResource( 6 ) [node name="Camera" type="Camera" parent="CameraFocus"] -transform = Transform( -4.2222e-08, -0.707107, 0.707107, -1.13133e-08, 0.707107, 0.707107, -1, 2.18557e-08, -3.78552e-08, 14, 13, 0 ) +transform = Transform( -4.2222e-08, -0.707107, 0.707107, -1.13133e-08, 0.707107, 0.707107, -1, 2.18557e-08, -3.78552e-08, 19, 17, -2 ) [editable path="Torso"] +[editable path="Torso/FrontLeft"] + +[editable path="Torso/FrontRight"] + [editable path="Torso2"] + +[editable path="Torso2/FrontLeft"] + +[editable path="Torso2/FrontRight"] diff --git a/Resources/Fonts/MenuHeader.tres b/Resources/Fonts/MenuHeader.tres new file mode 100644 index 0000000..6d8dabb --- /dev/null +++ b/Resources/Fonts/MenuHeader.tres @@ -0,0 +1,7 @@ +[gd_resource type="DynamicFont" load_steps=2 format=2] + +[ext_resource path="res://Resources/Fonts/beneg___.ttf" type="DynamicFontData" id=1] + +[resource] +size = 120 +font_data = ExtResource( 1 ) diff --git a/Resources/Fonts/MenuTextFont.tres b/Resources/Fonts/MenuTextFont.tres new file mode 100644 index 0000000..1a20e3f --- /dev/null +++ b/Resources/Fonts/MenuTextFont.tres @@ -0,0 +1,7 @@ +[gd_resource type="DynamicFont" load_steps=2 format=2] + +[ext_resource path="res://Resources/Fonts/beneg___.ttf" type="DynamicFontData" id=1] + +[resource] +size = 64 +font_data = ExtResource( 1 ) diff --git a/Resources/Fonts/beneg___.ttf b/Resources/Fonts/beneg___.ttf new file mode 100644 index 0000000..0214a68 Binary files /dev/null and b/Resources/Fonts/beneg___.ttf differ diff --git a/Resources/Styles/ButtonHoverStyle.tres b/Resources/Styles/ButtonHoverStyle.tres new file mode 100644 index 0000000..3d875bd --- /dev/null +++ b/Resources/Styles/ButtonHoverStyle.tres @@ -0,0 +1,4 @@ +[gd_resource type="StyleBoxFlat" format=2] + +[resource] +bg_color = Color( 0.741176, 0.0666667, 0, 1 ) diff --git a/Resources/Styles/ButtonNormalStyle.tres b/Resources/Styles/ButtonNormalStyle.tres new file mode 100644 index 0000000..0a5b41f --- /dev/null +++ b/Resources/Styles/ButtonNormalStyle.tres @@ -0,0 +1,4 @@ +[gd_resource type="StyleBoxFlat" format=2] + +[resource] +bg_color = Color( 0.54902, 0.117647, 0.0705882, 1 ) diff --git a/Resources/Styles/ButtonPressedStyle.tres b/Resources/Styles/ButtonPressedStyle.tres new file mode 100644 index 0000000..d7db092 --- /dev/null +++ b/Resources/Styles/ButtonPressedStyle.tres @@ -0,0 +1,4 @@ +[gd_resource type="StyleBoxFlat" format=2] + +[resource] +bg_color = Color( 0.521569, 0.133333, 0.0941176, 1 ) diff --git a/UI/WinScreen.tscn b/UI/WinScreen.tscn index adffb9e..1a82773 100644 --- a/UI/WinScreen.tscn +++ b/UI/WinScreen.tscn @@ -1,6 +1,11 @@ -[gd_scene load_steps=2 format=2] +[gd_scene load_steps=7 format=2] [ext_resource path="res://UI/WinScreenScript.gd" type="Script" id=1] +[ext_resource path="res://Resources/Fonts/MenuHeader.tres" type="DynamicFont" id=2] +[ext_resource path="res://Resources/Fonts/MenuTextFont.tres" type="DynamicFont" id=3] +[ext_resource path="res://Resources/Styles/ButtonHoverStyle.tres" type="StyleBox" id=4] +[ext_resource path="res://Resources/Styles/ButtonPressedStyle.tres" type="StyleBox" id=5] +[ext_resource path="res://Resources/Styles/ButtonNormalStyle.tres" type="StyleBox" id=6] [node name="Spatial" type="Control"] anchor_right = 1.0 @@ -27,6 +32,7 @@ margin_bottom = 600.0 margin_right = 1024.0 margin_bottom = 250.0 rect_min_size = Vector2( 0, 250 ) +custom_fonts/font = ExtResource( 2 ) text = "CONGRATULATIONS!" align = 1 valign = 2 @@ -36,6 +42,7 @@ margin_top = 253.0 margin_right = 1024.0 margin_bottom = 503.0 rect_min_size = Vector2( 0, 250 ) +custom_fonts/font = ExtResource( 3 ) align = 1 valign = 1 @@ -54,6 +61,10 @@ margin_top = -10.0 margin_right = 100.0 margin_bottom = 15.0 rect_min_size = Vector2( 200, 25 ) +custom_styles/hover = ExtResource( 4 ) +custom_styles/pressed = ExtResource( 5 ) +custom_styles/normal = ExtResource( 6 ) +custom_fonts/font = ExtResource( 3 ) text = "Continue" __meta__ = { "_edit_use_anchors_": false diff --git a/project.godot b/project.godot index 0337e80..c6ecc5d 100644 --- a/project.godot +++ b/project.godot @@ -38,8 +38,8 @@ config/icon="res://icon.png" [autoload] -InGameState="*res://Global/InGameState.gd" BodyPartLoader="*res://Global/BodyPartLoader.gd" +InGameState="*res://Global/InGameState.gd" [rendering]