This commit is contained in:
buchibob 2020-02-02 16:33:39 +01:00
commit 70ad16a099
8 changed files with 106 additions and 3 deletions

BIN
Audio/menu.wav Normal file

Binary file not shown.

21
Audio/menu.wav.import Normal file
View File

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

@ -1,4 +1,4 @@
[gd_scene load_steps=9 format=2]
[gd_scene load_steps=10 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]
@ -8,6 +8,7 @@
[ext_resource path="res://Resources/Styles/ButtonHoverStyle.tres" type="StyleBox" id=6]
[ext_resource path="res://Resources/Styles/ButtonPressedStyle.tres" type="StyleBox" id=7]
[ext_resource path="res://Resources/Styles/ButtonNormalStyle.tres" type="StyleBox" id=8]
[ext_resource path="res://Audio/menu.wav" type="AudioStream" id=9]
[node name="Body Builder Menu" type="Spatial"]
script = ExtResource( 2 )
@ -127,4 +128,8 @@ __meta__ = {
[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 )
[node name="AudioStreamPlayer2D" type="AudioStreamPlayer2D" parent="."]
stream = ExtResource( 9 )
autoplay = true
[connection signal="pressed" from="GUI/HBoxC/VBoxC/Start" to="." method="_on_Start_pressed"]

View File

@ -26,6 +26,6 @@ func action():
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
var direction = (base.transform.basis.y - base.transform.basis.z).normalized() * 3.0
base.apply_impulse(offset, direction)

View File

@ -26,6 +26,6 @@ func action():
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
var direction = (base.transform.basis.y - base.transform.basis.z).normalized() * 3.0
base.apply_impulse(offset, direction)

31
BodyParts/HumanHead.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() * 3.0
base.apply_impulse(offset, direction)

45
BodyParts/HumanHead.tscn Normal file
View File

@ -0,0 +1,45 @@
[gd_scene load_steps=7 format=2]
[ext_resource path="res://BodyParts/PushingBodyPart.tscn" type="PackedScene" id=1]
[ext_resource path="res://3D Input/Fertige GLBs/Kopf_Mensch.glb" type="PackedScene" id=2]
[ext_resource path="res://BodyParts/HumanHead.gd" type="Script" id=3]
[sub_resource type="SphereShape" id=1]
radius = 0.600362
[sub_resource type="SphereShape" id=2]
radius = 2.74607
[sub_resource type="SpatialMaterial" id=3]
[node name="HumanHead" instance=ExtResource( 1 )]
transform = Transform( -3, -9.77524e-07, -4.88762e-07, 4.88762e-07, 7.96295e-14, -3, 9.77524e-07, -3, 7.96295e-14, 0, 0, -1.72516 )
script = ExtResource( 3 )
cost = 10.0
damage = 5.0
[node name="PartCollider" parent="." index="0"]
shape = SubResource( 1 )
[node name="TouchArea" parent="." index="1"]
transform = Transform( -0.154405, -9.84102e-13, -6.12322e-07, 2.97588e-07, -0.134944, -0.0750402, -5.35145e-07, -0.0750403, 0.134944, 2.84217e-14, 0.372963, 0.00349771 )
[node name="CollisionShape" type="CollisionShape" parent="TouchArea" index="0"]
shape = SubResource( 2 )
[node name="Mesh" parent="." index="4" instance=ExtResource( 2 )]
[node name="Skeleton" parent="Mesh/Armature" index="0"]
bones/2/bound_children = [ NodePath("BoneAttachment") ]
[node name="HAARE" parent="Mesh/Armature/Skeleton" index="0"]
material/0 = SubResource( 3 )
[node name="BoneAttachment" type="BoneAttachment" parent="Mesh/Armature/Skeleton" index="3"]
transform = Transform( -1, -6.36646e-12, -3.96569e-06, 1.92732e-06, -0.87396, -0.485997, -3.46586e-06, -0.485997, 0.87396, -5.43763e-14, 5.658, 0.029508 )
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,3 +12,4 @@ func _ready():
bodyparts["Chicken Head"] = load("res://BodyParts/ChickenHead.tscn")
bodyparts["Wings"] = load("res://BodyParts/Wings.tscn")
bodyparts["Bull Head"] = load("res://BodyParts/BullHead.tscn")
bodyparts["Human head"] = load("res://BodyParts/HumanHead.tscn")