This commit is contained in:
Merlar 2020-02-02 13:14:54 +00:00
commit ba2d08d289
26 changed files with 171 additions and 46 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 MiB

BIN
Audio/frog_sound.wav Normal file

Binary file not shown.

View File

@ -0,0 +1,21 @@
[remap]
importer="wav"
type="AudioStreamSample"
path="res://.import/frog_sound.wav-7b3422836f30107969b2eff5469093eb.sample"
[deps]
source_file="res://Audio/frog_sound.wav"
dest_files=[ "res://.import/frog_sound.wav-7b3422836f30107969b2eff5469093eb.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

BIN
Audio/punch_sound.wav Normal file

Binary file not shown.

View File

@ -0,0 +1,21 @@
[remap]
importer="wav"
type="AudioStreamSample"
path="res://.import/punch_sound.wav-0f9d6ab352205acf0b589f4a1f454cc5.sample"
[deps]
source_file="res://Audio/punch_sound.wav"
dest_files=[ "res://.import/punch_sound.wav-0f9d6ab352205acf0b589f4a1f454cc5.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

View File

@ -51,7 +51,6 @@ func _ready():
func change_count_ui(): func change_count_ui():
if done_player_count == null: if done_player_count == null:
print("test")
done_player_count = 0 done_player_count = 0
_playerNum.text = str(done_player_count + 1) + "/" + str(InGameState.player_count) _playerNum.text = str(done_player_count + 1) + "/" + str(InGameState.player_count)
@ -169,6 +168,9 @@ func delete_body_part():
var body_part = _attachment_point.get_node("Limb").get_child(0) var body_part = _attachment_point.get_node("Limb").get_child(0)
if body_part != null: if body_part != null:
_costProgress.value -= body_part.cost _costProgress.value -= body_part.cost
#delete collider with id
var old_col_path = "LimbCollider" + str(_attachment_point.id)
_torso.get_node(old_col_path).queue_free()
body_part.queue_free() body_part.queue_free()

View File

@ -2,6 +2,7 @@ extends Spatial
export(int) var key export(int) var key
export(int) var id
onready var limb = get_node("Limb") onready var limb = get_node("Limb")
@ -15,7 +16,7 @@ func _unhandled_input(event):
if event is InputEventKey: if event is InputEventKey:
if event.pressed and event.scancode == key: if event.pressed and event.scancode == key:
if limb.get_child_count() > 0: if limb.get_child_count() > 0:
limb.get_child(0).action() limb.get_child(0).action_wrapper()
# Called every frame. 'delta' is the elapsed time since the previous frame. # Called every frame. 'delta' is the elapsed time since the previous frame.

View File

@ -25,6 +25,7 @@ shape = SubResource( 1 )
[node name="DownFrontLeft" parent="." instance=ExtResource( 2 )] [node name="DownFrontLeft" parent="." instance=ExtResource( 2 )]
transform = Transform( 0.965926, -1.45851e-07, -0.258819, -1.50996e-07, -1, -1.77636e-15, -0.258819, 3.90806e-08, -0.965926, 1.3, 1, 4.2 ) transform = Transform( 0.965926, -1.45851e-07, -0.258819, -1.50996e-07, -1, -1.77636e-15, -0.258819, 3.90806e-08, -0.965926, 1.3, 1, 4.2 )
key = 68 key = 68
id = 1
[node name="Mesh" parent="DownFrontLeft" index="0"] [node name="Mesh" parent="DownFrontLeft" index="0"]
transform = Transform( 0.2, 0, 3.72529e-09, 0, 0.2, 0, -3.72529e-09, 0, 0.2, 0, 0, 0 ) transform = Transform( 0.2, 0, 3.72529e-09, 0, 0.2, 0, -3.72529e-09, 0, 0.2, 0, 0, 0 )
@ -32,6 +33,7 @@ transform = Transform( 0.2, 0, 3.72529e-09, 0, 0.2, 0, -3.72529e-09, 0, 0.2, 0,
[node name="DownFrontRight" parent="." instance=ExtResource( 2 )] [node name="DownFrontRight" parent="." instance=ExtResource( 2 )]
transform = Transform( 0.965926, -1.45851e-07, 0.258819, -1.50996e-07, -1, 1.77636e-15, 0.258819, -3.90806e-08, -0.965926, -1.3, 1, 4.2 ) transform = Transform( 0.965926, -1.45851e-07, 0.258819, -1.50996e-07, -1, 1.77636e-15, 0.258819, -3.90806e-08, -0.965926, -1.3, 1, 4.2 )
key = 70 key = 70
id = 2
[node name="OmniLight" parent="DownFrontRight" index="1"] [node name="OmniLight" parent="DownFrontRight" index="1"]
transform = Transform( 1, 3.13083e-13, 0, -3.09641e-13, 1, -5.59552e-14, 0, 5.59552e-14, 1, -0.680858, -1.19209e-07, -1.38872 ) transform = Transform( 1, 3.13083e-13, 0, -3.09641e-13, 1, -5.59552e-14, 0, 5.59552e-14, 1, -0.680858, -1.19209e-07, -1.38872 )
@ -42,26 +44,32 @@ transform = Transform( 0.5, 1.4988e-15, 0, 1.4988e-15, 0.5, 0, 0, 0, 0.5, 0, 0,
[node name="DownBackRight" parent="." instance=ExtResource( 2 )] [node name="DownBackRight" parent="." instance=ExtResource( 2 )]
transform = Transform( 0.982402, -3.24601e-07, 0.0859489, -3.2133e-07, -1, 0, 0.0859489, -2.83989e-08, -0.982402, -1.9, -1, 3.6 ) transform = Transform( 0.982402, -3.24601e-07, 0.0859489, -3.2133e-07, -1, 0, 0.0859489, -2.83989e-08, -0.982402, -1.9, -1, 3.6 )
key = 83 key = 83
id = 3
[node name="DownBackLeft" parent="." instance=ExtResource( 2 )] [node name="DownBackLeft" parent="." instance=ExtResource( 2 )]
transform = Transform( 0.982402, 3.24601e-07, -0.0859489, 3.2133e-07, -1, 0, -0.0859489, -2.83989e-08, -0.982402, 1.9, -1, 3.6 ) transform = Transform( 0.982402, 3.24601e-07, -0.0859489, 3.2133e-07, -1, 0, -0.0859489, -2.83989e-08, -0.982402, 1.9, -1, 3.6 )
key = 65 key = 65
id = 4
[node name="UpFrontLeft" parent="." instance=ExtResource( 2 )] [node name="UpFrontLeft" parent="." instance=ExtResource( 2 )]
transform = Transform( 0.103081, -3.40598e-08, -0.980752, -3.2133e-07, -1, 0, -0.980752, 3.24056e-07, -0.103081, 2.9, 0, -2 ) transform = Transform( 0.103081, -3.40598e-08, -0.980752, -3.2133e-07, -1, 0, -0.980752, 3.24056e-07, -0.103081, 2.9, 0, -2 )
key = 69 key = 69
id = 5
[node name="UpFrontRight" parent="." instance=ExtResource( 2 )] [node name="UpFrontRight" parent="." instance=ExtResource( 2 )]
transform = Transform( 0.103081, 3.40598e-08, 0.980752, 3.2133e-07, -1, 0, 0.980752, 3.24056e-07, -0.103081, -2.9, 0, -2 ) transform = Transform( 0.103081, 3.40598e-08, 0.980752, 3.2133e-07, -1, 0, 0.980752, 3.24056e-07, -0.103081, -2.9, 0, -2 )
key = 82 key = 82
id = 6
[node name="UpBackRight" parent="." instance=ExtResource( 2 )] [node name="UpBackRight" parent="." instance=ExtResource( 2 )]
transform = Transform( -0.870723, 0.384569, 0.26555, -1.84307e-07, -0.573576, 0.807811, 0.462972, 0.723268, 0.499426, -1, -1.9, -2.5 ) transform = Transform( -0.870723, 0.384569, 0.26555, -1.84307e-07, -0.573576, 0.807811, 0.462972, 0.723268, 0.499426, -1, -1.9, -2.5 )
key = 81 key = 81
id = 7
[node name="UpBackLeft" parent="." instance=ExtResource( 2 )] [node name="UpBackLeft" parent="." instance=ExtResource( 2 )]
transform = Transform( -0.870723, -0.384569, -0.26555, 1.84307e-07, -0.573576, 0.807811, -0.462972, 0.723268, 0.499426, 1, -1.9, -2.5 ) transform = Transform( -0.870723, -0.384569, -0.26555, 1.84307e-07, -0.573576, 0.807811, -0.462972, 0.723268, 0.499426, 1, -1.9, -2.5 )
key = 87 key = 87
id = 8
[node name="Head" parent="." instance=ExtResource( 2 )] [node name="Head" parent="." instance=ExtResource( 2 )]
transform = Transform( -0.986155, 3.25841e-07, 0, -3.2133e-07, -1, 0, 0, 0, 0.986155, 0, 0, -3.63054 ) transform = Transform( -0.986155, 3.25841e-07, 0, -3.2133e-07, -1, 0, 0, 0, 0.986155, 0, 0, -3.63054 )

View File

@ -6,6 +6,7 @@ class_name BodyPart
onready var base = get_parent().get_parent().get_parent() onready var base = get_parent().get_parent().get_parent()
onready var physics_shape = get_node("PartCollider") onready var physics_shape = get_node("PartCollider")
onready var action_sound = get_node("ActionSound")
var setup_done = false var setup_done = false
@ -23,7 +24,10 @@ func _process(delta: float) -> void:
var translation = physics_shape.global_transform var translation = physics_shape.global_transform
print(translation) print(translation)
var attach_id = get_parent().get_parent().id
remove_child(physics_shape) remove_child(physics_shape)
physics_shape.name = "LimbCollider" + str(attach_id)
base.add_child(physics_shape) base.add_child(physics_shape)
physics_shape.global_transform = translation physics_shape.global_transform = translation
@ -31,6 +35,13 @@ func _process(delta: float) -> void:
setup_done = true setup_done = true
func action_wrapper():
if not action_sound.playing:
action_sound.play()
action()
# Do something with the base # Do something with the base
func action(): func action():
pass pass

View File

@ -6,3 +6,6 @@
script = ExtResource( 1 ) script = ExtResource( 1 )
[node name="PartCollider" type="CollisionShape" parent="."] [node name="PartCollider" type="CollisionShape" parent="."]
[node name="ActionSound" type="AudioStreamPlayer3D" parent="."]
attenuation_model = 3

View File

@ -1,17 +1,18 @@
[gd_scene load_steps=8 format=2] [gd_scene load_steps=9 format=2]
[ext_resource path="res://BodyParts/PushingBodyPart.tscn" type="PackedScene" id=1] [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://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/Fertige GLBs/Bein_Frosch.glb" type="PackedScene" id=3]
[ext_resource path="res://3D Input/froschtexture.png" type="Texture" id=4] [ext_resource path="res://3D Input/froschtexture.png" type="Texture" id=4]
[ext_resource path="res://Audio/frog_sound.wav" type="AudioStream" id=5]
[sub_resource type="BoxShape" id=2] [sub_resource type="BoxShape" id=1]
extents = Vector3( 0.649825, 2.07811, 1.64282 ) extents = Vector3( 0.649825, 2.07811, 1.64282 )
[sub_resource type="SphereShape" id=3] [sub_resource type="SphereShape" id=2]
radius = 0.115004 radius = 0.115004
[sub_resource type="SpatialMaterial" id=1] [sub_resource type="SpatialMaterial" id=3]
albedo_texture = ExtResource( 4 ) albedo_texture = ExtResource( 4 )
roughness = 0.3 roughness = 0.3
@ -22,26 +23,23 @@ cost = 30.0
[node name="PartCollider" parent="." index="0"] [node name="PartCollider" parent="." index="0"]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0.21377, -0.911304, -3.94992 ) transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0.21377, -0.911304, -3.94992 )
shape = SubResource( 2 ) shape = SubResource( 1 )
[node name="TouchArea" parent="." index="1"] [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 ) transform = Transform( 2.20191, -0.624093, -2.57245, 1.26297, 3.18837, 0.307522, 2.32635, -1.14024, 2.26789, 0.307056, -2.38919, -4.91366 )
[node name="CollisionShape" type="CollisionShape" parent="TouchArea" index="0"] [node name="CollisionShape" type="CollisionShape" parent="TouchArea" index="0"]
shape = SubResource( 3 ) shape = SubResource( 2 )
[node name="Mesh" parent="." index="2" instance=ExtResource( 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 ) 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="Skeleton" parent="Mesh/Armature" index="0"]
bones/3/bound_children = [ NodePath("BoneAttachment") ]
[node name="froschbein" parent="Mesh/Armature/Skeleton" index="0"] [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 ) transform = Transform( 1, -1.49012e-08, 0, 0, 1, -5.96046e-08, 0, 2.98023e-08, 1, 0, 0, 0 )
material/0 = SubResource( 1 ) material/0 = SubResource( 3 )
[node name="BoneAttachment" type="BoneAttachment" parent="Mesh/Armature/Skeleton" index="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 ) transform = Transform( -0.176573, -0.978358, 0.107882, -0.111435, -0.0890297, -0.989776, 0.97796, -0.186789, -0.0933024, 0.184057, 1.31383, -0.875628 )
bone_name = "bone_3" bone_name = "bone_3"
[node name="RemoteTransform" type="RemoteTransform" parent="Mesh/Armature/Skeleton/BoneAttachment" index="0"] [node name="RemoteTransform" type="RemoteTransform" parent="Mesh/Armature/Skeleton/BoneAttachment" index="0"]
@ -50,4 +48,8 @@ remote_path = NodePath("../../../../../TouchArea")
[node name="AnimationPlayer" parent="Mesh" index="2"] [node name="AnimationPlayer" parent="Mesh" index="2"]
playback_speed = 2.0 playback_speed = 2.0
[node name="ActionSound" parent="." index="3"]
stream = ExtResource( 5 )
unit_db = 0.0
[editable path="Mesh"] [editable path="Mesh"]

View File

@ -1,17 +1,18 @@
[gd_scene load_steps=8 format=2] [gd_scene load_steps=9 format=2]
[ext_resource path="res://BodyParts/PushingBodyPart.tscn" type="PackedScene" id=1] [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://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/Fertige GLBs/Arm_Gorilla.glb" type="PackedScene" id=3]
[ext_resource path="res://3D Input/gorillaarmtexture.png" type="Texture" id=4] [ext_resource path="res://3D Input/gorillaarmtexture.png" type="Texture" id=4]
[ext_resource path="res://Audio/punch_sound.wav" type="AudioStream" id=5]
[sub_resource type="BoxShape" id=2] [sub_resource type="BoxShape" id=1]
extents = Vector3( 1.21214, 1, 2.81197 ) extents = Vector3( 1.21214, 1, 2.81197 )
[sub_resource type="SphereShape" id=3] [sub_resource type="SphereShape" id=2]
radius = 0.175235 radius = 0.175235
[sub_resource type="SpatialMaterial" id=1] [sub_resource type="SpatialMaterial" id=3]
albedo_texture = ExtResource( 4 ) albedo_texture = ExtResource( 4 )
[node name="GorillaArm" instance=ExtResource( 1 )] [node name="GorillaArm" instance=ExtResource( 1 )]
@ -22,22 +23,19 @@ damage = 15.0
[node name="PartCollider" parent="." index="0"] [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 ) transform = Transform( 1, 0, 0, 0, 0.534515, -0.845159, 0, 0.845159, 0.534515, -0.0701199, -4.33779, -2.5341 )
shape = SubResource( 2 ) shape = SubResource( 1 )
[node name="TouchArea" parent="." index="1"] [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 ) transform = Transform( 0.00565114, -1.25635, 4.34486, 2.47947, -3.63292, -1.05371, 3.78264, 2.38321, 0.684204, -0.142622, -4.9139, -2.02559 )
[node name="CollisionShape" type="CollisionShape" parent="TouchArea" index="0"] [node name="CollisionShape" type="CollisionShape" parent="TouchArea" index="0"]
shape = SubResource( 3 ) shape = SubResource( 2 )
[node name="Mesh" parent="." index="2" instance=ExtResource( 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 ) 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"] [node name="Cube" parent="Mesh/Armature/Skeleton" index="0"]
material/0 = SubResource( 1 ) material/0 = SubResource( 3 )
[node name="BoneAttachment" type="BoneAttachment" parent="Mesh/Armature/Skeleton" index="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 ) 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 )
@ -46,4 +44,7 @@ bone_name = "bone_6"
[node name="RemoteTransform" type="RemoteTransform" parent="Mesh/Armature/Skeleton/BoneAttachment" index="0"] [node name="RemoteTransform" type="RemoteTransform" parent="Mesh/Armature/Skeleton/BoneAttachment" index="0"]
remote_path = NodePath("../../../../../TouchArea") remote_path = NodePath("../../../../../TouchArea")
[node name="PushSound" parent="." index="4"]
stream = ExtResource( 5 )
[editable path="Mesh"] [editable path="Mesh"]

View File

@ -1,7 +1,8 @@
[gd_scene load_steps=6 format=2] [gd_scene load_steps=7 format=2]
[ext_resource path="res://BodyParts/PushingBodyPart.tscn" type="PackedScene" id=1] [ext_resource path="res://BodyParts/PushingBodyPart.tscn" type="PackedScene" id=1]
[ext_resource path="res://BodyParts/HumanArm.gd" type="Script" id=2] [ext_resource path="res://BodyParts/HumanArm.gd" type="Script" id=2]
[ext_resource path="res://Audio/punch_sound.wav" type="AudioStream" id=3]
[ext_resource path="res://3D Input/Fertige GLBs/Arm_Mensch.glb" type="PackedScene" id=4] [ext_resource path="res://3D Input/Fertige GLBs/Arm_Mensch.glb" type="PackedScene" id=4]
[sub_resource type="BoxShape" id=1] [sub_resource type="BoxShape" id=1]
@ -29,9 +30,6 @@ shape = SubResource( 2 )
[node name="Mesh" parent="." index="2" instance=ExtResource( 4 )] [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 ) 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"] [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 ) 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" bone_name = "bone_6"
@ -42,4 +40,10 @@ 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"]
stream = ExtResource( 3 )
[editable path="Mesh"] [editable path="Mesh"]

View File

@ -1,9 +1,10 @@
[gd_scene load_steps=8 format=2] [gd_scene load_steps=9 format=2]
[ext_resource path="res://BodyParts/PushingBodyPart.tscn" type="PackedScene" id=1] [ext_resource path="res://BodyParts/PushingBodyPart.tscn" type="PackedScene" id=1]
[ext_resource path="res://BodyParts/HumanLeg.gd" type="Script" id=2] [ext_resource path="res://BodyParts/HumanLeg.gd" type="Script" id=2]
[ext_resource path="res://3D Input/Fertige GLBs/Bein_Mensch.glb" type="PackedScene" id=3] [ext_resource path="res://3D Input/Fertige GLBs/Bein_Mensch.glb" type="PackedScene" id=3]
[ext_resource path="res://3D Input/beinimage.png" type="Texture" id=4] [ext_resource path="res://3D Input/beinimage.png" type="Texture" id=4]
[ext_resource path="res://Audio/punch_sound.wav" type="AudioStream" id=5]
[sub_resource type="BoxShape" id=1] [sub_resource type="BoxShape" id=1]
extents = Vector3( 0.666, 2.41488, 1.555 ) extents = Vector3( 0.666, 2.41488, 1.555 )
@ -36,9 +37,6 @@ 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"] [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 ) 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"] [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 ) 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 ) material/0 = SubResource( 3 )
@ -50,4 +48,10 @@ bone_name = "bone_2"
[node name="RemoteTransform" type="RemoteTransform" parent="Mesh/Armature/Skeleton/BoneAttachment" index="0"] [node name="RemoteTransform" type="RemoteTransform" parent="Mesh/Armature/Skeleton/BoneAttachment" index="0"]
remote_path = NodePath("../../../../../TouchArea") remote_path = NodePath("../../../../../TouchArea")
[node name="ActionSound" parent="." index="3"]
unit_db = 0.0
[node name="PushSound" parent="." index="4"]
stream = ExtResource( 5 )
[editable path="Mesh"] [editable path="Mesh"]

View File

@ -2,6 +2,7 @@ extends BodyPart
class_name PushingBodyPart class_name PushingBodyPart
onready var touch_area = get_node("TouchArea") onready var touch_area = get_node("TouchArea")
onready var push_sound = get_node("PushSound")
export(float) var damage = 10.0 export(float) var damage = 10.0
@ -19,10 +20,16 @@ func _is_animation_playing():
func _on_touch_area_entered(body): func _on_touch_area_entered(body):
if body.name != base.name and _is_animation_playing(): if body.name != base.name and _is_animation_playing():
if body.is_in_group("Terrain"): if body.is_in_group("Terrain"):
push(body) push_wrapper(body)
elif body.is_in_group("Player"): elif body.is_in_group("Player"):
InGameState.subtract_player_health(body.player_id, damage) InGameState.subtract_player_health(body.player_id, damage)
func push_wrapper(body):
push_sound.play(0.0)
push(body)
func push(body): func push(body):
pass pass

View File

@ -3,8 +3,10 @@
[ext_resource path="res://BodyParts/BodyPart.tscn" type="PackedScene" id=1] [ext_resource path="res://BodyParts/BodyPart.tscn" type="PackedScene" id=1]
[ext_resource path="res://BodyParts/PushingBodyPart.gd" type="Script" id=2] [ext_resource path="res://BodyParts/PushingBodyPart.gd" type="Script" id=2]
[node name="PushingBodyPart" instance=ExtResource( 1 )]
[node name="PushingBodyPart" index="0" instance=ExtResource( 1 )]
script = ExtResource( 2 ) script = ExtResource( 2 )
[node name="TouchArea" type="Area" parent="." index="1"] [node name="TouchArea" type="Area" parent="." index="1"]
[node name="PushSound" type="AudioStreamPlayer3D" parent="." index="3"]
attenuation_model = 3

View File

@ -12,7 +12,7 @@ var _win_screen_scene
var _bodies : Array var _bodies : Array
var _body_count = 0 var _body_count = 0
var _body_positions = [Vector3(0, 15, -30), Vector3(0, 15, 30), Vector3(-30, 15, 0), Vector3(30, 15, 0)] var _body_positions = [Vector3(0, 15, 30), Vector3(0, 15, -30), Vector3(-30, 15, 0), Vector3(30, 15, 0)]
func _ready(): func _ready():
InGameState.player_count = 2 InGameState.player_count = 2
@ -68,7 +68,7 @@ func _switch_to_fighting(torso):
torso.translation += _body_positions[_body_count] torso.translation += _body_positions[_body_count]
torso.rotation_degrees = Vector3(90, 0, 0) torso.rotation_degrees = Vector3(90, 0, 0)
if _body_count == 1: if _body_count == 0:
torso.rotation_degrees += Vector3(0, 180, 0) torso.rotation_degrees += Vector3(0, 180, 0)
_body_count += 1 _body_count += 1

View File

@ -1,8 +1,9 @@
[gd_scene load_steps=6 format=2] [gd_scene load_steps=7 format=2]
[ext_resource path="res://Ingame/Level/Torch.tscn" type="PackedScene" id=1] [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://Ingame/Level/Ground.tscn" type="PackedScene" id=2]
[ext_resource path="res://default_env.tres" type="Environment" id=3] [ext_resource path="res://default_env.tres" type="Environment" id=3]
[ext_resource path="res://3D Input/Fertige GLBs/Kopf_Mensch.glb" type="PackedScene" id=4]
[ext_resource path="res://Ingame/Level/Fence.tscn" type="PackedScene" id=5] [ext_resource path="res://Ingame/Level/Fence.tscn" type="PackedScene" id=5]
[sub_resource type="Curve3D" id=1] [sub_resource type="Curve3D" id=1]
@ -29,13 +30,19 @@ transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -55.8087, 0, 76.6803 )
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, 52.7943, 0, 76.6803 )
[node name="Torch6" parent="." instance=ExtResource( 1 )] [node name="Torch6" parent="." instance=ExtResource( 1 )]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -0.293457, 0, 5.53332 ) transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 27.8085, 0, 49.812 )
[node name="Torch7" parent="." instance=ExtResource( 1 )]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -35.1849, 0, -15.9355 )
[node name="WorldEnvironment" type="WorldEnvironment" parent="."] [node name="WorldEnvironment" type="WorldEnvironment" parent="."]
environment = ExtResource( 3 ) environment = ExtResource( 3 )
[node name="ground" parent="." instance=ExtResource( 2 )] [node name="ground" parent="." instance=ExtResource( 2 )]
[node name="Kopf_Mensch" parent="." instance=ExtResource( 4 )]
transform = Transform( 3.58646, 0.324361, 1.74129, -1.09151, 3.50169, 1.59586, -1.39495, -1.90603, 3.22817, -62.8568, 12.0891, -17.4997 )
[node name="Path" type="Path" parent="."] [node name="Path" type="Path" parent="."]
curve = SubResource( 1 ) curve = SubResource( 1 )

View File

@ -1,8 +1,9 @@
extends Control extends Spatial
export(NodePath) var startPath export(NodePath) var startPath
var _start_button var _start_button
onready var viewport = get_node("ViewportContainer/Viewport")
signal body_build() signal body_build()

View File

@ -1,4 +1,4 @@
[gd_scene load_steps=7 format=2] [gd_scene load_steps=8 format=2]
[ext_resource path="res://UI/MainMenu.gd" type="Script" id=1] [ext_resource path="res://UI/MainMenu.gd" type="Script" id=1]
[ext_resource path="res://Resources/Fonts/MenuHeader.tres" type="DynamicFont" id=2] [ext_resource path="res://Resources/Fonts/MenuHeader.tres" type="DynamicFont" id=2]
@ -6,15 +6,40 @@
[ext_resource path="res://Resources/Styles/ButtonHoverStyle.tres" type="StyleBox" id=4] [ext_resource path="res://Resources/Styles/ButtonHoverStyle.tres" type="StyleBox" id=4]
[ext_resource path="res://Resources/Styles/ButtonPressedStyle.tres" type="StyleBox" id=5] [ext_resource path="res://Resources/Styles/ButtonPressedStyle.tres" type="StyleBox" id=5]
[ext_resource path="res://Resources/Styles/ButtonNormalStyle.tres" type="StyleBox" id=6] [ext_resource path="res://Resources/Styles/ButtonNormalStyle.tres" type="StyleBox" id=6]
[ext_resource path="res://Ingame/Arena.tscn" type="PackedScene" id=7]
[node name="MainMenu" type="Control"] [node name="MainMenu" type="Spatial"]
script = ExtResource( 1 )
startPath = NodePath("MarginContainer2/VBoxContainer/Start")
[node name="View" type="MarginContainer" parent="."]
anchor_right = 1.0 anchor_right = 1.0
anchor_bottom = 1.0 anchor_bottom = 1.0
script = ExtResource( 1 ) size_flags_horizontal = 3
size_flags_vertical = 3
__meta__ = { __meta__ = {
"_edit_use_anchors_": false "_edit_use_anchors_": false
} }
startPath = NodePath("MarginContainer2/VBoxContainer/Start")
[node name="ViewportContainer" type="ViewportContainer" parent="View"]
margin_right = 1024.0
margin_bottom = 600.0
rect_min_size = Vector2( 200, 40 )
size_flags_horizontal = 3
size_flags_vertical = 3
stretch = true
__meta__ = {
"_edit_use_anchors_": false
}
[node name="Viewport" type="Viewport" parent="View/ViewportContainer"]
size = Vector2( 1024, 600 )
handle_input_locally = false
render_target_update_mode = 3
[node name="Camera" type="Camera" parent="View/ViewportContainer/Viewport"]
transform = Transform( -1.62921e-07, -0.604599, 0.79653, 0, 0.79653, 0.604599, -1, 9.85017e-08, -1.29771e-07, 30, 25, 0 )
fov = 63.748
[node name="MarginContainer" type="MarginContainer" parent="."] [node name="MarginContainer" type="MarginContainer" parent="."]
anchor_left = 0.5 anchor_left = 0.5
@ -32,6 +57,8 @@ __meta__ = {
[node name="VBoxContainer" type="VBoxContainer" parent="MarginContainer"] [node name="VBoxContainer" type="VBoxContainer" parent="MarginContainer"]
margin_right = 1024.0 margin_right = 1024.0
margin_bottom = 600.0 margin_bottom = 600.0
size_flags_horizontal = 3
size_flags_vertical = 3
[node name="GameName" type="Label" parent="MarginContainer/VBoxContainer"] [node name="GameName" type="Label" parent="MarginContainer/VBoxContainer"]
margin_right = 1024.0 margin_right = 1024.0
@ -40,7 +67,8 @@ rect_min_size = Vector2( 0, 250 )
size_flags_horizontal = 3 size_flags_horizontal = 3
size_flags_vertical = 3 size_flags_vertical = 3
custom_fonts/font = ExtResource( 2 ) custom_fonts/font = ExtResource( 2 )
text = "D-d-d-d-d-duell" text = "Body-Part-Fight-Repair-
Impker-Arena-Madness"
align = 1 align = 1
valign = 2 valign = 2
@ -116,5 +144,7 @@ rect_min_size = Vector2( 0, 35 )
__meta__ = { __meta__ = {
"_edit_use_anchors_": false "_edit_use_anchors_": false
} }
[node name="Arena" parent="." instance=ExtResource( 7 )]
[connection signal="pressed" from="MarginContainer2/VBoxContainer/Start" to="." method="_on_Start_pressed"] [connection signal="pressed" from="MarginContainer2/VBoxContainer/Start" to="." method="_on_Start_pressed"]
[connection signal="pressed" from="MarginContainer2/VBoxContainer/Exit" to="." method="_on_Exit_pressed"] [connection signal="pressed" from="MarginContainer2/VBoxContainer/Exit" to="." method="_on_Exit_pressed"]