This commit is contained in:
buchibob 2020-02-02 11:39:47 +01:00
commit 066ca87857
44 changed files with 3821 additions and 103 deletions

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
3D Input/froschtexture.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/froschtexture.png-4981f80e68642c0c23396f3b44826854.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://3D Input/froschtexture.png"
dest_files=[ "res://.import/froschtexture.png-4981f80e68642c0c23396f3b44826854.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/gorillaarmtexture.png-c64af8f8e427f7cc8fbbb08cb004940b.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://3D Input/gorillaarmtexture.png"
dest_files=[ "res://.import/gorillaarmtexture.png-c64af8f8e427f7cc8fbbb08cb004940b.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

BIN
3D Input/pferdtextur.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/pferdtextur.png-1047fc033dd67778cd8add0ea38038eb.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://3D Input/pferdtextur.png"
dest_files=[ "res://.import/pferdtextur.png-1047fc033dd67778cd8add0ea38038eb.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

@ -6,10 +6,12 @@
[node name="Body Builder Menu" type="Spatial"] [node name="Body Builder Menu" type="Spatial"]
script = ExtResource( 2 ) script = ExtResource( 2 )
torsoPath = NodePath("Player") torsoPath = NodePath("Torso")
cameraPath = NodePath("GUI/HBoxC/ViewportContainer/Viewport/Camera") cameraPath = NodePath("GUI/HBoxC/ViewportContainer/Viewport/Camera")
rayCastPath = NodePath("GUI/HBoxC/ViewportContainer/Viewport/MouseLook") rayCastPath = NodePath("GUI/HBoxC/ViewportContainer/Viewport/MouseLook")
viewPortPath = NodePath("GUI/HBoxC/ViewportContainer/Viewport") viewPortPath = NodePath("GUI/HBoxC/ViewportContainer/Viewport")
playerNumPath = NodePath("PlayerCountLabel")
costProgressPath = NodePath("GUI/HBoxC/VBoxC/HBoxContainer/ProgressBar")
[node name="GUI" type="MarginContainer" parent="."] [node name="GUI" type="MarginContainer" parent="."]
anchor_right = 1.0 anchor_right = 1.0
@ -32,15 +34,31 @@ 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"] [node name="HBoxContainer" type="HBoxContainer" parent="GUI/HBoxC/VBoxC"]
margin_right = 300.0 margin_right = 300.0
margin_bottom = 20.0 margin_bottom = 14.0
[node name="Label" type="Label" parent="GUI/HBoxC/VBoxC/HBoxContainer"]
margin_right = 36.0
margin_bottom = 14.0
text = "Cost: "
[node name="ProgressBar" type="ProgressBar" parent="GUI/HBoxC/VBoxC/HBoxContainer"]
margin_left = 40.0
margin_right = 240.0
margin_bottom = 14.0
rect_min_size = Vector2( 200, 0 )
[node name="Start" type="Button" parent="GUI/HBoxC/VBoxC"]
margin_top = 18.0
margin_right = 300.0
margin_bottom = 38.0
text = "Start Game" text = "Start Game"
[node name="Delete" type="Button" parent="GUI/HBoxC/VBoxC"] [node name="Delete" type="Button" parent="GUI/HBoxC/VBoxC"]
margin_top = 24.0 margin_top = 42.0
margin_right = 300.0 margin_right = 300.0
margin_bottom = 44.0 margin_bottom = 62.0
text = "Delete" text = "Delete"
[node name="ViewportContainer" type="ViewportContainer" parent="GUI/HBoxC"] [node name="ViewportContainer" type="ViewportContainer" parent="GUI/HBoxC"]
@ -65,9 +83,17 @@ enabled = true
collide_with_areas = true collide_with_areas = true
collide_with_bodies = false collide_with_bodies = false
[node name="PlayerCountLabel" type="Label" parent="."]
anchor_left = 1.0
anchor_right = 1.0
margin_left = -30.0
margin_right = 1.90735e-06
margin_bottom = 600.0
rect_min_size = Vector2( 30, 30 )
text = "1/4"
__meta__ = {
"_edit_use_anchors_": false
}
[node name="Torso" parent="." instance=ExtResource( 1 )] [node name="Torso" parent="." instance=ExtResource( 1 )]
[node name="TorsoCollider" parent="Torso" index="0"]
shape = null
[connection signal="pressed" from="GUI/HBoxC/VBoxC/Start" to="." method="_on_Start_pressed"] [connection signal="pressed" from="GUI/HBoxC/VBoxC/Start" to="." method="_on_Start_pressed"]

View File

@ -4,6 +4,8 @@ export(NodePath) var torsoPath
export(NodePath) var cameraPath export(NodePath) var cameraPath
export(NodePath) var rayCastPath export(NodePath) var rayCastPath
export(NodePath) var viewPortPath export(NodePath) var viewPortPath
export(NodePath) var playerNumPath
export(NodePath) var costProgressPath
const ROT_MOD = 500 const ROT_MOD = 500
const ROT_DECLINE = 0.1 const ROT_DECLINE = 0.1
@ -14,26 +16,63 @@ var _camera : Camera
var _rayCast : RayCast var _rayCast : RayCast
var _torso : RigidBody var _torso : RigidBody
var _viewport : Viewport var _viewport : Viewport
var _playerNum : Label
var _costProgress : ProgressBar
var _velx = 0 var _velx = 0
var _vely = 0 var _vely = 0
var _attachment_point : Spatial var _attachment_point : Spatial
var _default_grav var _default_grav
var done_player_count = 0
signal start_fight() signal start_fight()
# 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():
_default_grav = PhysicsServer.area_get_param(get_viewport().find_world().get_space(), PhysicsServer.AREA_PARAM_GRAVITY)
PhysicsServer.area_set_param(get_viewport().find_world().get_space(), PhysicsServer.AREA_PARAM_GRAVITY, 0)
_torso = get_node(torsoPath) as RigidBody _torso = get_node(torsoPath) as RigidBody
_camera = get_node(cameraPath) as Camera _camera = get_node(cameraPath) as Camera
_rayCast = get_node(rayCastPath) as RayCast _rayCast = get_node(rayCastPath) as RayCast
_viewport = get_node(viewPortPath) as Viewport _viewport = get_node(viewPortPath) as Viewport
_playerNum = get_node(playerNumPath) as Label
_costProgress = get_node(costProgressPath) as ProgressBar
# Keybinds of first player
_torso.get_node("DownFrontLeft").key = KEY_D
_torso.get_node("DownFrontRight").key = KEY_F
_torso.get_node("DownBackLeft").key = KEY_A
_torso.get_node("DownBackRight").key = KEY_S
_torso.get_node("UpFrontLeft").key = KEY_E
_torso.get_node("UpFrontRight").key = KEY_R
_torso.get_node("UpBackLeft").key = KEY_W
_torso.get_node("UpBackRight").key = KEY_Q
func change_count_ui():
if done_player_count == null:
print("test")
done_player_count = 0
_playerNum.text = str(done_player_count + 1) + "/" + str(InGameState.player_count)
# TODO: Move somewhere else because it's not UI!
if done_player_count == 1:
# Keybinds of second player
_torso.get_node("DownFrontLeft").key = KEY_H
_torso.get_node("DownFrontRight").key = KEY_J
_torso.get_node("DownBackLeft").key = KEY_K
_torso.get_node("DownBackRight").key = KEY_L
_torso.get_node("UpFrontLeft").key = KEY_Z
_torso.get_node("UpFrontRight").key = KEY_U
_torso.get_node("UpBackLeft").key = KEY_I
_torso.get_node("UpBackRight").key = KEY_O
func _process(delta): func _process(delta):
# TODO: Would be nicer to just disable gravity, but then it can't be re-enabled...
_torso.translation = Vector3.ZERO
if _viewRot: if _viewRot:
var mouse_pos = get_viewport().get_mouse_position() var mouse_pos = get_viewport().get_mouse_position()
@ -98,15 +137,26 @@ func body_part_chosen(params):
#no _attachment_point #no _attachment_point
if _attachment_point != null: if _attachment_point != null:
var limb = _attachment_point.get_node("Limb") var limb = _attachment_point.get_node("Limb")
var new_part = BodyPartLoader.bodyparts[params].instance()
#adding only possible if no first child # Check if we have enough cost points left
#if limb.get_child(0) == null: var current_cost = 0
# limb.add_child(BodyPartLoader.bodyparts[params].instance())
#if spot already taken, DELETE # If we already have something in that slot, we can place
# the new one if the total cost WITHOUT that existing part
# is low enough
if limb.get_child(0) != null: if limb.get_child(0) != null:
delete_body_part() current_cost += limb.get_child(0).cost
limb.add_child(BodyPartLoader.bodyparts[params].instance())
if _costProgress.value + new_part.cost - current_cost <= _costProgress.max_value:
#if spot already taken, DELETE
if limb.get_child(0) != null:
delete_body_part()
limb.add_child(new_part)
# Add the cost of that part
_costProgress.value += new_part.cost
func make_it_shine(highlight : bool): func make_it_shine(highlight : bool):
@ -118,10 +168,9 @@ func delete_body_part():
if _attachment_point != null: 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:
_costProgress.value -= body_part.cost
body_part.queue_free() body_part.queue_free()
func _on_Start_pressed(): func _on_Start_pressed():
PhysicsServer.area_set_param(get_viewport().find_world().get_space(), PhysicsServer.AREA_PARAM_GRAVITY, _default_grav)
emit_signal("start_fight", _torso) emit_signal("start_fight", _torso)

View 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

View File

@ -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="SphereMesh" id=1]
[sub_resource type="SphereShape" id=2] [sub_resource type="SphereShape" id=2]
[node name="AttachmentPoint" type="Spatial"] [node name="AttachmentPoint" type="Spatial"]
script = ExtResource( 1 )
[node name="Mesh" type="MeshInstance" parent="."] [node name="Mesh" type="MeshInstance" parent="."]
transform = Transform( 0.2, 0, 0, 0, 0.2, 0, 0, 0, 0.2, 0, 0, 0 ) transform = Transform( 0.2, 0, 0, 0, 0.2, 0, 0, 0, 0.2, 0, 0, 0 )

View File

@ -1,14 +1,24 @@
extends Spatial extends RigidBody
class_name BodyBase class_name BodyBase
export(int) var player_id export(int) var player_id
var ingame : bool = false
var ground : Spatial
var current_angle : float
# Called when the node enters the scene tree for the first time. func on_ingame():
func _ready(): ground = get_parent().get_node("Arena").get_node("ground")
pass # Replace with function body. ingame = true
axis_lock_linear_x = true
# Called every frame. 'delta' is the elapsed time since the previous frame.
#func _process(delta): func _process(delta):
# pass if ingame:
current_angle = ((-transform.basis.z).angle_to(ground.transform.basis.y))
var rot_vector = (-transform.basis.z).cross(ground.transform.basis.y)
if current_angle > 0.2:
apply_torque_impulse(rot_vector * current_angle * 14)

View File

@ -11,6 +11,9 @@ height = 1.48749
[node name="Torso" type="RigidBody" groups=[ [node name="Torso" type="RigidBody" groups=[
"Player", "Player",
]] ]]
transform = Transform( 1, 0, 0, 0, -1.62921e-07, -1, 0, 1, -1.62921e-07, 0, 0, 0 )
mass = 1.5
gravity_scale = 1.5
script = ExtResource( 1 ) script = ExtResource( 1 )
[node name="TorsoCollider" type="CollisionShape" parent="."] [node name="TorsoCollider" type="CollisionShape" parent="."]
@ -18,13 +21,15 @@ transform = Transform( 2.5, 0, 0, 0, 2.5, 0, 0, 0, 2.5, 0, 0, 0 )
shape = SubResource( 1 ) shape = SubResource( 1 )
[node name="DownFrontLeft" parent="." instance=ExtResource( 2 )] [node name="DownFrontLeft" parent="." instance=ExtResource( 2 )]
transform = Transform( -0.965926, 0, -0.258819, 0, 1, 0, 0.258819, 0, -0.965926, 1.3, 1, 4.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"] [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 ) 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 )] [node name="DownFrontRight" parent="." instance=ExtResource( 2 )]
transform = Transform( -0.965926, 0, 0.258819, 0, 1, 0, -0.258819, 0, -0.965926, -1.3, 1, 4.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"] [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 ) 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 +39,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 )] [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 ) 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 )] [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 ) 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 )] [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 ) 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 )] [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 ) 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 )] [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 ) 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 )] [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 ) 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 )] [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 ) transform = Transform( 0.5, 0, 0, 0, -2.18557e-08, 0.5, 0, -0.5, -2.18557e-08, 0, 0, 0 )

View File

@ -7,10 +7,10 @@ class_name BodyPart
onready var base = get_parent().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
var setup_done = false var setup_done = false
export(float) var cost
# 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:
@ -31,12 +31,6 @@ func _process(delta: float) -> void:
setup_done = true setup_done = true
func _unhandled_input(event):
if event is InputEventKey:
if event.pressed and event.scancode == key:
action()
# Do something with the base # Do something with the base
func action(): func action():
pass pass

View File

@ -7,11 +7,16 @@ onready var anim = get_node("Mesh/AnimationPlayer")
func action(): func action():
anim.play("ArmatureAction") anim.play("ArmatureAction")
# Apply a slight impulse here too
var offset = touch_area.global_transform.origin - base.global_transform.origin
var direction = base.transform.basis.y * 1.0
base.apply_impulse(offset, direction)
func push(body): func push(body):
# We multiply by 0.1 because we only want it to spin slightly, it should mostly go up var offset = touch_area.global_transform.origin - base.global_transform.origin
var offset = transform.basis.xform(touch_area.global_transform.origin - base.global_transform.origin) * 0.1 var direction = -base.transform.basis.y * 5.0
var direction = (base.transform.basis.y - base.transform.basis.z).normalized() * 5.0
base.apply_impulse(offset, direction) base.apply_impulse(offset, direction)

View File

@ -13,13 +13,14 @@ radius = 0.125064
[node name="HumanArm" instance=ExtResource( 1 )] [node name="HumanArm" instance=ExtResource( 1 )]
transform = Transform( -4.37114e-08, 1, 4.37114e-08, 0, -4.37114e-08, 1, 1, 4.37114e-08, 1.91069e-15, 0, 0, 0 ) transform = Transform( -4.37114e-08, 1, 4.37114e-08, 0, -4.37114e-08, 1, 1, 4.37114e-08, 1.91069e-15, 0, 0, 0 )
script = ExtResource( 2 ) script = ExtResource( 2 )
cost = 10.0
[node name="PartCollider" parent="." index="0"] [node name="PartCollider" parent="." index="0"]
transform = Transform( 0.796097, 0, -0.605169, 0, 1, -3.55271e-15, 0.605169, 8.35188e-23, 0.796097, -0.894889, 1.42109e-14, -2.6182 ) transform = Transform( 0.796097, 0, -0.605169, 0, 1, -3.55271e-15, 0.605169, 8.35188e-23, 0.796097, -0.894889, 1.42109e-14, -2.6182 )
shape = SubResource( 1 ) shape = SubResource( 1 )
[node name="TouchArea" parent="." index="1"] [node name="TouchArea" parent="." index="1"]
transform = Transform( -0.114995, 2.15415, 2.55188, -3.31495, -0.382831, 0.173782, 0.404395, -2.52562, 2.15021, -0.0333271, -0.131349, -3.878 ) transform = Transform( -0.118289, 2.18551, 2.52493, -3.31556, -0.378316, 0.172131, 0.398447, -2.49922, 2.18193, -0.0255739, -0.127111, -3.79535 )
[node name="CollisionShape" type="CollisionShape" parent="TouchArea" index="0"] [node name="CollisionShape" type="CollisionShape" parent="TouchArea" index="0"]
shape = SubResource( 2 ) shape = SubResource( 2 )
@ -31,7 +32,7 @@ transform = Transform( 2, 0, 0, 0, 2, 0, 0, 0, 2, -0.357728, -8.51476, 0 )
bones/7/bound_children = [ NodePath("BoneAttachment") ] bones/7/bound_children = [ NodePath("BoneAttachment") ]
[node name="BoneAttachment" type="BoneAttachment" parent="Mesh/Armature/Skeleton" index="1"] [node name="BoneAttachment" type="BoneAttachment" parent="Mesh/Armature/Skeleton" index="1"]
transform = Transform( 0.0638506, -0.727912, -0.682691, -0.242273, 0.652315, -0.718184, 0.968104, 0.211254, -0.134703, 0.0541456, 1.16231, 0.134369 ) transform = Transform( 0.0646207, -0.736312, -0.673549, -0.240426, 0.64359, -0.726627, 0.968514, 0.208894, -0.135439, 0.054756, 1.13784, 0.129916 )
bone_name = "bone_6" bone_name = "bone_6"
[node name="RemoteTransform" type="RemoteTransform" parent="Mesh/Armature/Skeleton/BoneAttachment" index="0"] [node name="RemoteTransform" type="RemoteTransform" parent="Mesh/Armature/Skeleton/BoneAttachment" index="0"]

View File

@ -12,11 +12,17 @@ func _ready() -> void:
func action(): func action():
anim.play("ArmatureAction") 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): 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
var offset = transform.basis.xform(touch_area.global_transform.origin - base.global_transform.origin) * 0.1 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() * 5.0 var direction = (base.transform.basis.y - base.transform.basis.z).normalized() * 10.0
base.apply_impulse(offset, direction) base.apply_impulse(offset, direction)

View File

@ -6,7 +6,7 @@
[ext_resource path="res://3D Input/beinimage.png" type="Texture" id=4] [ext_resource path="res://3D Input/beinimage.png" type="Texture" id=4]
[sub_resource type="BoxShape" id=1] [sub_resource type="BoxShape" id=1]
extents = Vector3( 0.312908, 1.16904, 0.82381 ) extents = Vector3( 0.666, 2.378, 1.555 )
[sub_resource type="SphereShape" id=2] [sub_resource type="SphereShape" id=2]
radius = 0.108468 radius = 0.108468
@ -17,22 +17,26 @@ albedo_texture = ExtResource( 4 )
[node name="HumanLeg" instance=ExtResource( 1 )] [node name="HumanLeg" instance=ExtResource( 1 )]
transform = Transform( 1, 8.74228e-08, -3.82137e-15, 0, -4.37114e-08, -1, -8.74228e-08, 1, -4.37114e-08, 0, 0, 0 ) transform = Transform( 1, 8.74228e-08, -3.82137e-15, 0, -4.37114e-08, -1, -8.74228e-08, 1, -4.37114e-08, 0, 0, 0 )
script = ExtResource( 2 ) script = ExtResource( 2 )
cost = 20.0
[node name="PartCollider" parent="." index="0"] [node name="PartCollider" parent="." index="0"]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -1.77838, 0.0523456 ) transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -3.37252, -0.326758 )
shape = SubResource( 1 ) shape = SubResource( 1 )
[node name="TouchArea" parent="." index="1"] [node name="TouchArea" parent="." index="1"]
transform = Transform( 1.97878, 4.51195e-13, -2.27374e-13, -6.82121e-13, -0.277472, -1.95923, 7.89663e-14, 1.95923, -0.277471, -6.53699e-13, -2.74829, -0.692869 ) transform = Transform( 3.95756, 9.05942e-13, -4.54747e-13, -1.33582e-12, -0.554944, -3.91846, 1.57933e-13, 3.91846, -0.554943, -1.3074e-12, -5.3019, -1.33665 )
[node name="CollisionShape" type="CollisionShape" parent="TouchArea" index="0"] [node name="CollisionShape" type="CollisionShape" parent="TouchArea" index="0"]
shape = SubResource( 2 ) shape = SubResource( 2 )
[node name="Mesh" parent="." index="2" instance=ExtResource( 3 )] [node name="Mesh" parent="." index="2" instance=ExtResource( 3 )]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -1.42109e-14, -2.28512, -0.0490953 ) transform = Transform( 2, 0, 0, 0, 2, 0, 0, 0, 2, -2.84217e-14, -4.37555, -0.0490953 )
[node name="Armature" parent="Mesh" index="2"]
transform = Transform( 1.97878, 0, 0, 0, -1.97636, 0.0978612, 8.47033e-22, -0.0978612, -1.97636, -1.33227e-14, 2.34477, 0.0119585 )
[node name="Cube" parent="Mesh/Armature/Skeleton" index="0"] [node name="Cube" parent="Mesh/Armature/Skeleton" index="0"]
transform = Transform( 1, 0, 0, 0, 1, -3.72529e-09, 0, 3.72529e-09, 1, 0, 0, 0 ) transform = Transform( 1, 0, -8.88178e-16, -1.42109e-14, 1, -2.23517e-08, 4.44089e-16, 2.23517e-08, 1, 0, 0, 0 )
material/0 = SubResource( 3 ) material/0 = SubResource( 3 )
[node name="BoneAttachment" type="BoneAttachment" parent="Mesh/Armature/Skeleton" index="1"] [node name="BoneAttachment" type="BoneAttachment" parent="Mesh/Armature/Skeleton" index="1"]

