This commit is contained in:
buchibob 2020-02-02 12:57:08 +01:00
commit 3de699cf2f
32 changed files with 318 additions and 37 deletions

Binary file not shown.

BIN
3D Input/Flugeltextur.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 448 KiB

Binary file not shown.

Binary file not shown.

View File

@ -2,33 +2,35 @@
importer="texture"
type="StreamTexture"
path="res://.import/froschtexture.png-4981f80e68642c0c23396f3b44826854.stex"
path.s3tc="res://.import/froschtexture.png-4981f80e68642c0c23396f3b44826854.s3tc.stex"
path.etc2="res://.import/froschtexture.png-4981f80e68642c0c23396f3b44826854.etc2.stex"
metadata={
"vram_texture": false
"imported_formats": [ "s3tc", "etc2" ],
"vram_texture": true
}
[deps]
source_file="res://3D Input/froschtexture.png"
dest_files=[ "res://.import/froschtexture.png-4981f80e68642c0c23396f3b44826854.stex" ]
dest_files=[ "res://.import/froschtexture.png-4981f80e68642c0c23396f3b44826854.s3tc.stex", "res://.import/froschtexture.png-4981f80e68642c0c23396f3b44826854.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

@ -2,33 +2,35 @@
importer="texture"
type="StreamTexture"
path="res://.import/gorillaarmtexture.png-c64af8f8e427f7cc8fbbb08cb004940b.stex"
path.s3tc="res://.import/gorillaarmtexture.png-c64af8f8e427f7cc8fbbb08cb004940b.s3tc.stex"
path.etc2="res://.import/gorillaarmtexture.png-c64af8f8e427f7cc8fbbb08cb004940b.etc2.stex"
metadata={
"vram_texture": false
"imported_formats": [ "s3tc", "etc2" ],
"vram_texture": true
}
[deps]
source_file="res://3D Input/gorillaarmtexture.png"
dest_files=[ "res://.import/gorillaarmtexture.png-c64af8f8e427f7cc8fbbb08cb004940b.stex" ]
dest_files=[ "res://.import/gorillaarmtexture.png-c64af8f8e427f7cc8fbbb08cb004940b.s3tc.stex", "res://.import/gorillaarmtexture.png-c64af8f8e427f7cc8fbbb08cb004940b.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.

BIN
3D Input/stiertextur.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 59 KiB

View File

@ -1,8 +1,9 @@
[gd_scene load_steps=4 format=2]
[gd_scene load_steps=5 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]
[ext_resource path="res://BodyConfig/LoadBodyParts.gd" type="Script" id=3]
[ext_resource path="res://Ingame/Arena.tscn" type="PackedScene" id=4]
[node name="Body Builder Menu" type="Spatial"]
script = ExtResource( 2 )
@ -96,4 +97,7 @@ __meta__ = {
}
[node name="Torso" parent="." instance=ExtResource( 1 )]
[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 )
[connection signal="pressed" from="GUI/HBoxC/VBoxC/Start" to="." method="_on_Start_pressed"]

View File

@ -173,4 +173,5 @@ func delete_body_part():
func _on_Start_pressed():
make_it_shine(false)
emit_signal("start_fight", _torso)

View File

@ -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)

View File

@ -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="."]

29
BodyParts/FrogLeg.gd Normal file
View File

@ -0,0 +1,29 @@
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 action():
anim.play("ArmatureAction")
func _is_animation_playing():
return anim.is_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 direction = (base.transform.basis.y - base.transform.basis.z).normalized() * 20.0
base.apply_impulse(offset, direction)
# Called every frame. 'delta' is the elapsed time since the previous frame.
#func _process(delta: float) -> void:
# pass

49
BodyParts/FrogLeg.tscn Normal file
View File

