diff --git a/3D Input/Fertige GLBs/Kopf_Mensch.glb b/3D Input/Fertige GLBs/Kopf_Mensch.glb index 757bc78..0f484a1 100644 Binary files a/3D Input/Fertige GLBs/Kopf_Mensch.glb and b/3D Input/Fertige GLBs/Kopf_Mensch.glb differ diff --git a/3D Input/Fertige GLBs/Kopf_Stier.glb b/3D Input/Fertige GLBs/Kopf_Stier.glb new file mode 100644 index 0000000..88a67c9 Binary files /dev/null and b/3D Input/Fertige GLBs/Kopf_Stier.glb differ diff --git a/3D Input/Flugeltextur.png b/3D Input/Flugeltextur.png new file mode 100644 index 0000000..2217538 Binary files /dev/null and b/3D Input/Flugeltextur.png differ diff --git a/3D Input/Mensch_Kopf.blend b/3D Input/Mensch_Kopf.blend index 0238458..c794403 100644 Binary files a/3D Input/Mensch_Kopf.blend and b/3D Input/Mensch_Kopf.blend differ diff --git a/3D Input/Mensch_Kopf.blend1 b/3D Input/Mensch_Kopf.blend1 index fca2543..5fba680 100644 Binary files a/3D Input/Mensch_Kopf.blend1 and b/3D Input/Mensch_Kopf.blend1 differ diff --git a/3D Input/hühnchen kopf.blend b/3D Input/hühnchen kopf.blend new file mode 100644 index 0000000..063182d Binary files /dev/null and b/3D Input/hühnchen kopf.blend differ diff --git a/3D Input/hühnchen kopf.blend1 b/3D Input/hühnchen kopf.blend1 new file mode 100644 index 0000000..add4805 Binary files /dev/null and b/3D Input/hühnchen kopf.blend1 differ diff --git a/3D Input/stier_kopf unwrapped.blend b/3D Input/stier_kopf unwrapped.blend index ee67caa..fe69f1b 100644 Binary files a/3D Input/stier_kopf unwrapped.blend and b/3D Input/stier_kopf unwrapped.blend differ diff --git a/3D Input/stier_kopf unwrapped.blend1 b/3D Input/stier_kopf unwrapped.blend1 index 3e7a6c2..4b32c29 100644 Binary files a/3D Input/stier_kopf unwrapped.blend1 and b/3D Input/stier_kopf unwrapped.blend1 differ diff --git a/3D Input/stiertextur.png b/3D Input/stiertextur.png new file mode 100644 index 0000000..8e3f43c Binary files /dev/null and b/3D Input/stiertextur.png differ diff --git a/3D Input/vogel_flügel unwrapped.blend b/3D Input/vogel_flügel unwrapped.blend index 3b552f9..b44d6dd 100644 Binary files a/3D Input/vogel_flügel unwrapped.blend and b/3D Input/vogel_flügel unwrapped.blend differ diff --git a/3D Input/vogel_flügel unwrapped.blend1 b/3D Input/vogel_flügel unwrapped.blend1 index bd02429..73c85a1 100644 Binary files a/3D Input/vogel_flügel unwrapped.blend1 and b/3D Input/vogel_flügel unwrapped.blend1 differ diff --git a/BodyParts/BodyBase/BodyBase.gd b/BodyParts/BodyBase/BodyBase.gd index 567b71d..fd312b3 100644 --- a/BodyParts/BodyBase/BodyBase.gd +++ b/BodyParts/BodyBase/BodyBase.gd @@ -14,11 +14,20 @@ func on_ingame(): axis_lock_linear_x = true -func _process(delta): +func _physics_process(delta): if ingame: current_angle = ((-transform.basis.z).angle_to(ground.transform.basis.y)) var rot_vector = (-transform.basis.z).cross(ground.transform.basis.y) - if current_angle > 0.2: - apply_torque_impulse(rot_vector * current_angle * 14) + if current_angle > 0.3: + apply_torque_impulse(rot_vector * current_angle * 7) + elif current_angle > 0.05: + apply_torque_impulse(-(rot_vector * current_angle * 20)) + else: + for body in get_colliding_bodies(): + if body.name == "StaticBody": + angular_velocity = Vector3.ZERO + + print("deg: %s" % rad2deg(current_angle)) + print("rad: %s" % current_angle) diff --git a/BodyParts/BodyBase/BodyBase.tscn b/BodyParts/BodyBase/BodyBase.tscn index e0962fb..7c23cf8 100644 --- a/BodyParts/BodyBase/BodyBase.tscn +++ b/BodyParts/BodyBase/BodyBase.tscn @@ -12,8 +12,10 @@ height = 1.48749 "Player", ]] transform = Transform( 1, 0, 0, 0, -1.62921e-07, -1, 0, 1, -1.62921e-07, 0, 0, 0 ) -mass = 1.5 +mass = 1.73469 gravity_scale = 1.5 +contacts_reported = 5 +contact_monitor = true script = ExtResource( 1 ) [node name="TorsoCollider" type="CollisionShape" parent="."] diff --git a/Controllers/GameStateController.gd b/Controllers/GameStateController.gd index 4b193df..4f84b75 100644 --- a/Controllers/GameStateController.gd +++ b/Controllers/GameStateController.gd @@ -87,6 +87,9 @@ func _switch_to_fighting(torso): _fighting_scene.add_child(torso) torso.on_ingame() + + _body_count = 0 + _bodies.clear() func _switch_to_body_build(): diff --git a/Ingame/CameraFocus.gd b/Ingame/CameraFocus.gd index 4c1bd55..4b9b26a 100644 --- a/Ingame/CameraFocus.gd +++ b/Ingame/CameraFocus.gd @@ -10,13 +10,9 @@ var _x_axis = Vector3(1, 0, 0) func _ready(): var cam_rot = camera.rotation_degrees - print(cam_rot.y) _look_at_vec = _look_at_vec.rotated(Vector3(0, 1, 0), cam_rot.y * PI/180) - print(_look_at_vec) - print(cam_rot.x) _x_axis = _x_axis.rotated(Vector3(0, 1, 0), cam_rot.y * PI/180) _look_at_vec = _look_at_vec.rotated(_x_axis, cam_rot.x * PI/180) - print(_look_at_vec) func _process(delta: float) -> void: diff --git a/Ingame/TrueTest.gd b/Ingame/TrueTest.gd new file mode 100644 index 0000000..bc16937 --- /dev/null +++ b/Ingame/TrueTest.gd @@ -0,0 +1,17 @@ +extends Spatial + + +# Declare member variables here. Examples: +# var a = 2 +# var b = "text" + + +# Called when the node enters the scene tree for the first time. +func _ready(): + get_parent().get_child(3).on_ingame() + get_parent().get_child(4).on_ingame() + + +# Called every frame. 'delta' is the elapsed time since the previous frame. +#func _process(delta): +# pass diff --git a/Ingame/TrueTest.tscn b/Ingame/TrueTest.tscn new file mode 100644 index 0000000..5e4d87b --- /dev/null +++ b/Ingame/TrueTest.tscn @@ -0,0 +1,62 @@ +[gd_scene load_steps=8 format=2] + +[ext_resource path="res://BodyParts/BodyBase/BodyBase.tscn" type="PackedScene" id=1] +[ext_resource path="res://UI/UI.tscn" type="PackedScene" id=2] +[ext_resource path="res://BodyParts/HumanLeg.tscn" type="PackedScene" id=3] +[ext_resource path="res://Ingame/Ingame.gd" type="Script" id=4] +[ext_resource path="res://Ingame/Arena.tscn" type="PackedScene" id=5] +[ext_resource path="res://Ingame/CameraFocus.gd" type="Script" id=6] +[ext_resource path="res://Ingame/TrueTest.gd" type="Script" id=7] + +[node name="InGame" type="Spatial"] +script = ExtResource( 4 ) + +[node name="UI" parent="." instance=ExtResource( 2 )] + +[node name="Arena" parent="." instance=ExtResource( 5 )] + +[node name="PathFollow3" parent="Arena/Path" index="2"] +transform = Transform( 0.0525302, 0, 0.998614, 0, 1, 0, -0.998619, 0, 0.0525299, 1.77306, 0, -55.9514 ) + +[node name="PathFollow6" parent="Arena/Path" index="5"] +transform = Transform( 0.951672, 0, 0.307114, 0, 1, 0, -0.307114, 0, 0.951672, 54.056, 0, -11.6692 ) + +[node name="PathFollow7" parent="Arena/Path" index="6"] +transform = Transform( 0.989853, 0, 0.142099, 0, 1, 0, -0.142099, 0, 0.98985, 60.6244, 0, 12.2053 ) + +[node name="PathFollow12" parent="Arena/Path" index="11"] +transform = Transform( -0.305839, 5.41201e-07, -0.952082, 4.12144e-07, 1, 4.36044e-07, 0.952083, -2.59036e-07, -0.305838, -20.2565, -9.77015e-07, 79.0522 ) + +[node name="PathFollow16" parent="Arena/Path" index="15"] +transform = Transform( -0.999998, 4.26235e-07, -0.00197735, 4.26236e-07, 1, 0, 0.00197735, -8.42818e-10, -0.999998, -65.6734, 0, -1.33537 ) + +[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, 19, 17, -2 ) + +[node name="Torso" parent="." instance=ExtResource( 1 )] +transform = Transform( 1, 0, 0, 0, -1.62921e-07, -1, 0, 1, -1.62921e-07, 0, 13.6326, 2.22103e-06 ) + +[node name="HumanLeg" parent="Torso/DownFrontLeft/Limb" index="0" instance=ExtResource( 3 )] +damage = 65.0 + +[node name="HumanLeg" parent="Torso/DownFrontRight/Limb" index="0" instance=ExtResource( 3 )] +damage = 83.0 + +[node name="Torso2" parent="." instance=ExtResource( 1 )] +transform = Transform( 1, 0, 0, 0, -1.62921e-07, -1, 0, 1, -1.62921e-07, 0, 13.6326, 36.3206 ) + +[node name="Spatial" type="Spatial" parent="."] +script = ExtResource( 7 ) + +[editable path="Arena"] + +[editable path="Torso"] + +[editable path="Torso/DownFrontLeft"] + +[editable path="Torso/DownFrontRight"] + +[editable path="Torso2"]