View File

@ -1,23 +1,33 @@
extends Node extends Node
const _main_menu_path = "res://UI/MainMenu.tscn"
const _body_build_path = "res://BodyConfig/bodyBuilderMenu.tscn" const _body_build_path = "res://BodyConfig/bodyBuilderMenu.tscn"
const _fighting_path = "res://Ingame/Testing.tscn" const _fighting_path = "res://Ingame/Testing.tscn"
const _win_screen_path = "res://UI/WinScreen.tscn" const _win_screen_path = "res://UI/WinScreen.tscn"
var _main_menu_scene
var _body_build_scene var _body_build_scene
var _fighting_scene var _fighting_scene
var _win_screen_scene var _win_screen_scene
func _ready(): var _bodies : Array
_prep_scene("body_build") var _body_count = 0
_prep_scene("fight_scene") var _body_positions = [Vector3(0, 15, -30), Vector3(0, 15, 30), Vector3(-30, 15, 0), Vector3(30, 15, 0)]
_prep_scene("win_screen")
_switch_scene(_body_build_scene, "body_build") func _ready():
InGameState.player_count = 2
_prep_scene("main_menu")
_switch_scene(_main_menu_scene, "main_menu")
func _prep_scene(scene_name) -> Node: func _prep_scene(scene_name) -> Node:
if scene_name == "body_build": if scene_name == "main_menu":
_main_menu_scene = preload(_main_menu_path).instance()
_main_menu_scene.connect("body_build", self, "_switch_to_body_build")
return _main_menu_scene
elif scene_name == "body_build":
_body_build_scene = preload(_body_build_path).instance() _body_build_scene = preload(_body_build_path).instance()
_body_build_scene.connect("start_fight", self, "_switch_to_fighting") _body_build_scene.connect("start_fight", self, "_switch_to_fighting")
return _body_build_scene return _body_build_scene
@ -31,6 +41,7 @@ func _prep_scene(scene_name) -> Node:
return _win_screen_scene return _win_screen_scene
return null return null
func _switch_scene(scene, scene_name): func _switch_scene(scene, scene_name):
#delete children #delete children
for child in get_children(): for child in get_children():
@ -52,13 +63,32 @@ func _switch_to_win(player_id):
func _switch_to_fighting(torso): func _switch_to_fighting(torso):
_body_build_scene.remove_child(torso) _body_build_scene.remove_child(torso)
torso.translation += Vector3(0, 3, 0)
torso.rotation = Vector3(0, 0, 0)
_switch_scene(_fighting_scene, "fight_scene")
_fighting_scene.add_child(torso) torso.global_transform.origin = Vector3.ZERO
torso.translation += _body_positions[_body_count]
torso.rotation_degrees = Vector3(90, 0, 0)
if _body_count == 1:
torso.rotation_degrees += Vector3(0, 180, 0)
_body_count += 1
if _body_count < InGameState.player_count:
_bodies.append(torso)
_switch_scene(_body_build_scene, "body_build")
_body_build_scene.done_player_count = _body_count
_body_build_scene.change_count_ui()
else:
_switch_scene(_fighting_scene, "fight_scene")
for body in _bodies:
_fighting_scene.add_child(body)
body.on_ingame()
_fighting_scene.add_child(torso)
torso.on_ingame()
func _switch_to_body_build(): func _switch_to_body_build():
_switch_scene(_body_build_scene, "body_build") _switch_scene(_body_build_scene, "body_build")
_body_build_scene.change_count_ui()