@ -0,0 +1,49 @@
[gd_scene load_steps=8 format=2]
[ext_resource path="res://BodyParts/PushingBodyPart.tscn" type="PackedScene" id=1]
[ext_resource path="res://BodyParts/FrogLeg.gd" type="Script" id=2]
[ext_resource path="res://3D Input/Fertige GLBs/Bein_Frosch.glb" type="PackedScene" id=3]
[ext_resource path="res://3D Input/froschtexture.png" type="Texture" id=4]
[sub_resource type="BoxShape" id=2]
extents = Vector3( 0.649825, 2.07811, 1.64282 )
[sub_resource type="SphereShape" id=3]
radius = 0.115004
[sub_resource type="SpatialMaterial" id=1]
albedo_texture = ExtResource( 4 )
roughness = 0.3
[node name="FrogLeg" instance=ExtResource( 1 )]
transform = Transform( -1, 8.74228e-08, 0, -8.74228e-08, -1, 0, 0, 0, 1, 0, 0, 0 )
script = ExtResource( 2 )
[node name="PartCollider" parent="." index="0"]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0.21377, -0.911304, -3.94992 )
shape = SubResource( 2 )
[node name="TouchArea" parent="." index="1"]
transform = Transform( 2.2019, -0.624093, -2.57245, 1.35866, 3.13817, 0.40161, 2.27179, -1.27191, 2.25313, 0.307055, -2.49965, -4.98782 )
[node name="CollisionShape" type="CollisionShape" parent="TouchArea" index="0"]
shape = SubResource( 3 )
[node name="Mesh" parent="." index="2" instance=ExtResource( 3 )]
transform = Transform( -1.13133e-08, 4.2222e-08, 1, 0.965926, 0.258819, 0, -0.258819, 0.965926, -4.37114e-08, 0.734499, -2.94707, -2.68774 )
[node name="froschbein" parent="Mesh/Armature/Skeleton" index="0"]
transform = Transform( 1, -1.49012e-08, 0, 0, 1, -5.96046e-08, 0, 2.98023e-08, 1, 0, 0, 0 )
material/0 = SubResource( 1 )
[node name="BoneAttachment" type="BoneAttachment" parent="Mesh/Armature/Skeleton" index="1"]
transform = Transform( -0.207654, -0.97489, 0.0804374, -0.106263, -0.059262, -0.99257, 0.972414, -0.214658, -0.091288, 0.208948, 1.33566, -0.895561 )
bone_name = "bone_3"
[node name="RemoteTransform" type="RemoteTransform" parent="Mesh/Armature/Skeleton/BoneAttachment" index="0"]
remote_path = NodePath("../../../../../TouchArea")
[node name="AnimationPlayer" parent="Mesh" index="2"]
playback_speed = 2.0
[editable path="Mesh"]

29
BodyParts/GorillaArm.gd Normal file
View File

@ -0,0 +1,29 @@
extends PushingBodyPart
onready var anim = get_node("Mesh/AnimationPlayer")
func _is_animation_playing():
return anim.is_playing()
func action():
anim.play("ArmatureAction")
# Apply a slight impulse here too
var offset = touch_area.global_transform.origin - base.global_transform.origin
var direction = base.transform.basis.y * 2.0
base.apply_impulse(offset, direction)
func push(body):
var offset = touch_area.global_transform.origin - base.global_transform.origin
var direction = -base.transform.basis.y * 10.0
base.apply_impulse(offset, direction)
# Called every frame. 'delta' is the elapsed time since the previous frame.
#func _process(delta: float) -> void:
# pass

47
BodyParts/GorillaArm.tscn Normal file
View File

