diff --git a/3D Input/Fertige GLBs/Arm_Mensch.glb b/3D Input/Fertige GLBs/Arm_Mensch.glb new file mode 100644 index 0000000..1a0ffcc Binary files /dev/null and b/3D Input/Fertige GLBs/Arm_Mensch.glb differ diff --git a/3D Input/Mensch_Hand.blend b/3D Input/Mensch_Hand.blend index 9e466a3..8d84e6a 100644 Binary files a/3D Input/Mensch_Hand.blend and b/3D Input/Mensch_Hand.blend differ diff --git a/3D Input/Mensch_Hand.blend1 b/3D Input/Mensch_Hand.blend1 index 5832746..f728281 100644 Binary files a/3D Input/Mensch_Hand.blend1 and b/3D Input/Mensch_Hand.blend1 differ diff --git a/3D Input/Mensch_Kopf.blend b/3D Input/Mensch_Kopf.blend index 6883481..0238458 100644 Binary files a/3D Input/Mensch_Kopf.blend and b/3D Input/Mensch_Kopf.blend differ diff --git a/3D Input/Mensch_Kopf.blend1 b/3D Input/Mensch_Kopf.blend1 index d6985aa..fca2543 100644 Binary files a/3D Input/Mensch_Kopf.blend1 and b/3D Input/Mensch_Kopf.blend1 differ diff --git a/3D Input/handTextur.png b/3D Input/handTextur.png new file mode 100644 index 0000000..4d5ec69 Binary files /dev/null and b/3D Input/handTextur.png differ diff --git a/3D Input/vogel_flügel unwrapped.blend b/3D Input/vogel_flügel unwrapped.blend new file mode 100644 index 0000000..3b552f9 Binary files /dev/null and b/3D Input/vogel_flügel unwrapped.blend differ diff --git a/3D Input/vogel_flügel unwrapped.blend1 b/3D Input/vogel_flügel unwrapped.blend1 new file mode 100644 index 0000000..bd02429 Binary files /dev/null and b/3D Input/vogel_flügel unwrapped.blend1 differ diff --git a/BodyConfig/bodyBuilderMenu.tscn b/BodyConfig/bodyBuilderMenu.tscn index 6dfdb6a..a022634 100644 --- a/BodyConfig/bodyBuilderMenu.tscn +++ b/BodyConfig/bodyBuilderMenu.tscn @@ -66,7 +66,7 @@ collide_with_areas = true collide_with_bodies = false [node name="Torso" parent="." instance=ExtResource( 1 )] -[connection signal="pressed" from="GUI/HBoxC/VBoxC/Start" to="." method="_on_Button2_pressed"] +[connection signal="pressed" from="GUI/HBoxC/VBoxC/Start" to="." method="_on_Start_pressed"] [editable path="Torso"] diff --git a/BodyConfig/bodyBuildingScript.gd b/BodyConfig/bodyBuildingScript.gd index ceebba8..f3d70e8 100644 --- a/BodyConfig/bodyBuildingScript.gd +++ b/BodyConfig/bodyBuildingScript.gd @@ -17,12 +17,15 @@ var _viewport : Viewport var _velx = 0 var _vely = 0 - var _attachment_point : Spatial +var _default_grav + +signal start_fight() # Called when the node enters the scene tree for the first time. 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 _camera = get_node(cameraPath) as Camera @@ -117,3 +120,8 @@ func delete_body_part(): if body_part != null: body_part.queue_free() + +func _on_Start_pressed(): + PhysicsServer.area_set_param(get_viewport().find_world().get_space(), PhysicsServer.AREA_PARAM_GRAVITY, _default_grav) + + emit_signal("start_fight") diff --git a/Controllers/GameStateController.gd b/Controllers/GameStateController.gd index 4f38f3c..fe7d042 100644 --- a/Controllers/GameStateController.gd +++ b/Controllers/GameStateController.gd @@ -1,41 +1,59 @@ extends Node -var _win_screen_scene -var _fighting_scene_path = "res://Ingame/Testing.tscn" -var _fighting_scene +const _body_build_path = "res://BodyConfig/bodyBuilderMenu.tscn" +const _fighting_path = "res://Ingame/Testing.tscn" +const _win_screen_path = "res://UI/WinScreen.tscn" + var _body_build_scene +var _fighting_scene +var _win_screen_scene func _ready(): - _win_screen_scene = preload("res://UI/WinScreen.tscn").instance() - _body_build_scene = preload("res://BodyConfig/bodyBuilderMenu.tscn").instance() - _fighting_scene = preload("res://Ingame/Testing.tscn").instance() + _prep_scene("body_build") + _prep_scene("fight_scene") + _prep_scene("win_screen") - InGameState.connect("player_win", self, "_switch_to_win") - _body_build_scene.connect("start_fight", self, "_switch_to_fighting") - _win_screen_scene.connect("build_body", self, "_switch_to_body_build") + _switch_scene(_body_build_scene, "body_build") -func _switch_scene(scene): + +func _prep_scene(scene_name) -> Node: + if scene_name == "body_build": + _body_build_scene = preload(_body_build_path).instance() + _body_build_scene.connect("start_fight", self, "_switch_to_fighting") + return _body_build_scene + elif scene_name == "fight_scene": + _fighting_scene = preload(_fighting_path).instance() + InGameState.connect("player_win", self, "_switch_to_win") + return _fighting_scene + elif scene_name == "win_screen": + _win_screen_scene = preload(_win_screen_path).instance() + _win_screen_scene.connect("build_body", self, "_switch_to_body_build") + return _win_screen_scene + return null + +func _switch_scene(scene, scene_name): #delete children for child in get_children(): child.queue_free() #append win scene - add_child(scene) + var new_scene = _prep_scene(scene_name) + add_child(new_scene) func _switch_to_win(player_id): - _switch_scene(_win_screen_scene) + print("test win") + + _switch_scene(_win_screen_scene, "win_screen") #call win message in win scene _win_screen_scene.set_win_message(player_id) func _switch_to_fighting(): - print("oh fuck") - - _switch_scene(_fighting_scene) - #get_tree().reload_current_scene() + _switch_scene(_fighting_scene, "fight_scene") func _switch_to_body_build(): - _switch_scene(_body_build_scene) + _switch_scene(_body_build_scene, "body_build") + diff --git a/Controllers/GameStateController.tscn b/Controllers/GameStateController.tscn index 31e7866..39ac3b6 100644 --- a/Controllers/GameStateController.tscn +++ b/Controllers/GameStateController.tscn @@ -1,9 +1,6 @@ -[gd_scene load_steps=3 format=2] +[gd_scene load_steps=2 format=2] [ext_resource path="res://Controllers/GameStateController.gd" type="Script" id=1] -[ext_resource path="res://BodyConfig/bodyBuilderMenu.tscn" type="PackedScene" id=2] [node name="GameStateController" type="Node"] script = ExtResource( 1 ) - -[node name="Body Builder Menu" parent="." instance=ExtResource( 2 )] diff --git a/UI/WinScreen.tscn b/UI/WinScreen.tscn index bf0693b..fbe8520 100644 --- a/UI/WinScreen.tscn +++ b/UI/WinScreen.tscn @@ -7,15 +7,15 @@ [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="WinScreen" type="Control"] anchor_right = 1.0 anchor_bottom = 1.0 script = ExtResource( 1 ) __meta__ = { "_edit_use_anchors_": false } -labelPath = NodePath("MarginContainer/VBoxContainer/PlayerWon") -continuePath = NodePath("MarginContainer/VBoxContainer/Control/Continue") +labelPath = NodePath("../WinScreen/MarginContainer/VBoxContainer/PlayerWon") +continuePath = NodePath("../WinScreen/MarginContainer/VBoxContainer/Control/Continue") [node name="MarginContainer" type="MarginContainer" parent="."] anchor_right = 1.0 diff --git a/UI/WinScreenScript.gd b/UI/WinScreenScript.gd index d02ea86..2394aa4 100644 --- a/UI/WinScreenScript.gd +++ b/UI/WinScreenScript.gd @@ -18,6 +18,4 @@ func set_win_message(player_id): func _on_Continue_pressed(): - print("test2") - emit_signal("build_body")