View File

@ -4,5 +4,5 @@ var bodyparts : Dictionary
# 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():
bodyparts["Arm"] = load("res://BodyParts/Arm.tscn") bodyparts["Human Arm"] = load("res://BodyParts/HumanArm.tscn")
bodyparts["Humanleg"] = load("res://BodyParts/HumanLeg.tscn") bodyparts["Human Leg"] = load("res://BodyParts/HumanLeg.tscn")

View File

@ -58,7 +58,7 @@ rotation_mode = 4
transform = Transform( -1, 0, -3.25841e-07, 0, 1, 0, 3.25841e-07, 0, -1, 0, 0, 0 ) transform = Transform( -1, 0, -3.25841e-07, 0, 1, 0, 3.25841e-07, 0, -1, 0, 0, 0 )
[node name="PathFollow3" type="PathFollow" parent="Path"] [node name="PathFollow3" type="PathFollow" parent="Path"]
transform = Transform( 0.0525302, 0, 0.998617, 0, 1, 0, -0.998619, 0, 0.0525301, 1.77306, 0, -55.9514 ) transform = Transform( 0.0525302, 0, 0.998617, 0, 1, 0, -0.998619, 0, 0.05253, 1.77306, 0, -55.9514 )
offset = 57.5 offset = 57.5
rotation_mode = 4 rotation_mode = 4
@ -66,7 +66,7 @@ rotation_mode = 4
transform = Transform( -1, 0, -3.25841e-07, 0, 1, 0, 3.25841e-07, 0, -1, 0, 0, 0 ) transform = Transform( -1, 0, -3.25841e-07, 0, 1, 0, 3.25841e-07, 0, -1, 0, 0, 0 )
[node name="PathFollow4" type="PathFollow" parent="Path"] [node name="PathFollow4" type="PathFollow" parent="Path"]
transform = Transform( 0.412628, 0, 0.910899, 0, 1, 0, -0.9109, 0, 0.412628, 25.6454, 0, -49.4766 ) transform = Transform( 0.412629, 0, 0.910899, 0, 1, 0, -0.9109, 0, 0.412628, 25.6454, 0, -49.4766 )
offset = 82.37 offset = 82.37
rotation_mode = 4 rotation_mode = 4
@ -106,7 +106,7 @@ rotation_mode = 4
transform = Transform( -1, 0, -3.25841e-07, 0, 1, 0, 3.25841e-07, 0, -1, 0, 0, 0 ) transform = Transform( -1, 0, -3.25841e-07, 0, 1, 0, 3.25841e-07, 0, -1, 0, 0, 0 )
[node name="PathFollow9" type="PathFollow" parent="Path"] [node name="PathFollow9" type="PathFollow" parent="Path"]
transform = Transform( 0.760079, -6.86382e-07, -0.64983, 7.11586e-07, 1, -2.23934e-07, 0.649831, -2.92203e-07, 0.760078, 48.2851, 2.0276e-05, 59.2494 ) transform = Transform( 0.760079, -6.86382e-07, -0.64983, 7.11587e-07, 1, -2.23935e-07, 0.649831, -2.92203e-07, 0.760078, 48.2851, 2.0276e-05, 59.2494 )
offset = 206.72 offset = 206.72
rotation_mode = 4 rotation_mode = 4
@ -170,7 +170,7 @@ rotation_mode = 4
transform = Transform( -1, 0, -3.25841e-07, 0, 1, 0, 3.25841e-07, 0, -1, 0, 0, 0 ) transform = Transform( -1, 0, -3.25841e-07, 0, 1, 0, 3.25841e-07, 0, -1, 0, 0, 0 )
[node name="PathFollow17" type="PathFollow" parent="Path"] [node name="PathFollow17" type="PathFollow" parent="Path"]
transform = Transform( -0.817611, 3.47972e-07, 0.57577, 4.25596e-07, 1, 0, -0.575771, 2.45046e-07, -0.817609, -57.8267, 0, -24.3573 ) transform = Transform( -0.817611, 3.47972e-07, 0.57577, 4.25597e-07, 1, 0, -0.575771, 2.45046e-07, -0.817609, -57.8267, 0, -24.3573 )
offset = 405.68 offset = 405.68
rotation_mode = 4 rotation_mode = 4

