This commit is contained in:
karl 2020-02-01 16:15:37 +01:00
commit f608c44c02
21 changed files with 108 additions and 35 deletions

Binary file not shown.

Binary file not shown.

BIN
3D Input/Mensch_Hand.blend Normal file

Binary file not shown.

BIN
3D Input/Mensch_Hand.blend1 Normal file

Binary file not shown.

View File

@ -1,6 +1,9 @@
extends VBoxContainer extends VBoxContainer
onready var delete = get_node("Delete")
# Called when the node enters the scene tree for the first time. # Called when the node enters the scene tree for the first time.
func _ready(): func _ready():
for entry in BodyPartLoader.bodyparts: for entry in BodyPartLoader.bodyparts:
@ -8,7 +11,8 @@ func _ready():
button.text = entry button.text = entry
add_child(button) add_child(button)
button.connect("pressed", get_parent().get_parent().get_parent(), "body_part_chosen", [button.text]) button.connect("pressed", get_parent().get_parent().get_parent(), "body_part_chosen", [button.text])
delete.connect("pressed", get_parent().get_parent().get_parent(), "delete_body_part")
func button_pressed(params): func button_pressed(params):
emit_signal("choose_bodypart", params[0]) emit_signal("choose_bodypart", params[0])

View File

@ -32,6 +32,17 @@ margin_bottom = 600.0
rect_min_size = Vector2( 300, 500 ) rect_min_size = Vector2( 300, 500 )
script = ExtResource( 3 ) script = ExtResource( 3 )
[node name="Start" type="Button" parent="GUI/HBoxC/VBoxC"]
margin_right = 300.0
margin_bottom = 20.0
text = "Start Game"
[node name="Delete" type="Button" parent="GUI/HBoxC/VBoxC"]
margin_top = 24.0
margin_right = 300.0
margin_bottom = 44.0
text = "Delete"
[node name="ViewportContainer" type="ViewportContainer" parent="GUI/HBoxC"] [node name="ViewportContainer" type="ViewportContainer" parent="GUI/HBoxC"]
margin_left = 304.0 margin_left = 304.0
margin_right = 1024.0 margin_right = 1024.0
@ -55,5 +66,8 @@ collide_with_areas = true
collide_with_bodies = false collide_with_bodies = false
[node name="Torso" parent="." instance=ExtResource( 1 )] [node name="Torso" parent="." instance=ExtResource( 1 )]
[connection signal="pressed" from="GUI/HBoxC/VBoxC/Start" to="." method="_on_Button2_pressed"]
[editable path="Torso"] [editable path="Torso"]
[editable path="Torso/FrontLeft"]

View File

@ -87,9 +87,21 @@ func _input(event):
func body_part_chosen(params): func body_part_chosen(params):
_attachment_point.add_child(BodyPartLoader.bodyparts[params].instance()) var limb = _attachment_point.get_node("Limb")
if limb != null:
limb.add_child(BodyPartLoader.bodyparts[params].instance())
func make_it_shine(highlight : bool): func make_it_shine(highlight : bool):
if _attachment_point != null: if _attachment_point != null:
_attachment_point.get_node("OmniLight").visible = highlight _attachment_point.get_node("OmniLight").visible = highlight
func delete_body_part():
var body_part = _attachment_point.get_node("Limb").get_child(0)
if body_part != null:
body_part.queue_free()

View File

@ -15,7 +15,7 @@ func action():
func push(body): func push(body):
# We multiply by 0.1 because we only want it to spin slightly, it should mostly go up # We multiply by 0.1 because we only want it to spin slightly, it should mostly go up
base.apply_impulse(transform.basis.xform(global_transform.origin - touch_area.global_transform.origin) * 0.1, base.transform.basis.y * 5.0) base.apply_impulse(transform.basis.xform(touch_area.global_transform.origin - global_transform.origin) * 0.1, base.transform.basis.y * 5.0)
# Called every frame. 'delta' is the elapsed time since the previous frame. # Called every frame. 'delta' is the elapsed time since the previous frame.
#func _process(delta: float) -> void: #func _process(delta: float) -> void:

View File

