This commit is contained in:
karl 2020-02-01 16:51:44 +01:00
commit 626455e870
5 changed files with 105 additions and 19 deletions

View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/Beintextur.png-2ae020ac9731826dac97bd29939f551e.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://3D Input/Beintextur.png"
dest_files=[ "res://.import/Beintextur.png-2ae020ac9731826dac97bd29939f551e.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
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
svg/scale=1.0

View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/beinimage.png-a7e3863a81de772333653d8998415984.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://3D Input/beinimage.png"
dest_files=[ "res://.import/beinimage.png-a7e3863a81de772333653d8998415984.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
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
svg/scale=1.0

View File

@ -78,17 +78,30 @@ func _input(event):
if _viewport.get_viewport().get_mouse_position().x >= 0: if _viewport.get_viewport().get_mouse_position().x >= 0:
if event is InputEventMouseButton: if event is InputEventMouseButton:
if event.pressed: if event.pressed:
if event.button_index == BUTTON_WHEEL_UP:
_attachment_point.get_node("Limb").rotate_z(0.1)
elif event.button_index == BUTTON_WHEEL_DOWN:
_attachment_point.get_node("Limb").rotate_z(-0.1)
else:
print("Mouse Click at: ", event.position) print("Mouse Click at: ", event.position)
_prev_mouse_pos = event.position _prev_mouse_pos = event.position
_viewRot = true _viewRot = true
else: else:
print("mouse unpressed at: ", event.position)
_viewRot = false _viewRot = false
func body_part_chosen(params): func body_part_chosen(params):
#no _attachment_point
if _attachment_point != null:
var limb = _attachment_point.get_node("Limb") var limb = _attachment_point.get_node("Limb")
if limb != null:
#adding only possible if no first child
#if limb.get_child(0) == null:
# limb.add_child(BodyPartLoader.bodyparts[params].instance())
#if spot already taken, DELETE
if limb.get_child(0) != null:
delete_body_part()
limb.add_child(BodyPartLoader.bodyparts[params].instance()) limb.add_child(BodyPartLoader.bodyparts[params].instance())
@ -98,10 +111,8 @@ func make_it_shine(highlight : bool):
func delete_body_part(): func delete_body_part():
if _attachment_point != null:
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:
body_part.queue_free() body_part.queue_free()

View File

@ -1,19 +1,26 @@
[gd_scene load_steps=5 format=2] [gd_scene load_steps=6 format=2]
[ext_resource path="res://BodyParts/BodyBase/BodyBase.gd" type="Script" id=1] [ext_resource path="res://BodyParts/BodyBase/BodyBase.gd" type="Script" id=1]
[ext_resource path="res://BodyParts/BodyBase/AttachmentPoint.tscn" type="PackedScene" id=2] [ext_resource path="res://BodyParts/BodyBase/AttachmentPoint.tscn" type="PackedScene" id=2]
[ext_resource path="res://3D Input/Fertige GLBs/Torso.glb" type="PackedScene" id=3] [ext_resource path="res://3D Input/Torso.glb" type="PackedScene" id=3]
[sub_resource type="CapsuleShape" id=1] [sub_resource type="CapsuleMesh" id=1]
[sub_resource type="CapsuleShape" id=2]
[node name="Torso" type="RigidBody" groups=[ [node name="Torso" type="RigidBody" groups=[
"Player", "Player",
]] ]]
script = ExtResource( 1 ) script = ExtResource( 1 )
[node name="TorsoMesh" type="MeshInstance" parent="."]
visible = false
mesh = SubResource( 1 )
material/0 = null
[node name="TorsoCollider" type="CollisionShape" parent="."] [node name="TorsoCollider" type="CollisionShape" parent="."]
transform = Transform( 0.8, 0, 0, 0, 0.8, 0, 0, 0, 0.8, 0, 0, 0 ) transform = Transform( 0.8, 0, 0, 0, 0.8, 0, 0, 0, 0.8, 0, 0, 0 )
shape = SubResource( 1 ) shape = SubResource( 2 )
[node name="FrontLeft" parent="." instance=ExtResource( 2 )] [node name="FrontLeft" parent="." instance=ExtResource( 2 )]
transform = Transform( 0.5, -1.62921e-07, -0.866025, -3.25841e-07, -1, 0, -0.866025, 2.82187e-07, -0.5, 0.6, 0, 1 ) transform = Transform( 0.5, -1.62921e-07, -0.866025, -3.25841e-07, -1, 0, -0.866025, 2.82187e-07, -0.5, 0.6, 0, 1 )
@ -21,5 +28,5 @@ transform = Transform( 0.5, -1.62921e-07, -0.866025, -3.25841e-07, -1, 0, -0.866
[node name="FrontRight" parent="." instance=ExtResource( 2 )] [node name="FrontRight" parent="." instance=ExtResource( 2 )]
transform = Transform( 0.5, -7.54979e-08, 0.866025, -1.50996e-07, -1, 0, 0.866025, -1.30766e-07, -0.5, -0.6, 0, 1 ) transform = Transform( 0.5, -7.54979e-08, 0.866025, -1.50996e-07, -1, 0, 0.866025, -1.30766e-07, -0.5, -0.6, 0, 1 )
[node name="Mesh" parent="." instance=ExtResource( 3 )] [node name="Torso" parent="." instance=ExtResource( 3 )]
transform = Transform( 0.2, 0, 0, 0, -8.74228e-09, 0.2, 0, -0.2, -8.74228e-09, 0, 0, 0 ) transform = Transform( 0.2, 0, 0, 0, -8.74228e-09, 0.2, 0, -0.2, -8.74228e-09, 0, 0, 0 )

View File

@ -38,9 +38,9 @@ align = 1
valign = 2 valign = 2
[node name="PlayerWon" type="Label" parent="MarginContainer/VBoxContainer"] [node name="PlayerWon" type="Label" parent="MarginContainer/VBoxContainer"]
margin_top = 253.0 margin_top = 254.0
margin_right = 1024.0 margin_right = 1024.0
margin_bottom = 503.0 margin_bottom = 504.0
rect_min_size = Vector2( 0, 250 ) rect_min_size = Vector2( 0, 250 )
custom_fonts/font = ExtResource( 3 ) custom_fonts/font = ExtResource( 3 )
align = 1 align = 1