View File

@ -1,13 +1,14 @@
extends Spatial extends Spatial
onready var player1 = get_parent().get_node("Torso")
onready var player2 = get_parent().get_node("Torso2")
onready var camera = get_node("Camera") onready var camera = get_node("Camera")
func _process(delta: float) -> void: func _process(delta: float) -> void:
var player1 = get_parent().get_child(3)
var player2 = get_parent().get_child(4)
if not player1 and player2: return
var center = player2.transform.origin + (player1.transform.origin - player2.transform.origin) / 2.0 var center = player2.transform.origin + (player1.transform.origin - player2.transform.origin) / 2.0
var distance = (player1.transform.origin - player2.transform.origin).length() var distance = (player1.transform.origin - player2.transform.origin).length()

View File

@ -1,14 +1,30 @@
[gd_scene load_steps=4 format=2] [gd_scene load_steps=8 format=2]
[ext_resource path="res://3D Input/torch.glb" type="PackedScene" id=1] [ext_resource path="res://3D Input/torch.glb" type="PackedScene" id=1]
[ext_resource path="res://Ingame/Level/Wood.tres" type="Material" id=2] [ext_resource path="res://Ingame/Level/Wood.tres" type="Material" id=2]
[ext_resource path="res://Textures/Particles/Smoke.tscn" type="PackedScene" id=3] [ext_resource path="res://Textures/Particles/Smoke.tscn" type="PackedScene" id=3]
[ext_resource path="res://Textures/Fabric/Fabric28_rgh.jpg" type="Texture" id=4]
[ext_resource path="res://Textures/Fabric/Fabric28_col.jpg" type="Texture" id=5]
[ext_resource path="res://Textures/Fabric/Fabric28_nrm.jpg" type="Texture" id=6]
[sub_resource type="SpatialMaterial" id=1]
albedo_texture = ExtResource( 5 )
roughness_texture = ExtResource( 4 )
emission_enabled = true
emission = Color( 0.270588, 0.203922, 0, 1 )
emission_energy = 1.0
emission_operator = 0
emission_on_uv2 = false
normal_enabled = true
normal_scale = 1.0
normal_texture = ExtResource( 6 )
[node name="Torch" instance=ExtResource( 1 )] [node name="Torch" instance=ExtResource( 1 )]
[node name="Cube" parent="." index="0"] [node name="Cube" parent="." index="0"]
cast_shadow = 0 cast_shadow = 0
material/0 = ExtResource( 2 ) material/0 = ExtResource( 2 )
material/1 = SubResource( 1 )
[node name="OmniLight" type="OmniLight" parent="." index="1"] [node name="OmniLight" type="OmniLight" parent="." index="1"]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -0.730462, 7.55028, -0.0896119 ) transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -0.730462, 7.55028, -0.0896119 )