@ -0,0 +1,47 @@
[gd_scene load_steps=8 format=2]
[ext_resource path="res://BodyParts/PushingBodyPart.tscn" type="PackedScene" id=1]
[ext_resource path="res://BodyParts/GorillaArm.gd" type="Script" id=2]
[ext_resource path="res://3D Input/Fertige GLBs/Arm_Gorilla.glb" type="PackedScene" id=3]
[ext_resource path="res://3D Input/gorillaarmtexture.png" type="Texture" id=4]
[sub_resource type="BoxShape" id=2]
extents = Vector3( 1.21214, 1, 2.81197 )
[sub_resource type="SphereShape" id=3]
radius = 0.175235
[sub_resource type="SpatialMaterial" id=1]
albedo_texture = ExtResource( 4 )
[node name="GorillaArm" instance=ExtResource( 1 )]
transform = Transform( 1, 0, 0, 0, 0.966025, 0.258448, 0, -0.258448, 0.966025, 0, 0, 0 )
script = ExtResource( 2 )
[node name="PartCollider" parent="." index="0"]
transform = Transform( 1, 0, 0, 0, 0.534515, -0.845159, 0, 0.845159, 0.534515, -0.0701199, -4.33779, -2.5341 )
shape = SubResource( 2 )
[node name="TouchArea" parent="." index="1"]
transform = Transform( 0.00565114, -1.25635, 4.34486, 2.47947, -3.63292, -1.05371, 3.78264, 2.38321, 0.684203, -0.142621, -4.9139, -2.02559 )
[node name="CollisionShape" type="CollisionShape" parent="TouchArea" index="0"]
shape = SubResource( 3 )
[node name="Mesh" parent="." index="2" instance=ExtResource( 3 )]
transform = Transform( -1.74846e-08, 0.4, 0, -0.4, -1.74846e-08, 0, 0, -2.66454e-15, 0.4, -9.43966, -0.0575844, 0.086014 )
[node name="Skeleton" parent="Mesh/Armature" index="0"]
bones/14/bound_children = [ NodePath("BoneAttachment") ]
[node name="Cube" parent="Mesh/Armature/Skeleton" index="0"]
material/0 = SubResource( 1 )
[node name="BoneAttachment" type="BoneAttachment" parent="Mesh/Armature/Skeleton" index="1"]
transform = Transform( 0.000982332, 0.274505, -0.961585, -0.54821, 0.80436, 0.229062, 0.83634, 0.526926, 0.151277, -0.00334232, 1.11071, -0.466874 )
bone_name = "bone_6"
[node name="RemoteTransform" type="RemoteTransform" parent="Mesh/Armature/Skeleton/BoneAttachment" index="0"]
remote_path = NodePath("../../../../../TouchArea")
[editable path="Mesh"]

View File

@ -4,6 +4,10 @@ extends PushingBodyPart
onready var anim = get_node("Mesh/AnimationPlayer")
func _is_animation_playing():
return anim.is_playing()
func action():
anim.play("ArmatureAction")

View File

@ -28,9 +28,6 @@ shape = SubResource( 2 )
[node name="Mesh" parent="." index="2" instance=ExtResource( 4 )]
transform = Transform( 2, 0, 0, 0, 2, 0, 0, 0, 2, -0.357728, -8.51476, 0 )
[node name="Skeleton" parent="Mesh/Armature" index="0"]
bones/7/bound_children = [ NodePath("BoneAttachment") ]
[node name="BoneAttachment" type="BoneAttachment" parent="Mesh/Armature/Skeleton" index="1"]
transform = Transform( 0.0646207, -0.736312, -0.673549, -0.240426, 0.64359, -0.726627, 0.968514, 0.208894, -0.135439, 0.054756, 1.13784, 0.129916 )
bone_name = "bone_6"

View File

@ -9,6 +9,10 @@ func _ready() -> void:
pass # Replace with function body.
func _is_animation_playing():
return anim.is_playing()
func action():
anim.play("ArmatureAction")

View File

