This commit is contained in:
Leon Palluch 2020-02-02 16:17:22 +01:00
commit e70981bd49
23 changed files with 331 additions and 40 deletions

Binary file not shown.

BIN
3D Input/Walking.fbx Normal file

Binary file not shown.

View File

@ -2,33 +2,35 @@
importer="texture"
type="StreamTexture"
path="res://.import/huhntextur.png-a31af8e4947b19bec12f70e34f5f09d2.stex"
path.s3tc="res://.import/huhntextur.png-a31af8e4947b19bec12f70e34f5f09d2.s3tc.stex"
path.etc2="res://.import/huhntextur.png-a31af8e4947b19bec12f70e34f5f09d2.etc2.stex"
metadata={
"vram_texture": false
"imported_formats": [ "s3tc", "etc2" ],
"vram_texture": true
}
[deps]
source_file="res://3D Input/huhntextur.png"
dest_files=[ "res://.import/huhntextur.png-a31af8e4947b19bec12f70e34f5f09d2.stex" ]
dest_files=[ "res://.import/huhntextur.png-a31af8e4947b19bec12f70e34f5f09d2.s3tc.stex", "res://.import/huhntextur.png-a31af8e4947b19bec12f70e34f5f09d2.etc2.stex" ]
[params]
compress/mode=0
compress/mode=2
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/repeat=true
flags/filter=true
flags/mipmaps=false
flags/mipmaps=true
flags/anisotropic=false
flags/srgb=2
flags/srgb=1
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=true
detect_3d=false
svg/scale=1.0

Binary file not shown.

Binary file not shown.

View File

@ -2,33 +2,35 @@
importer="texture"
type="StreamTexture"
path="res://.import/stiertextur.png-deb6038266d9a20bfe850d7c34f3aec9.stex"
path.s3tc="res://.import/stiertextur.png-deb6038266d9a20bfe850d7c34f3aec9.s3tc.stex"
path.etc2="res://.import/stiertextur.png-deb6038266d9a20bfe850d7c34f3aec9.etc2.stex"
metadata={
"vram_texture": false
"imported_formats": [ "s3tc", "etc2" ],
"vram_texture": true
}
[deps]
source_file="res://3D Input/stiertextur.png"
dest_files=[ "res://.import/stiertextur.png-deb6038266d9a20bfe850d7c34f3aec9.stex" ]
dest_files=[ "res://.import/stiertextur.png-deb6038266d9a20bfe850d7c34f3aec9.s3tc.stex", "res://.import/stiertextur.png-deb6038266d9a20bfe850d7c34f3aec9.etc2.stex" ]
[params]
compress/mode=0
compress/mode=2
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/repeat=true
flags/filter=true
flags/mipmaps=false
flags/mipmaps=true
flags/anisotropic=false
flags/srgb=2
flags/srgb=1
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=true
detect_3d=false
svg/scale=1.0

View File

@ -13,6 +13,7 @@ radius = 0.591769
[node name="Arm" instance=ExtResource( 1 )]
script = ExtResource( 3 )
cost = 10.0
[node name="PartCollider" parent="." index="0"]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -2.83 )
@ -26,6 +27,9 @@ visible = false
[node name="Armature" parent="Mesh" index="1"]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 )
[node name="Skeleton" parent="Mesh/Armature" index="0"]
bones/2/bound_children = [ NodePath("BoneAttachment") ]
[node name="BoneAttachment" type="BoneAttachment" parent="Mesh/Armature/Skeleton" index="1"]
transform = Transform( 1, -1.98247e-23, -2.98292e-24, 6.50669e-24, -9.49949e-08, 1, -2.07684e-23, -1, -9.49949e-08, -2.23781e-16, -0.0078205, -5.05441 )
bone_name = "bone_2"

View File

@ -20,16 +20,17 @@ func _physics_process(delta):
var rot_vector = (-transform.basis.z).cross(ground.transform.basis.y)
var _should_fix_torque = false
for body in get_colliding_bodies():
if body.name == "StaticBody":
_should_fix_torque = true
if _should_fix_torque:
if current_angle > 0.3:
apply_torque_impulse(rot_vector * current_angle * 7)
apply_impulse(transform.basis.xform(Vector3.ZERO), -(transform.basis.y) * 0.05)
elif current_angle > 0.05:
apply_torque_impulse(-(rot_vector * current_angle * 5))
else:
angular_velocity = Vector3.ZERO
for axis in angular_velocity:
if axis > 10:
axis -= axis * 0.75
# if current_angle < 0.1:
# angular_velocity.x = 0

View File

@ -16,6 +16,7 @@ mass = 1.73469
gravity_scale = 1.5
contacts_reported = 5
contact_monitor = true
angular_damp = 0.5
script = ExtResource( 1 )
[node name="TorsoCollider" type="CollisionShape" parent="."]

31
BodyParts/BullHead.gd Normal file
View File

@ -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() * 19.0
base.apply_impulse(offset, direction)

42
BodyParts/BullHead.tscn Normal file
View File

