Merge branch 'master' of https://gitlab.hexaquo.at/ggjg20/bodypartfighter
This commit is contained in:
commit
22b953d1f4
BIN
3D Input/imker unwrapped.blend
Normal file
BIN
3D Input/imker unwrapped.blend
Normal file
Binary file not shown.
@ -20,16 +20,17 @@ func _physics_process(delta):
|
|||||||
|
|
||||||
var rot_vector = (-transform.basis.z).cross(ground.transform.basis.y)
|
var rot_vector = (-transform.basis.z).cross(ground.transform.basis.y)
|
||||||
|
|
||||||
|
var _should_fix_torque = false
|
||||||
|
|
||||||
for body in get_colliding_bodies():
|
for body in get_colliding_bodies():
|
||||||
if body.name == "StaticBody":
|
if body.name == "StaticBody":
|
||||||
if current_angle > 0.3:
|
_should_fix_torque = true
|
||||||
apply_torque_impulse(rot_vector * current_angle * 7)
|
|
||||||
apply_impulse(transform.basis.xform(Vector3.ZERO), -(transform.basis.y) * 0.05)
|
if _should_fix_torque:
|
||||||
elif current_angle > 0.05:
|
if current_angle > 0.3:
|
||||||
apply_torque_impulse(-(rot_vector * current_angle * 5))
|
apply_torque_impulse(rot_vector * current_angle * 7)
|
||||||
else:
|
apply_impulse(transform.basis.xform(Vector3.ZERO), -(transform.basis.y) * 0.05)
|
||||||
angular_velocity = Vector3.ZERO
|
|
||||||
|
# if current_angle < 0.1:
|
||||||
for axis in angular_velocity:
|
# angular_velocity.x = 0
|
||||||
if axis > 10:
|
|
||||||
axis -= axis * 0.75
|
|
||||||
|
@ -16,6 +16,7 @@ mass = 1.73469
|
|||||||
gravity_scale = 1.5
|
gravity_scale = 1.5
|
||||||
contacts_reported = 5
|
contacts_reported = 5
|
||||||
contact_monitor = true
|
contact_monitor = true
|
||||||
|
angular_damp = 0.5
|
||||||
script = ExtResource( 1 )
|
script = ExtResource( 1 )
|
||||||
|
|
||||||
[node name="TorsoCollider" type="CollisionShape" parent="."]
|
[node name="TorsoCollider" type="CollisionShape" parent="."]
|
||||||
|
@ -14,6 +14,8 @@ albedo_texture = ExtResource( 4 )
|
|||||||
[node name="Bullhead" instance=ExtResource( 1 )]
|
[node name="Bullhead" instance=ExtResource( 1 )]
|
||||||
transform = Transform( -1, 3.25841e-07, 0, 5.30863e-14, 1.62921e-07, -1, -3.25841e-07, -1, -1.62921e-07, 0, -3.28412, 0.289329 )
|
transform = Transform( -1, 3.25841e-07, 0, 5.30863e-14, 1.62921e-07, -1, -3.25841e-07, -1, -1.62921e-07, 0, -3.28412, 0.289329 )
|
||||||
script = ExtResource( 2 )
|
script = ExtResource( 2 )
|
||||||
|
cost = 35.0
|
||||||
|
damage = 30.0
|
||||||
|
|
||||||
[node name="TouchArea" parent="." index="1"]
|
[node name="TouchArea" parent="." index="1"]
|
||||||
transform = Transform( -1.71568, 8.52651e-14, 1.49989e-07, 1.27871e-07, -0.89673, 1.46268, 7.83945e-08, 1.46267, 0.89673, -0.002635, -0.0220304, -0.00495291 )
|
transform = Transform( -1.71568, 8.52651e-14, 1.49989e-07, 1.27871e-07, -0.89673, 1.46268, 7.83945e-08, 1.46267, 0.89673, -0.002635, -0.0220304, -0.00495291 )
|
||||||
|
@ -19,7 +19,7 @@ func _is_animation_playing():
|
|||||||
|
|
||||||
func push(body):
|
func push(body):
|
||||||
# We multiply by 0.1 because we only want it to spin slightly, it should mostly go up
|
# 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 offset = transform.basis.xform(-touch_area.global_transform.origin + base.global_transform.origin) * 0.1
|
||||||
var direction = (base.transform.basis.y - base.transform.basis.z).normalized() * 20.0
|
var direction = (base.transform.basis.y - base.transform.basis.z).normalized() * 20.0
|
||||||
|
|
||||||
base.apply_impulse(offset, direction)
|
base.apply_impulse(offset, direction)
|
||||||
|
@ -12,7 +12,7 @@ extents = Vector3( 0.533899, 0.405119, 2.17243 )
|
|||||||
radius = 0.101154
|
radius = 0.101154
|
||||||
|
|
||||||
[node name="HumanArm" instance=ExtResource( 1 )]
|
[node name="HumanArm" instance=ExtResource( 1 )]
|
||||||
transform = Transform( -4.37114e-08, 1, 4.37114e-08, 0, -4.37114e-08, 1, 1, 4.37114e-08, 1.91069e-15, 0, 0, 0 )
|
transform = Transform( -9.33901e-08, 1, 6.32685e-08, 0.419008, -1.83154e-08, 0.907982, 0.907982, 1.11307e-07, -0.419008, 0, 0, 0 )
|
||||||
script = ExtResource( 2 )
|
script = ExtResource( 2 )
|
||||||
cost = 10.0
|
cost = 10.0
|
||||||
damage = 5.0
|
damage = 5.0
|
||||||
@ -22,7 +22,7 @@ transform = Transform( 0.796097, 0.0325159, -0.604295, 0, 0.998555, 0.0537302, 0
|
|||||||
shape = SubResource( 1 )
|
shape = SubResource( 1 )
|
||||||
|
|
||||||
[node name="TouchArea" parent="." index="1"]
|
[node name="TouchArea" parent="." index="1"]
|
||||||
transform = Transform( -0.118289, 2.18551, 2.52493, -3.31556, -0.378316, 0.172131, 0.398447, -2.49922, 2.18193, -0.0255739, -0.127111, -3.79535 )
|
transform = Transform( -0.118288, 2.18551, 2.52493, -3.31556, -0.378316, 0.172131, 0.398447, -2.49922, 2.18193, -0.025574, -0.127111, -3.79535 )
|
||||||
|
|
||||||
[node name="CollisionShape" type="CollisionShape" parent="TouchArea" index="0"]
|
[node name="CollisionShape" type="CollisionShape" parent="TouchArea" index="0"]
|
||||||
shape = SubResource( 2 )
|
shape = SubResource( 2 )
|
||||||
@ -40,9 +40,6 @@ remote_path = NodePath("../../../../../TouchArea")
|
|||||||
[node name="AnimationPlayer" parent="Mesh" index="2"]
|
[node name="AnimationPlayer" parent="Mesh" index="2"]
|
||||||
playback_speed = 3.0
|
playback_speed = 3.0
|
||||||
|
|
||||||
[node name="ActionSound" parent="." index="3"]
|
|
||||||
unit_db = 0.0
|
|
||||||
|
|
||||||
[node name="PushSound" parent="." index="4"]
|
[node name="PushSound" parent="." index="4"]
|
||||||
stream = ExtResource( 3 )
|
stream = ExtResource( 3 )
|
||||||
|
|
||||||
|
@ -15,21 +15,17 @@ func _is_animation_playing():
|
|||||||
|
|
||||||
func action():
|
func action():
|
||||||
anim.play("ArmatureAction")
|
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):
|
func push(body):
|
||||||
# We multiply by 0.1 because we only want it to spin slightly, it should mostly go up
|
# 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 offset = transform.basis.xform(touch_area.global_transform.origin - base.global_transform.origin) * 0.3
|
||||||
var direction = (base.transform.basis.y - base.transform.basis.z).normalized() * 10.0
|
var direction = (base.transform.basis.y - base.transform.basis.z).normalized() * 10.0
|
||||||
|
|
||||||
base.apply_impulse(offset, direction)
|
base.apply_impulse(offset, direction)
|
||||||
|
|
||||||
|
#base.apply_torque_impulse(base.transform.basis.y * 20.0)
|
||||||
|
|
||||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||||
#func _process(delta: float) -> void:
|
#func _process(delta: float) -> void:
|
||||||
# pass
|
# pass
|
||||||
|
22
BodyParts/Wings.gd
Normal file
22
BodyParts/Wings.gd
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
extends BodyPart
|
||||||
|
|
||||||
|
|
||||||
|
onready var anim = get_node("Mesh/AnimationPlayer")
|
||||||
|
onready var timer = get_node("Timer")
|
||||||
|
|
||||||
|
|
||||||
|
# Called when the node enters the scene tree for the first time.
|
||||||
|
func _ready() -> void:
|
||||||
|
pass # Replace with function body.
|
||||||
|
|
||||||
|
|
||||||
|
func action():
|
||||||
|
if timer.time_left == 0:
|
||||||
|
anim.play("ArmatureAction")
|
||||||
|
|
||||||
|
var offset = transform.basis.xform(Vector3.ZERO)
|
||||||
|
var direction = (-base.transform.basis.z).normalized() * 30.0
|
||||||
|
|
||||||
|
base.apply_impulse(offset, direction)
|
||||||
|
|
||||||
|
timer.start()
|
26
BodyParts/Wings.tscn
Normal file
26
BodyParts/Wings.tscn
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
[gd_scene load_steps=5 format=2]
|
||||||
|
|
||||||
|
[ext_resource path="res://3D Input/Fertige GLBs/vogel_flügel.glb" type="PackedScene" id=1]
|
||||||
|
[ext_resource path="res://BodyParts/BodyPart.tscn" type="PackedScene" id=2]
|
||||||
|
[ext_resource path="res://BodyParts/Wings.gd" type="Script" id=3]
|
||||||
|
|
||||||
|
[sub_resource type="BoxShape" id=1]
|
||||||
|
extents = Vector3( 2.75562, 0.605394, 2.0419 )
|
||||||
|
|
||||||
|
[node name="Wings" instance=ExtResource( 2 )]
|
||||||
|
transform = Transform( 0.440754, -0.897628, 0, 0.897628, 0.440754, 0, 0, 0, 1, 0, 0, 0 )
|
||||||
|
script = ExtResource( 3 )
|
||||||
|
cost = 30.0
|
||||||
|
|
||||||
|
[node name="PartCollider" parent="." index="0"]
|
||||||
|
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -2.80638 )
|
||||||
|
shape = SubResource( 1 )
|
||||||
|
|
||||||
|
[node name="Mesh" parent="." index="2" instance=ExtResource( 1 )]
|
||||||
|
transform = Transform( -0.517952, -0.85541, 1.14363e-07, 4.41231e-09, 1.31023e-07, 1, -0.85541, 0.517952, -6.40892e-08, 1.08802, 0.236862, -3.57712 )
|
||||||
|
|
||||||
|
[node name="Timer" type="Timer" parent="." index="3"]
|
||||||
|
wait_time = 1.5
|
||||||
|
one_shot = true
|
||||||
|
|
||||||
|
[editable path="Mesh"]
|
@ -10,4 +10,5 @@ func _ready():
|
|||||||
bodyparts["Gorilla Arm"] = load("res://BodyParts/GorillaArm.tscn")
|
bodyparts["Gorilla Arm"] = load("res://BodyParts/GorillaArm.tscn")
|
||||||
bodyparts["Horse Leg"] = load("res://BodyParts/HorseLeg.tscn")
|
bodyparts["Horse Leg"] = load("res://BodyParts/HorseLeg.tscn")
|
||||||
bodyparts["Chicken Head"] = load("res://BodyParts/ChickenHead.tscn")
|
bodyparts["Chicken Head"] = load("res://BodyParts/ChickenHead.tscn")
|
||||||
|
bodyparts["Wings"] = load("res://BodyParts/Wings.tscn")
|
||||||
bodyparts["Bull Head"] = load("res://BodyParts/BullHead.tscn")
|
bodyparts["Bull Head"] = load("res://BodyParts/BullHead.tscn")
|
||||||
|
@ -92,6 +92,7 @@ script = ExtResource( 6 )
|
|||||||
|
|
||||||
[node name="Camera" type="Camera" parent="CameraFocus"]
|
[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 )
|
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 )
|
||||||
|
far = 500.0
|
||||||
[connection signal="pressed" from="UI/ESC Menu" to="." method="_on_ESC_Menu_pressed"]
|
[connection signal="pressed" from="UI/ESC Menu" to="." method="_on_ESC_Menu_pressed"]
|
||||||
|
|
||||||
[editable path="Arena"]
|
[editable path="Arena"]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user