@ -6,7 +6,7 @@
[ext_resource path="res://3D Input/beinimage.png" type="Texture" id=4]
[sub_resource type="BoxShape" id=1]
extents = Vector3( 0.666, 2.378, 1.555 )
extents = Vector3( 0.666, 2.41488, 1.555 )
[sub_resource type="SphereShape" id=2]
radius = 0.108468
@ -35,6 +35,9 @@ transform = Transform( 2, 0, 0, 0, 2, 0, 0, 0, 2, -2.84217e-14, -4.37555, -0.049
[node name="Armature" parent="Mesh" index="2"]
transform = Transform( 1.97878, 0, 0, 0, -1.97636, 0.0978612, 8.47033e-22, -0.0978612, -1.97636, -1.33227e-14, 2.34477, 0.0119585 )
[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, 0, -8.88178e-16, -1.42109e-14, 1, -2.23517e-08, 4.44089e-16, 2.23517e-08, 1, 0, 0, 0 )
material/0 = SubResource( 3 )

View File

@ -11,8 +11,13 @@ func _ready() -> void:
touch_area.connect("body_entered", self, "_on_touch_area_entered")
# Override in derived classes!
func _is_animation_playing():
return true
func _on_touch_area_entered(body):
if body.name != base.name:
if body.name != base.name and _is_animation_playing():
if body.is_in_group("Terrain"):
push(body)
elif body.is_in_group("Player"):

View File

@ -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():

View File

@ -6,3 +6,5 @@ var bodyparts : Dictionary
func _ready():
bodyparts["Human Arm"] = load("res://BodyParts/HumanArm.tscn")
bodyparts["Human Leg"] = load("res://BodyParts/HumanLeg.tscn")
bodyparts["Frog Leg"] = load("res://BodyParts/FrogLeg.tscn")
bodyparts["Gorilla Arm"] = load("res://BodyParts/GorillaArm.tscn")

View File

@ -2,11 +2,9 @@
[ext_resource path="res://Ingame/Level/Torch.tscn" type="PackedScene" id=1]
[ext_resource path="res://Ingame/Level/Ground.tscn" type="PackedScene" id=2]
[ext_resource path="res://default_env.tres" type="Environment" id=3]
[ext_resource path="res://Ingame/Level/Fence.tscn" type="PackedScene" id=5]
[sub_resource type="Environment" id=1]
ambient_light_color = Color( 0.203922, 0.231373, 0.329412, 1 )
[sub_resource type="Curve3D" id=2]
_data = {
"points": PoolVector3Array( -6.18582, 0, 7.84923, 6.18582, 0, -7.84923, -49.9513, 0, -34.3585, -4.51454, 0, 0.679321, 4.51454, 0, -0.679321, -15.3927, 0, -53.766, -21.9094, 0, -9.41343, 21.9094, 0, 9.41343, 23.1226, 0, -50.5878, -3.51591, 0, -8.89224, 3.51591, 0, 8.89224, 48.9412, 0, -26.3448, -0.144619, 0, -5.61391, 0.144619, 0, 5.61391, 60.7732, 0, 13.6973, 4.99704, -4.57764e-05, -11.0807, -4.99704, 4.57764e-05, 11.0807, 54.4575, 0, 49.3261, 10.0432, 0, -5.64291, -10.0432, 0, 5.64291, 32.3244, 0, 71.386, 10.2301, 0, -1.21242, -10.2301, 0, 1.21242, 2.64864, -1.52588e-05, 80.1473, 8.65666, 0, 3.83833, -8.65666, 0, -3.83833, -24.225, 0, 77.5418, 6.10191, 0, 6.62698, -6.10191, 0, -6.62698, -47.3545, 0, 62.2559, 2.38824, 0, 9.77866, -2.38824, 0, -9.77866, -62.2404, 0, 29.8337, -1.39743, 0, 9.2999, 1.39743, 0, -9.2999, -65.2092, 0, -9.54412, 0, 0, 0, 0, 0, 0, -49.9513, 0, -34.3585 ),
@ -34,7 +32,7 @@ transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 52.7943, 0, 76.6803 )
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -0.293457, 0, 5.53332 )
[node name="WorldEnvironment" type="WorldEnvironment" parent="."]
environment = SubResource( 1 )
environment = ExtResource( 3 )
[node name="ground" parent="." instance=ExtResource( 2 )]

View File

@ -2,6 +2,18 @@ extends Spatial
onready var camera = get_node("Camera")
const DISTANCE_MOD = 0.2
const FOV_MOD = 0.2
var _look_at_vec = Vector3(0, 0, -1)
var _x_axis = Vector3(1, 0, 0)
func _ready():
var cam_rot = camera.rotation_degrees
_look_at_vec = _look_at_vec.rotated(Vector3(0, 1, 0), cam_rot.y * PI/180)
_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)
func _process(delta: float) -> void:
var player1 = get_parent().get_child(3)
@ -12,6 +24,6 @@ func _process(delta: float) -> void:
var center = player2.transform.origin + (player1.transform.origin - player2.transform.origin) / 2.0
var distance = (player1.transform.origin - player2.transform.origin).length()
camera.fov = distance + 50.0
camera.fov = distance * FOV_MOD + 60.0
transform.origin = center
transform.origin = center - _look_at_vec * distance * DISTANCE_MOD

17
Ingame/TrueTest.gd Normal file
View File

@ -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

62
Ingame/TrueTest.tscn Normal file
View File

@ -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"]

View File

@ -1,7 +1,7 @@
[gd_resource type="Environment" load_steps=2 format=2]
[sub_resource type="ProceduralSky" id=1]
[gd_resource type="Environment" format=2]
[resource]
background_mode = 2
background_sky = SubResource( 1 )
ambient_light_color = Color( 0.203922, 0.231373, 0.329412, 1 )
tonemap_mode = 2
tonemap_exposure = 0.6
tonemap_white = 1.5