Players can fight each other (but bose lose health)
This commit is contained in:
parent
c73f181dd5
commit
e8c7cb3e33
@ -4,7 +4,9 @@
|
||||
[ext_resource path="res://3D Input/untitled.glb" type="PackedScene" id=2]
|
||||
[ext_resource path="res://BodyParts/Arm.gd" type="Script" id=3]
|
||||
|
||||
[sub_resource type="SphereShape" id=1]
|
||||
[sub_resource type="CapsuleShape" id=3]
|
||||
radius = 0.724339
|
||||
height = 5.27855
|
||||
|
||||
[sub_resource type="SphereShape" id=2]
|
||||
radius = 0.591769
|
||||
@ -13,8 +15,8 @@ radius = 0.591769
|
||||
script = ExtResource( 3 )
|
||||
|
||||
[node name="PartCollider" parent="." index="0"]
|
||||
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -8 )
|
||||
shape = SubResource( 1 )
|
||||
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -5.34203 )
|
||||
shape = SubResource( 3 )
|
||||
|
||||
[node name="Mesh" parent="." index="1" instance=ExtResource( 2 )]
|
||||
|
||||
|
@ -1,9 +1,9 @@
|
||||
extends Spatial
|
||||
class_name BodyBase
|
||||
|
||||
# Declare member variables here. Examples:
|
||||
# var a = 2
|
||||
# var b = "text"
|
||||
|
||||
export(int) var player_id
|
||||
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready():
|
||||
|
@ -12,7 +12,9 @@
|
||||
|
||||
[sub_resource type="SphereShape" id=5]
|
||||
|
||||
[node name="Torso" type="RigidBody"]
|
||||
[node name="Torso" type="RigidBody" groups=[
|
||||
"Player",
|
||||
]]
|
||||
script = ExtResource( 1 )
|
||||
|
||||
[node name="TorsoMesh" type="MeshInstance" parent="."]
|
||||
@ -20,7 +22,6 @@ mesh = SubResource( 1 )
|
||||
material/0 = null
|
||||
|
||||
[node name="TorsoCollider" type="CollisionShape" parent="."]
|
||||
transform = Transform( 0.8, 0, 0, 0, 0.8, 0, 0, 0, 0.8, 0, 0, 0 )
|
||||
shape = SubResource( 2 )
|
||||
|
||||
[node name="FrontLeft" type="Spatial" parent="."]
|
||||
|
@ -22,13 +22,13 @@ func _ready() -> void:
|
||||
func _process(delta: float) -> void:
|
||||
# We do this here because we want the whole tree to really be done instancing
|
||||
if not setup_done:
|
||||
var translation = physics_shape.global_transform.origin
|
||||
var translation = physics_shape.global_transform
|
||||
print(translation)
|
||||
|
||||
remove_child(physics_shape)
|
||||
base.add_child(physics_shape)
|
||||
|
||||
physics_shape.global_transform.origin = translation
|
||||
physics_shape.global_transform = translation
|
||||
|
||||
setup_done = true
|
||||
|
||||
|
@ -16,7 +16,7 @@ func _on_touch_area_entered(body):
|
||||
if body.is_in_group("Terrain"):
|
||||
push(body)
|
||||
elif body.is_in_group("Player"):
|
||||
InGameState.subtract_player_health(body.id, damage)
|
||||
InGameState.subtract_player_health(body.player_id, damage)
|
||||
|
||||
|
||||
func push(body):
|
||||
|
@ -43,6 +43,18 @@ key = 83
|
||||
[node name="Arm" parent="Torso/FrontRight" index="1" instance=ExtResource( 1 )]
|
||||
key = 65
|
||||
|
||||
[node name="Torso2" parent="." instance=ExtResource( 3 )]
|
||||
transform = Transform( -0.866025, -0.353553, -0.353553, -6.18172e-08, -0.707107, 0.707107, -0.5, 0.612372, 0.612372, 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 )]
|
||||
|
||||
[editable path="Torso"]
|
||||
|
||||
[editable path="Torso2"]
|
||||
|
@ -33,10 +33,12 @@ _global_script_class_icons={
|
||||
[application]
|
||||
|
||||
config/name="BodyPartFighter"
|
||||
run/main_scene="res://Ingame/Testing.tscn"
|
||||
config/icon="res://icon.png"
|
||||
|
||||
[autoload]
|
||||
|
||||
InGameState="*res://Global/InGameState.gd"
|
||||
BodyPartLoader="*res://Global/BodyPartLoader.gd"
|
||||
|
||||
[rendering]
|
||||
|
Loading…
x
Reference in New Issue
Block a user