View File

@ -1,12 +1,9 @@
[gd_scene load_steps=8 format=2] [gd_scene load_steps=5 format=2]
[ext_resource path="res://BodyParts/Arm.tscn" type="PackedScene" id=1]
[ext_resource path="res://UI/UI.tscn" type="PackedScene" id=2] [ext_resource path="res://UI/UI.tscn" type="PackedScene" id=2]
[ext_resource path="res://BodyParts/BodyBase/BodyBase.tscn" type="PackedScene" id=3]
[ext_resource path="res://Ingame/Ingame.gd" type="Script" id=4] [ext_resource path="res://Ingame/Ingame.gd" type="Script" id=4]
[ext_resource path="res://Ingame/Arena.tscn" type="PackedScene" id=5] [ext_resource path="res://Ingame/Arena.tscn" type="PackedScene" id=5]
[ext_resource path="res://Ingame/CameraFocus.gd" type="Script" id=6] [ext_resource path="res://Ingame/CameraFocus.gd" type="Script" id=6]
[ext_resource path="res://BodyParts/HumanLeg.tscn" type="PackedScene" id=7]
[node name="InGame" type="Spatial"] [node name="InGame" type="Spatial"]
script = ExtResource( 4 ) script = ExtResource( 4 )
@ -15,37 +12,10 @@ script = ExtResource( 4 )
[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, 17.8512, 2, 0 )
[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="HumanLeg" parent="Torso2/DownFrontLeft/Limb" index="0" instance=ExtResource( 7 )]
[node name="Arm" parent="Torso2/DownFrontRight/Limb" index="0" instance=ExtResource( 1 )]
key = 83
[node name="Arm" parent="Torso2/DownBackRight/Limb" index="0" instance=ExtResource( 1 )]
key = 81
[node name="Arm" parent="Torso2/DownBackLeft/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, 19, 17, -2 ) 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="Arena"]
[editable path="Torso2"]
[editable path="Torso2/DownFrontLeft"]
[editable path="Torso2/DownFrontRight"]
[editable path="Torso2/DownBackRight"]
[editable path="Torso2/DownBackLeft"]

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 MiB

View File

@ -0,0 +1,36 @@
[remap]
importer="texture"
type="StreamTexture"
path.s3tc="res://.import/Fabric28_col.jpg-38d2e00b860817dc47ff3322974f73ca.s3tc.stex"
path.etc2="res://.import/Fabric28_col.jpg-38d2e00b860817dc47ff3322974f73ca.etc2.stex"
metadata={
"imported_formats": [ "s3tc", "etc2" ],
"vram_texture": true
}
[deps]
source_file="res://Textures/Fabric/Fabric28_col.jpg"
dest_files=[ "res://.import/Fabric28_col.jpg-38d2e00b860817dc47ff3322974f73ca.s3tc.stex", "res://.import/Fabric28_col.jpg-38d2e00b860817dc47ff3322974f73ca.etc2.stex" ]
[params]
compress/mode=2
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=true
flags/filter=true
flags/mipmaps=true
flags/anisotropic=false
flags/srgb=1
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=false
svg/scale=1.0

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 MiB

View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/Fabric28_disp.jpg-648f8e3ec3b3eef09560cf744278592f.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://Textures/Fabric/Fabric28_disp.jpg"
dest_files=[ "res://.import/Fabric28_disp.jpg-648f8e3ec3b3eef09560cf744278592f.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

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.7 MiB

View File

@ -0,0 +1,36 @@
[remap]
importer="texture"
type="StreamTexture"
path.s3tc="res://.import/Fabric28_nrm.jpg-b6f0e8aedb0a7ab9a3f2aa0084146129.s3tc.stex"
path.etc2="res://.import/Fabric28_nrm.jpg-b6f0e8aedb0a7ab9a3f2aa0084146129.etc2.stex"
metadata={
"imported_formats": [ "s3tc", "etc2" ],
"vram_texture": true
}
[deps]
source_file="res://Textures/Fabric/Fabric28_nrm.jpg"
dest_files=[ "res://.import/Fabric28_nrm.jpg-b6f0e8aedb0a7ab9a3f2aa0084146129.s3tc.stex", "res://.import/Fabric28_nrm.jpg-b6f0e8aedb0a7ab9a3f2aa0084146129.etc2.stex" ]
[params]
compress/mode=2
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=1
flags/repeat=true
flags/filter=true
flags/mipmaps=true
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=false
svg/scale=1.0

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 MiB

View File

@ -0,0 +1,36 @@
[remap]
importer="texture"
type="StreamTexture"
path.s3tc="res://.import/Fabric28_rgh.jpg-6ae3f67af686558aba1365b73a0999ac.s3tc.stex"
path.etc2="res://.import/Fabric28_rgh.jpg-6ae3f67af686558aba1365b73a0999ac.etc2.stex"
metadata={
"imported_formats": [ "s3tc", "etc2" ],
"vram_texture": true
}
[deps]
source_file="res://Textures/Fabric/Fabric28_rgh.jpg"
dest_files=[ "res://.import/Fabric28_rgh.jpg-6ae3f67af686558aba1365b73a0999ac.s3tc.stex", "res://.import/Fabric28_rgh.jpg-6ae3f67af686558aba1365b73a0999ac.etc2.stex" ]
[params]
compress/mode=2
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=true
flags/filter=true
flags/mipmaps=true
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=false
svg/scale=1.0

19
UI/MainMenu.gd Normal file
View File

@ -0,0 +1,19 @@
extends Control
export(NodePath) var startPath
var _start_button
signal body_build()
func _ready():
_start_button = get_node(startPath) as Button
func _on_Start_pressed():
emit_signal("body_build")
func _on_Exit_pressed():
get_tree().quit()

120
UI/MainMenu.tscn Normal file
View File

@ -0,0 +1,120 @@
[gd_scene load_steps=7 format=2]
[ext_resource path="res://UI/MainMenu.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="MainMenu" type="Control"]
anchor_right = 1.0
anchor_bottom = 1.0
script = ExtResource( 1 )
__meta__ = {
"_edit_use_anchors_": false
}
startPath = NodePath("MarginContainer2/VBoxContainer/Start")
[node name="MarginContainer" type="MarginContainer" parent="."]
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
margin_left = -512.0
margin_top = -300.0
margin_right = 512.0
margin_bottom = 300.0
__meta__ = {
"_edit_use_anchors_": false
}
[node name="VBoxContainer" type="VBoxContainer" parent="MarginContainer"]
margin_right = 1024.0
margin_bottom = 600.0
[node name="GameName" type="Label" parent="MarginContainer/VBoxContainer"]
margin_right = 1024.0
margin_bottom = 298.0
rect_min_size = Vector2( 0, 250 )
size_flags_horizontal = 3
size_flags_vertical = 3
custom_fonts/font = ExtResource( 2 )
text = "D-d-d-d-d-duell"
align = 1
valign = 2
[node name="CenterContainer" type="CenterContainer" parent="MarginContainer/VBoxContainer"]
margin_top = 302.0
margin_right = 1024.0
margin_bottom = 600.0
size_flags_horizontal = 3
size_flags_vertical = 3
__meta__ = {
"_edit_use_anchors_": false
}
[node name="MarginContainer2" type="MarginContainer" parent="."]
anchor_left = 0.5
anchor_top = 1.0
anchor_right = 0.5
anchor_bottom = 1.0
margin_left = -100.0
margin_top = -201.0
margin_right = 100.0
__meta__ = {
"_edit_use_anchors_": false
}
[node name="VBoxContainer" type="VBoxContainer" parent="MarginContainer2"]
margin_right = 200.0
margin_bottom = 201.0
size_flags_horizontal = 3
size_flags_vertical = 3
[node name="Start" type="Button" parent="MarginContainer2/VBoxContainer"]
margin_right = 200.0
margin_bottom = 67.0
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 = "Enjoy"
__meta__ = {
"_edit_use_anchors_": false
}
[node name="SpacerDots2" type="Control" parent="MarginContainer2/VBoxContainer"]
margin_top = 71.0
margin_right = 200.0
margin_bottom = 91.0
rect_min_size = Vector2( 0, 20 )
__meta__ = {
"_edit_use_anchors_": false
}
[node name="Exit" type="Button" parent="MarginContainer2/VBoxContainer"]
margin_top = 95.0
margin_right = 200.0
margin_bottom = 162.0
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 = "Disenjoy"
__meta__ = {
"_edit_use_anchors_": false
}
[node name="SpacerDots" type="Control" parent="MarginContainer2/VBoxContainer"]
margin_top = 166.0
margin_right = 200.0
margin_bottom = 201.0
rect_min_size = Vector2( 0, 35 )
__meta__ = {
"_edit_use_anchors_": false
}
[connection signal="pressed" from="MarginContainer2/VBoxContainer/Start" to="." method="_on_Start_pressed"]
[connection signal="pressed" from="MarginContainer2/VBoxContainer/Exit" to="." method="_on_Exit_pressed"]

View File

@ -9,7 +9,7 @@
config_version=4 config_version=4
_global_script_classes=[ { _global_script_classes=[ {
"base": "Spatial", "base": "RigidBody",
"class": "BodyBase", "class": "BodyBase",
"language": "GDScript", "language": "GDScript",
"path": "res://BodyParts/BodyBase/BodyBase.gd" "path": "res://BodyParts/BodyBase/BodyBase.gd"
@ -33,7 +33,7 @@ _global_script_class_icons={
[application] [application]
config/name="BodyPartFighter" config/name="BodyPartFighter"
run/main_scene="res://Ingame/Testing.tscn" run/main_scene="res://Controllers/GameStateController.tscn"
config/icon="res://icon.png" config/icon="res://icon.png"
[autoload] [autoload]