@ -0,0 +1,42 @@
[gd_scene load_steps=7 format=2]
[ext_resource path="res://BodyParts/PushingBodyPart.tscn" type="PackedScene" id=1]
[ext_resource path="res://BodyParts/BullHead.gd" type="Script" id=2]
[ext_resource path="res://3D Input/Fertige GLBs/Kopf_Stier.glb" type="PackedScene" id=3]
[ext_resource path="res://3D Input/stiertextur.png" type="Texture" id=4]
[sub_resource type="CylinderShape" id=1]
height = 1.94931
[sub_resource type="SpatialMaterial" id=2]
albedo_texture = ExtResource( 4 )
[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 )
script = ExtResource( 2 )
cost = 35.0
damage = 30.0
[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 )
[node name="CollisionShape" type="CollisionShape" parent="TouchArea" index="0"]
transform = Transform( 1, 0, 8.88178e-15, 0, 1, -2.98023e-08, -1.06581e-14, 0, 1, 0, 0, 0 )
shape = SubResource( 1 )
[node name="Mesh" parent="." index="4" instance=ExtResource( 3 )]
[node name="Skeleton" parent="Mesh/Armature" index="0"]
bones/2/bound_children = [ NodePath("BoneAttachment") ]
[node name="Cube" parent="Mesh/Armature/Skeleton" index="0"]
material/0 = SubResource( 2 )
[node name="BoneAttachment" type="BoneAttachment" parent="Mesh/Armature/Skeleton" index="1"]
transform = Transform( -1, 2.84217e-14, 8.74227e-08, 3.11325e-08, 0.934442, 0.356115, -8.16914e-08, 0.356115, -0.934442, 1.59719e-14, 1.68091, 0.12745 )
bone_name = "bone_2"
[node name="RemoteTransform" type="RemoteTransform" parent="Mesh/Armature/Skeleton/BoneAttachment" index="0"]
remote_path = NodePath("../../../../../TouchArea")
[editable path="Mesh"]

31
BodyParts/ChickenHead.gd Normal file
View File

@ -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() * 19.0
base.apply_impulse(offset, direction)

View File

@ -0,0 +1,49 @@
[gd_scene load_steps=8 format=2]
[ext_resource path="res://3D Input/Fertige GLBs/Kopf_Huhn.glb" type="PackedScene" id=1]
[ext_resource path="res://BodyParts/PushingBodyPart.tscn" type="PackedScene" id=2]
[ext_resource path="res://3D Input/huhntextur.png" type="Texture" id=3]
[ext_resource path="res://BodyParts/ChickenHead.gd" type="Script" id=4]
[sub_resource type="CapsuleShape" id=1]
radius = 2.24173
height = 1.97047
[sub_resource type="SphereShape" id=2]
radius = 1.42519
[sub_resource type="SpatialMaterial" id=3]
albedo_texture = ExtResource( 3 )
[node name="PushingBodyPart" instance=ExtResource( 2 )]
transform = Transform( 1.59259e-14, 9.77524e-08, -0.6, 0.6, -9.77524e-08, 0, -9.77524e-08, -0.6, -9.77524e-08, 0, -1.20668, -0.531835 )
script = ExtResource( 4 )
[node name="PartCollider" parent="." index="0"]
transform = Transform( 0.915992, 6.53632e-08, -0.401197, 0.401197, -1.49234e-07, 0.915992, 1.42109e-14, -1, -1.62921e-07, 0, 0, 0 )
shape = SubResource( 1 )
[node name="TouchArea" parent="." index="1"]
transform = Transform( 0.850008, -0.52677, 6.77808e-09, 0.52677, 0.850008, -6.12467e-09, -2.53514e-09, 8.77651e-09, 1, 0.080676, 1.20809, 0.184276 )
[node name="CollisionShape" type="CollisionShape" parent="TouchArea" index="0"]
transform = Transform( 1, -2.22497e-17, 2.22045e-16, -2.22497e-17, 1, 8.88178e-16, -4.44089e-16, -8.88178e-16, 1, 0, 0, 0 )
shape = SubResource( 2 )
[node name="Mesh" parent="." index="4" instance=ExtResource( 1 )]
[node name="Skeleton" parent="Mesh/Armature" index="0"]
bones/2/bound_children = [ NodePath("BoneAttachment") ]
[node name="Sphere" parent="Mesh/Armature/Skeleton" index="0"]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 2.38419e-07, 0 )
material/0 = SubResource( 3 )
[node name="BoneAttachment" type="BoneAttachment" parent="Mesh/Armature/Skeleton" index="1"]
transform = Transform( 0.850008, -0.52677, 6.77809e-09, 0.52677, 0.850008, -6.12466e-09, -2.53514e-09, 8.7765e-09, 1, -1.2109, 4.72113, 5.44753e-07 )
bone_name = "end"
[node name="RemoteTransform" type="RemoteTransform" parent="Mesh/Armature/Skeleton/BoneAttachment" index="0"]
remote_path = NodePath("../../../../../TouchArea")
[editable path="Mesh"]

View File

