diff --git a/Audio/menu.wav b/Audio/menu.wav new file mode 100644 index 0000000..e2145c6 Binary files /dev/null and b/Audio/menu.wav differ diff --git a/Audio/menu.wav.import b/Audio/menu.wav.import new file mode 100644 index 0000000..d4d9ccf --- /dev/null +++ b/Audio/menu.wav.import @@ -0,0 +1,21 @@ +[remap] + +importer="wav" +type="AudioStreamSample" +path="res://.import/menu.wav-2935745348e8d9bcccb25346365d54d7.sample" + +[deps] + +source_file="res://Audio/menu.wav" +dest_files=[ "res://.import/menu.wav-2935745348e8d9bcccb25346365d54d7.sample" ] + +[params] + +force/8_bit=false +force/mono=false +force/max_rate=false +force/max_rate_hz=44100 +edit/trim=false +edit/normalize=false +edit/loop=false +compress/mode=0 diff --git a/BodyConfig/bodyBuilderMenu.tscn b/BodyConfig/bodyBuilderMenu.tscn index a8fceec..90f0226 100644 --- a/BodyConfig/bodyBuilderMenu.tscn +++ b/BodyConfig/bodyBuilderMenu.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=9 format=2] +[gd_scene load_steps=10 format=2] [ext_resource path="res://BodyParts/BodyBase/BodyBase.tscn" type="PackedScene" id=1] [ext_resource path="res://BodyConfig/bodyBuildingScript.gd" type="Script" id=2] @@ -8,6 +8,7 @@ [ext_resource path="res://Resources/Styles/ButtonHoverStyle.tres" type="StyleBox" id=6] [ext_resource path="res://Resources/Styles/ButtonPressedStyle.tres" type="StyleBox" id=7] [ext_resource path="res://Resources/Styles/ButtonNormalStyle.tres" type="StyleBox" id=8] +[ext_resource path="res://Audio/menu.wav" type="AudioStream" id=9] [node name="Body Builder Menu" type="Spatial"] script = ExtResource( 2 ) @@ -127,4 +128,8 @@ __meta__ = { [node name="Arena" parent="." instance=ExtResource( 4 )] transform = Transform( 1, 0, 0, 0, 0.707107, -0.707107, 0, 0.707107, 0.707107, 8, -9.91555, -6.62132 ) + +[node name="AudioStreamPlayer2D" type="AudioStreamPlayer2D" parent="."] +stream = ExtResource( 9 ) +autoplay = true [connection signal="pressed" from="GUI/HBoxC/VBoxC/Start" to="." method="_on_Start_pressed"] diff --git a/BodyParts/BullHead.gd b/BodyParts/BullHead.gd index 26f871c..38fcc4e 100644 --- a/BodyParts/BullHead.gd +++ b/BodyParts/BullHead.gd @@ -26,6 +26,6 @@ func action(): func push(body): # We multiply by 0.1 because we only want it to spin slightly, it should mostly go up var offset = transform.basis.xform(Vector3.ZERO) #transform.basis.xform(touch_area.global_transform.origin - base.global_transform.origin) * 0.5 - var direction = (base.transform.basis.y - base.transform.basis.z).normalized() * 19.0 + var direction = (base.transform.basis.y - base.transform.basis.z).normalized() * 3.0 base.apply_impulse(offset, direction) diff --git a/BodyParts/ChickenHead.gd b/BodyParts/ChickenHead.gd index 26f871c..38fcc4e 100644 --- a/BodyParts/ChickenHead.gd +++ b/BodyParts/ChickenHead.gd @@ -26,6 +26,6 @@ func action(): func push(body): # We multiply by 0.1 because we only want it to spin slightly, it should mostly go up var offset = transform.basis.xform(Vector3.ZERO) #transform.basis.xform(touch_area.global_transform.origin - base.global_transform.origin) * 0.5 - var direction = (base.transform.basis.y - base.transform.basis.z).normalized() * 19.0 + var direction = (base.transform.basis.y - base.transform.basis.z).normalized() * 3.0 base.apply_impulse(offset, direction) diff --git a/BodyParts/HumanHead.gd b/BodyParts/HumanHead.gd new file mode 100644 index 0000000..38fcc4e --- /dev/null +++ b/BodyParts/HumanHead.gd @@ -0,0 +1,31 @@ +extends PushingBodyPart + + +onready var anim = get_node("Mesh/AnimationPlayer") + + +# Called when the node enters the scene tree for the first time. +func _ready() -> void: + pass # Replace with function body. + + +func _is_animation_playing(): + return anim.is_playing() + + +func action(): + anim.play("ArmatureAction") + + # Apply a slight counter force + var offset = transform.basis.xform(Vector3.ZERO) #transform.basis.xform(touch_area.global_transform.origin - base.global_transform.origin) * 0.5 + var direction = -(base.transform.basis.y - base.transform.basis.z).normalized() * 0.5 + + base.apply_impulse(offset, direction) + + +func push(body): + # We multiply by 0.1 because we only want it to spin slightly, it should mostly go up + var offset = transform.basis.xform(Vector3.ZERO) #transform.basis.xform(touch_area.global_transform.origin - base.global_transform.origin) * 0.5 + var direction = (base.transform.basis.y - base.transform.basis.z).normalized() * 3.0 + + base.apply_impulse(offset, direction) diff --git a/BodyParts/HumanHead.tscn b/BodyParts/HumanHead.tscn new file mode 100644 index 0000000..c34b4c9 --- /dev/null +++ b/BodyParts/HumanHead.tscn @@ -0,0 +1,45 @@ +[gd_scene load_steps=7 format=2] + +[ext_resource path="res://BodyParts/PushingBodyPart.tscn" type="PackedScene" id=1] +[ext_resource path="res://3D Input/Fertige GLBs/Kopf_Mensch.glb" type="PackedScene" id=2] +[ext_resource path="res://BodyParts/HumanHead.gd" type="Script" id=3] + +[sub_resource type="SphereShape" id=1] +radius = 0.600362 + +[sub_resource type="SphereShape" id=2] +radius = 2.74607 + +[sub_resource type="SpatialMaterial" id=3] + +[node name="HumanHead" instance=ExtResource( 1 )] +transform = Transform( -3, -9.77524e-07, -4.88762e-07, 4.88762e-07, 7.96295e-14, -3, 9.77524e-07, -3, 7.96295e-14, 0, 0, -1.72516 ) +script = ExtResource( 3 ) +cost = 10.0 +damage = 5.0 + +[node name="PartCollider" parent="." index="0"] +shape = SubResource( 1 ) + +[node name="TouchArea" parent="." index="1"] +transform = Transform( -0.154405, -9.84102e-13, -6.12322e-07, 2.97588e-07, -0.134944, -0.0750402, -5.35145e-07, -0.0750403, 0.134944, 2.84217e-14, 0.372963, 0.00349771 ) + +[node name="CollisionShape" type="CollisionShape" parent="TouchArea" index="0"] +shape = SubResource( 2 ) + +[node name="Mesh" parent="." index="4" instance=ExtResource( 2 )] + +[node name="Skeleton" parent="Mesh/Armature" index="0"] +bones/2/bound_children = [ NodePath("BoneAttachment") ] + +[node name="HAARE" parent="Mesh/Armature/Skeleton" index="0"] +material/0 = SubResource( 3 ) + +[node name="BoneAttachment" type="BoneAttachment" parent="Mesh/Armature/Skeleton" index="3"] +transform = Transform( -1, -6.36646e-12, -3.96569e-06, 1.92732e-06, -0.87396, -0.485997, -3.46586e-06, -0.485997, 0.87396, -5.43763e-14, 5.658, 0.029508 ) +bone_name = "bone_2" + +[node name="RemoteTransform" type="RemoteTransform" parent="Mesh/Armature/Skeleton/BoneAttachment" index="0"] +remote_path = NodePath("../../../../../TouchArea") + +[editable path="Mesh"] diff --git a/Global/BodyPartLoader.gd b/Global/BodyPartLoader.gd index f6a1098..fcf112d 100644 --- a/Global/BodyPartLoader.gd +++ b/Global/BodyPartLoader.gd @@ -12,3 +12,4 @@ func _ready(): bodyparts["Chicken Head"] = load("res://BodyParts/ChickenHead.tscn") bodyparts["Wings"] = load("res://BodyParts/Wings.tscn") bodyparts["Bull Head"] = load("res://BodyParts/BullHead.tscn") + bodyparts["Human head"] = load("res://BodyParts/HumanHead.tscn")