@ -5,7 +5,6 @@
[sub_resource type="SphereShape" id=2] [sub_resource type="SphereShape" id=2]
[node name="AttachmentPoint" type="Spatial"] [node name="AttachmentPoint" type="Spatial"]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 )
[node name="Mesh" type="MeshInstance" parent="."] [node name="Mesh" type="MeshInstance" parent="."]
transform = Transform( 0.3, 0, 0, 0, 0.3, 0, 0, 0, 0.3, 0, 0, 0 ) transform = Transform( 0.3, 0, 0, 0, 0.3, 0, 0, 0, 0.3, 0, 0, 0 )
@ -24,3 +23,5 @@ omni_range = 1.8
[node name="CollisionShape" type="CollisionShape" parent="Area"] [node name="CollisionShape" type="CollisionShape" parent="Area"]
transform = Transform( 0.5, 0, 0, 0, 0.5, 0, 0, 0, 0.5, 0, 0, 0 ) transform = Transform( 0.5, 0, 0, 0, 0.5, 0, 0, 0, 0.5, 0, 0, 0 )
shape = SubResource( 2 ) shape = SubResource( 2 )
[node name="Limb" type="Spatial" parent="."]

View File

@ -4,14 +4,16 @@
[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/Fertige GLBs/Torso.glb" type="PackedScene" id=3]
[sub_resource type="CapsuleShape" id=2] [sub_resource type="CapsuleShape" id=1]
[node name="Torso" type="RigidBody"] [node name="Torso" type="RigidBody" groups=[
"Player",
]]
script = ExtResource( 1 ) script = ExtResource( 1 )
[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( 2 ) shape = SubResource( 1 )
[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 )

View File

@ -4,7 +4,7 @@ class_name BodyPart
# Must be the direct child of an AttachmentPoint of the BodyBase # Must be the direct child of an AttachmentPoint of the BodyBase
onready var base = 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")
export(int) var key export(int) var key
@ -15,8 +15,6 @@ var setup_done = false
# Called when the node enters the scene tree for the first time. # Called when the node enters the scene tree for the first time.
func _ready() -> void: func _ready() -> void:
assert(base is BodyBase) assert(base is BodyBase)
func _process(delta: float) -> void: func _process(delta: float) -> void:

View File

@ -2,7 +2,6 @@
[ext_resource path="res://BodyParts/BodyPart.gd" type="Script" id=1] [ext_resource path="res://BodyParts/BodyPart.gd" type="Script" id=1]
[node name="BodyPart" type="Spatial"] [node name="BodyPart" type="Spatial"]
script = ExtResource( 1 ) script = ExtResource( 1 )

View File

@ -10,37 +10,43 @@
[node name="InGame" type="Spatial"] [node name="InGame" type="Spatial"]
script = ExtResource( 4 ) script = ExtResource( 4 )
[node name="Torso" parent="." instance=ExtResource( 3 )]
transform = Transform( -1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, 0, 3.02111, 28.4014 )
[node name="Arm" parent="Torso/FrontLeft" index="1" instance=ExtResource( 1 )]
transform = Transform( 1, 2.84217e-14, 0, -2.84217e-14, 1, 0, 0, 0, 1, 0, 0, 0 )
key = 83
[node name="Arm" parent="Torso/FrontRight" index="1" instance=ExtResource( 1 )]
transform = Transform( 1, 7.10543e-15, 0, -2.13163e-14, 1, 0, 0, 7.10543e-15, 1, 0, 0, 0 )
key = 65
[node name="Torso2" parent="." instance=ExtResource( 3 )]
transform = Transform( -0.866025, -0.353553, -0.353554, -1.0677e-07, -0.707107, 0.707106, -0.5, 0.612372, 0.612373, 0, 3.02111, -9 )
player_id = 1
[node name="Arm" parent="Torso2/FrontLeft" index="1" instance=ExtResource( 1 )]
key = 81
[node name="Arm" parent="Torso2/FrontRight" index="1" instance=ExtResource( 1 )]
key = 87
[node name="UI" parent="." instance=ExtResource( 2 )] [node name="UI" parent="." instance=ExtResource( 2 )]
[node name="Arena" parent="." instance=ExtResource( 5 )] [node name="Arena" parent="." instance=ExtResource( 5 )]
[node name="Torso" parent="." instance=ExtResource( 3 )]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 2, 0 )
[node name="Arm" parent="Torso/FrontLeft/Limb" index="0" instance=ExtResource( 1 )]
key = 81
[node name="Arm" parent="Torso/FrontRight/Limb" index="0" instance=ExtResource( 1 )]
key = 87
[node name="Torso2" parent="." instance=ExtResource( 3 )]
transform = Transform( -1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, 0, 2, -10 )
[node name="Arm" parent="Torso2/FrontLeft/Limb" index="0" instance=ExtResource( 1 )]
transform = Transform( 1, 2.84217e-14, 0, -2.84217e-14, 1, 0, 0, 0, 1, 0, 0, 0 )
key = 79
[node name="Arm" parent="Torso2/FrontRight/Limb" index="0" instance=ExtResource( 1 )]
key = 80
[node name="CameraFocus" type="Spatial" parent="."] [node name="CameraFocus" type="Spatial" parent="."]
script = ExtResource( 6 ) script = ExtResource( 6 )
[node name="Camera" type="Camera" parent="CameraFocus"] [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, 14, 13, 0 ) 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 )
[editable path="Torso"] [editable path="Torso"]
[editable path="Torso/FrontLeft"]
[editable path="Torso/FrontRight"]
[editable path="Torso2"] [editable path="Torso2"]
[editable path="Torso2/FrontLeft"]
[editable path="Torso2/FrontRight"]

