Merge branch 'master' of https://gitlab.hexaquo.at/ggjg20/bodypartfighter
This commit is contained in:
commit
d3eb64493c
23
BodyParts/BodyBase/AttachmentPoint.gd
Normal file
23
BodyParts/BodyBase/AttachmentPoint.gd
Normal file
@ -0,0 +1,23 @@
|
||||
extends Spatial
|
||||
|
||||
|
||||
export(int) var key
|
||||
|
||||
onready var limb = get_node("Limb")
|
||||
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready() -> void:
|
||||
pass # Replace with function body.
|
||||
|
||||
|
||||
func _unhandled_input(event):
|
||||
if event is InputEventKey:
|
||||
if event.pressed and event.scancode == key:
|
||||
if limb.get_child_count() > 0:
|
||||
limb.get_child(0).action()
|
||||
|
||||
|
||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||
#func _process(delta: float) -> void:
|
||||
# pass
|
@ -1,10 +1,13 @@
|
||||
[gd_scene load_steps=3 format=2]
|
||||
[gd_scene load_steps=4 format=2]
|
||||
|
||||
[ext_resource path="res://BodyParts/BodyBase/AttachmentPoint.gd" type="Script" id=1]
|
||||
|
||||
[sub_resource type="SphereMesh" id=1]
|
||||
|
||||
[sub_resource type="SphereShape" id=2]
|
||||
|
||||
[node name="AttachmentPoint" type="Spatial"]
|
||||
script = ExtResource( 1 )
|
||||
|
||||
[node name="Mesh" type="MeshInstance" parent="."]
|
||||
transform = Transform( 0.2, 0, 0, 0, 0.2, 0, 0, 0, 0.2, 0, 0, 0 )
|
||||
|
@ -19,12 +19,14 @@ shape = SubResource( 1 )
|
||||
|
||||
[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 )
|
||||
key = 68
|
||||
|
||||
[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 )
|
||||
|
||||
[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 )
|
||||
key = 70
|
||||
|
||||
[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 )
|
||||
@ -34,21 +36,27 @@ 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 )]
|
||||
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
|
||||
|
||||
[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 )
|
||||
key = 65
|
||||
|
||||
[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 )
|
||||
key = 69
|
||||
|
||||
[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 )
|
||||
key = 82
|
||||
|
||||
[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 )
|
||||
key = 81
|
||||
|
||||
[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 )
|
||||
key = 87
|
||||
|
||||
[node name="Torso" parent="." instance=ExtResource( 3 )]
|
||||
transform = Transform( 0.5, 0, 0, 0, -2.18557e-08, 0.5, 0, -0.5, -2.18557e-08, 0, 0, 0 )
|
||||
|
@ -7,8 +7,6 @@ class_name BodyPart
|
||||
onready var base = get_parent().get_parent().get_parent()
|
||||
onready var physics_shape = get_node("PartCollider")
|
||||
|
||||
export(int) var key
|
||||
|
||||
var setup_done = false
|
||||
|
||||
|
||||
@ -31,12 +29,6 @@ func _process(delta: float) -> void:
|
||||
setup_done = true
|
||||
|
||||
|
||||
func _unhandled_input(event):
|
||||
if event is InputEventKey:
|
||||
if event.pressed and event.scancode == key:
|
||||
action()
|
||||
|
||||
|
||||
# Do something with the base
|
||||
func action():
|
||||
pass
|
||||
|
Loading…
x
Reference in New Issue
Block a user