@ -19,7 +19,7 @@ func _is_animation_playing():
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 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
base.apply_impulse(offset, direction)

31
BodyParts/HorseLeg.gd Normal file
View File

@ -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() * 19.0
base.apply_impulse(offset, direction)

51
BodyParts/HorseLeg.tscn Normal file
View File

@ -0,0 +1,51 @@
[gd_scene load_steps=8 format=2]
[ext_resource path="res://3D Input/Fertige GLBs/Bein_Pferd.glb" type="PackedScene" id=1]
[ext_resource path="res://BodyParts/PushingBodyPart.tscn" type="PackedScene" id=2]
[ext_resource path="res://3D Input/pferdtextur.png" type="Texture" id=3]
[ext_resource path="res://BodyParts/HorseLeg.gd" type="Script" id=4]
[sub_resource type="BoxShape" id=1]
extents = Vector3( 0.452502, 2.45458, 0.822059 )
[sub_resource type="SphereShape" id=2]
radius = 0.195173
[sub_resource type="SpatialMaterial" id=3]
albedo_texture = ExtResource( 3 )
[node name="HorseLeg" instance=ExtResource( 2 )]
transform = Transform( -1, -3.89414e-07, -1.70218e-14, 0, -4.37114e-08, 1, -3.89414e-07, 1, 4.37114e-08, -0.194821, -0.336704, 1.57652 )
script = ExtResource( 4 )
cost = 35.0
damage = 15.0
[node name="PartCollider" parent="." index="0"]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 1.35601e-06, -3.54662, -8.9407e-08 )
shape = SubResource( 1 )
[node name="TouchArea" parent="." index="1"]
transform = Transform( -2.11393, -0.0496968, -0.0081882, 0.0470753, -1.82726, -1.06308, 0.0179093, -1.06296, 1.82785, -0.0114926, -5.48133, 0.244033 )
[node name="CollisionShape" type="CollisionShape" parent="TouchArea" index="0"]
transform = Transform( 1, 0, -1.86265e-09, 1.86265e-09, 1, 0, 0, -2.98023e-08, 1, 0, 0, 0 )
shape = SubResource( 2 )
[node name="Mesh" parent="." index="4" instance=ExtResource( 1 )]
transform = Transform( 0.5, 0, 0, 0, 0.5, 0, 0, 0, 0.5, 0, -7, 0 )
[node name="Skeleton" parent="Mesh/Armature" index="0"]
bones/2/bound_children = [ NodePath("BoneAttachment") ]
[node name="Cube" parent="Mesh/Armature/Skeleton" index="0"]
transform = Transform( 1, -2.84217e-14, -3.55271e-15, -2.84217e-14, 1, 0, 0, 0, 1, 0, 0, 0 )
material/0 = SubResource( 3 )
[node name="BoneAttachment" type="BoneAttachment" parent="Mesh/Armature/Skeleton" index="1"]
transform = Transform( -0.999716, -0.0235025, -0.00387234, -0.020936, 0.789477, 0.613423, -0.0113599, 0.61333, -0.789745, -0.00543504, 1.86361, 0.173834 )
bone_name = "bone_2"
[node name="RemoteTransform" type="RemoteTransform" parent="Mesh/Armature/Skeleton/BoneAttachment" index="0"]
remote_path = NodePath("../../../../../TouchArea")
[editable path="Mesh"]

View File

@ -12,7 +12,7 @@ extents = Vector3( 0.533899, 0.405119, 2.17243 )
radius = 0.101154
[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 )
cost = 10.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 )
[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"]
shape = SubResource( 2 )
@ -40,9 +40,6 @@ remote_path = NodePath("../../../../../TouchArea")
[node name="AnimationPlayer" parent="Mesh" index="2"]
playback_speed = 3.0
[node name="ActionSound" parent="." index="3"]
unit_db = 0.0
[node name="PushSound" parent="." index="4"]
stream = ExtResource( 3 )

View File

@ -16,20 +16,16 @@ func _is_animation_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 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
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.
#func _process(delta: float) -> void:
# pass

22
BodyParts/Wings.gd Normal file
View 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
View 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 = 25.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"]

View File

@ -8,3 +8,7 @@ func _ready():
bodyparts["Human Leg"] = load("res://BodyParts/HumanLeg.tscn")
bodyparts["Frog Leg"] = load("res://BodyParts/FrogLeg.tscn")
bodyparts["Gorilla Arm"] = load("res://BodyParts/GorillaArm.tscn")
bodyparts["Horse Leg"] = load("res://BodyParts/HorseLeg.tscn")
bodyparts["Chicken Head"] = load("res://BodyParts/ChickenHead.tscn")
bodyparts["Wings"] = load("res://BodyParts/Wings.tscn")
bodyparts["Bull Head"] = load("res://BodyParts/BullHead.tscn")

View File

@ -92,6 +92,7 @@ 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 )
far = 500.0
[connection signal="pressed" from="UI/ESC Menu" to="." method="_on_ESC_Menu_pressed"]
[editable path="Arena"]