View File

@ -0,0 +1,7 @@
[gd_resource type="DynamicFont" load_steps=2 format=2]
[ext_resource path="res://Resources/Fonts/beneg___.ttf" type="DynamicFontData" id=1]
[resource]
size = 120
font_data = ExtResource( 1 )

View File

@ -0,0 +1,7 @@
[gd_resource type="DynamicFont" load_steps=2 format=2]
[ext_resource path="res://Resources/Fonts/beneg___.ttf" type="DynamicFontData" id=1]
[resource]
size = 64
font_data = ExtResource( 1 )

Binary file not shown.

View File

@ -0,0 +1,4 @@
[gd_resource type="StyleBoxFlat" format=2]
[resource]
bg_color = Color( 0.741176, 0.0666667, 0, 1 )

View File

@ -0,0 +1,4 @@
[gd_resource type="StyleBoxFlat" format=2]
[resource]
bg_color = Color( 0.54902, 0.117647, 0.0705882, 1 )

View File

@ -0,0 +1,4 @@
[gd_resource type="StyleBoxFlat" format=2]
[resource]
bg_color = Color( 0.521569, 0.133333, 0.0941176, 1 )

View File

@ -1,6 +1,11 @@
[gd_scene load_steps=2 format=2] [gd_scene load_steps=7 format=2]
[ext_resource path="res://UI/WinScreenScript.gd" type="Script" id=1] [ext_resource path="res://UI/WinScreenScript.gd" type="Script" id=1]
[ext_resource path="res://Resources/Fonts/MenuHeader.tres" type="DynamicFont" id=2]
[ext_resource path="res://Resources/Fonts/MenuTextFont.tres" type="DynamicFont" id=3]
[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/ButtonNormalStyle.tres" type="StyleBox" id=6]
[node name="Spatial" type="Control"] [node name="Spatial" type="Control"]
anchor_right = 1.0 anchor_right = 1.0
@ -27,6 +32,7 @@ margin_bottom = 600.0
margin_right = 1024.0 margin_right = 1024.0
margin_bottom = 250.0 margin_bottom = 250.0
rect_min_size = Vector2( 0, 250 ) rect_min_size = Vector2( 0, 250 )
custom_fonts/font = ExtResource( 2 )
text = "CONGRATULATIONS!" text = "CONGRATULATIONS!"
align = 1 align = 1
valign = 2 valign = 2
@ -36,6 +42,7 @@ margin_top = 253.0
margin_right = 1024.0 margin_right = 1024.0
margin_bottom = 503.0 margin_bottom = 503.0
rect_min_size = Vector2( 0, 250 ) rect_min_size = Vector2( 0, 250 )
custom_fonts/font = ExtResource( 3 )
align = 1 align = 1
valign = 1 valign = 1
@ -54,6 +61,10 @@ margin_top = -10.0
margin_right = 100.0 margin_right = 100.0
margin_bottom = 15.0 margin_bottom = 15.0
rect_min_size = Vector2( 200, 25 ) rect_min_size = Vector2( 200, 25 )
custom_styles/hover = ExtResource( 4 )
custom_styles/pressed = ExtResource( 5 )
custom_styles/normal = ExtResource( 6 )
custom_fonts/font = ExtResource( 3 )
text = "Continue" text = "Continue"
__meta__ = { __meta__ = {
"_edit_use_anchors_": false "_edit_use_anchors_": false

View File

@ -38,8 +38,8 @@ config/icon="res://icon.png"
[autoload] [autoload]
InGameState="*res://Global/InGameState.gd"
BodyPartLoader="*res://Global/BodyPartLoader.gd" BodyPartLoader="*res://Global/BodyPartLoader.gd"
InGameState="*res://Global/InGameState.gd"
[rendering] [rendering]