Trying to fix spawn issues

This commit is contained in:
2023-09-04 17:22:02 -07:00
parent ad48e723d5
commit 316651f409
17 changed files with 88 additions and 148 deletions

View File

@@ -5,9 +5,8 @@
[ext_resource type="PackedScene" uid="uid://bq40xbqibrk1y" path="res://Scenes/Weapons/ShotgunBullet.tscn" id="3_p4fqi"]
[ext_resource type="PackedScene" uid="uid://yosw0j58nvrf" path="res://Models/Characters/fwitch.gltf" id="4_mtwuo"]
[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_ayco3"]
radius = 0.980738
height = 3.77708
[sub_resource type="BoxShape3D" id="BoxShape3D_xynge"]
size = Vector3(3.04879, 3.92906, 2.56521)
[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_fqik1"]
radius = 0.704872
@@ -29,8 +28,8 @@ collision_layer = 16
collision_mask = 4100
[node name="CollisionShape3D" type="CollisionShape3D" parent="Pivot/Area3D"]
transform = Transform3D(0.999665, -0.0258978, -7.10543e-15, 0.0258978, 0.999665, 0, 0, 0, 1, -0.0242356, 2.05297, -0.302385)
shape = SubResource("CapsuleShape3D_ayco3")
transform = Transform3D(0.999665, -0.0258978, -7.10543e-15, 0.0258978, 0.999665, 0, 0, 0, 1, 0.0162379, 2.20309, -0.302385)
shape = SubResource("BoxShape3D_xynge")
[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 2.06805, -0.211049)

View File

@@ -17,11 +17,12 @@ _fireProjectile = ExtResource("2_uayjr")
_altFireProjectile = ExtResource("3_tw078")
[node name="Pivot" type="Node3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.174132, 0)
[node name="scoprion" parent="Pivot" instance=ExtResource("2_pahgr")]
[node name="Area3D" type="Area3D" parent="Pivot"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -1.75657e-15, 0, 0)
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -1.75657e-15, 0.117184, 0)
collision_layer = 16
collision_mask = 4100
@@ -30,7 +31,7 @@ transform = Transform3D(0.999665, -0.0258978, -7.10543e-15, 0.0258978, 0.999665,
shape = SubResource("BoxShape3D_wqp0e")
[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.0761452, 0)
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.315199, 0)
shape = SubResource("BoxShape3D_f8aaj")
[connection signal="body_entered" from="Pivot/Area3D" to="." method="OnHit"]

View File

@@ -5,9 +5,8 @@
[ext_resource type="PackedScene" uid="uid://bq40xbqibrk1y" path="res://Scenes/Weapons/ShotgunBullet.tscn" id="3_00thi"]
[ext_resource type="PackedScene" uid="uid://yosw0j58nvrf" path="res://Models/Characters/fwitch.gltf" id="4_hwtlk"]
[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_ayco3"]
radius = 0.980738
height = 3.77708
[sub_resource type="BoxShape3D" id="BoxShape3D_gqlci"]
size = Vector3(3.04879, 3.92906, 2.56521)
[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_fqik1"]
radius = 0.704872
@@ -30,7 +29,7 @@ collision_mask = 4100
[node name="CollisionShape3D" type="CollisionShape3D" parent="Pivot/Area3D"]
transform = Transform3D(0.999665, -0.0258978, -7.10543e-15, 0.0258978, 0.999665, 0, 0, 0, 1, -0.0242356, 2.05297, -0.302385)
shape = SubResource("CapsuleShape3D_ayco3")
shape = SubResource("BoxShape3D_gqlci")
[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 2.06805, -0.211049)

View File

@@ -9,12 +9,14 @@
radius = 0.957319
[node name="Level1" type="Node3D" groups=["Level"]]
process_mode = 3
script = ExtResource("1_mbqlj")
_enemyScenes = Array[PackedScene]([ExtResource("5_dqbra")])
_spawnPoints = Array[Marker3D]([null])
[node name="Area3D2" type="Area3D" parent="." groups=["Level"]]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.568617, 0, -1.72171)
disable_mode = 2
collision_layer = 0
collision_mask = 16

View File

@@ -1,16 +1,17 @@
[gd_scene load_steps=5 format=3 uid="uid://basequfmpg04f"]
[gd_scene load_steps=4 format=3 uid="uid://basequfmpg04f"]
[ext_resource type="PackedScene" uid="uid://jgf7k1r35km1" path="res://Scenes/ExitPortal.tscn" id="2_sq8bv"]
[ext_resource type="PackedScene" uid="uid://cv33g1wyltecc" path="res://Levels/Final Levels/Stage2/STAGE 2.gltf" id="4_kiw1e"]
[ext_resource type="Script" path="res://Scripts/SpawnPoint.cs" id="5_dg8k3"]
[sub_resource type="CylinderShape3D" id="CylinderShape3D_tux5n"]
radius = 0.957319
[node name="Level2" type="Node3D" groups=["Level"]]
process_mode = 3
[node name="Area3D2" type="Area3D" parent="." groups=["Level"]]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 1.43759, 0, -2.42354)
disable_mode = 2
collision_layer = 0
collision_mask = 16
@@ -22,14 +23,6 @@ _levelIndex = 1
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -2.51823)
shape = SubResource("CylinderShape3D_tux5n")
[node name="P1_SpawnPoint" type="Marker3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.503964, 0.123258, 4.44593)
script = ExtResource("5_dg8k3")
[node name="P2_SpawnPoint" type="Marker3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 1.97394, 0.246516, 4.57028)
script = ExtResource("5_dg8k3")
[node name="STAGE 2" parent="." instance=ExtResource("4_kiw1e")]
[connection signal="body_entered" from="Area3D2" to="." method="OnExitEntered"]

View File

@@ -1,35 +1,28 @@
[gd_scene load_steps=5 format=3 uid="uid://btl5fdyjewnwc"]
[gd_scene load_steps=4 format=3 uid="uid://btl5fdyjewnwc"]
[ext_resource type="PackedScene" uid="uid://jgf7k1r35km1" path="res://Scenes/ExitPortal.tscn" id="3_2t766"]
[ext_resource type="PackedScene" uid="uid://6w3upp7ln4i4" path="res://Levels/Final Levels/Stage3/Stage3.tscn" id="3_gd7oi"]
[ext_resource type="Script" path="res://Scripts/SpawnPoint.cs" id="5_kc2wt"]
[sub_resource type="CylinderShape3D" id="CylinderShape3D_j26hn"]
radius = 0.957319
[node name="Level3" type="Node3D" groups=["Level"]]
process_mode = 3
[node name="Area3D2" type="Area3D" parent="." groups=["Level"]]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -1.67434)
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.993156, -1.67434)
disable_mode = 2
collision_layer = 0
collision_mask = 16
[node name="Exit Portal" parent="Area3D2" instance=ExtResource("3_2t766")]
transform = Transform3D(0.7, 0, 0, 0, 0.7, 0, 0, 0, 0.7, 0, 0, -2.53252)
transform = Transform3D(0.7, 0, 0, 0, 0.7, 0, 0, 0, 0.7, 0, -1.06704, -2.53252)
_levelIndex = 2
[node name="CollisionShape3D" type="CollisionShape3D" parent="Area3D2"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -2.51823)
shape = SubResource("CylinderShape3D_j26hn")
[node name="P1_SpawnPoint" type="Marker3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.503964, 0.123258, 5.51333)
script = ExtResource("5_kc2wt")
[node name="P2_SpawnPoint" type="Marker3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 1.3999, 0.123258, 5.51333)
script = ExtResource("5_kc2wt")
[node name="STAGE 3" parent="." instance=ExtResource("3_gd7oi")]
transform = Transform3D(1.09, 0, 0, 0, 1.09, 0, 0, 0, 1.09, 0, 0, -0.528128)

View File

@@ -1,16 +1,17 @@
[gd_scene load_steps=5 format=3 uid="uid://ctvkevnc0wxka"]
[gd_scene load_steps=4 format=3 uid="uid://ctvkevnc0wxka"]
[ext_resource type="PackedScene" uid="uid://bmdkadbprrfvk" path="res://Levels/Final Levels/Stage4/Stage4.tscn" id="3_m86cs"]
[ext_resource type="PackedScene" uid="uid://jgf7k1r35km1" path="res://Scenes/ExitPortal.tscn" id="3_wflo5"]
[ext_resource type="Script" path="res://Scripts/SpawnPoint.cs" id="5_tx78o"]
[sub_resource type="CylinderShape3D" id="CylinderShape3D_8lqmd"]
radius = 0.957319
[node name="Level4" type="Node3D" groups=["Level"]]
process_mode = 3
[node name="Area3D2" type="Area3D" parent="." groups=["Level"]]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -1.52969)
disable_mode = 2
collision_layer = 0
collision_mask = 16
@@ -19,17 +20,9 @@ transform = Transform3D(0.7, 0, 0, 0, 0.7, 0, 0, 0, 0.7, 0, 0, -2.53252)
_levelIndex = 3
[node name="CollisionShape3D" type="CollisionShape3D" parent="Area3D2"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -2.51823)
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.06694, -2.51823)
shape = SubResource("CylinderShape3D_8lqmd")
[node name="P1_SpawnPoint" type="Marker3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.503964, 0.123258, 5.51333)
script = ExtResource("5_tx78o")
[node name="P2_SpawnPoint" type="Marker3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 1.65542, 0.123258, 5.51333)
script = ExtResource("5_tx78o")
[node name="STAGE 4" parent="." instance=ExtResource("3_m86cs")]
transform = Transform3D(1.01, 0, 0, 0, 1.01, 0, 0, 0, 1.01, 0, 0, 1.1578)

View File

@@ -1,16 +1,17 @@
[gd_scene load_steps=5 format=3 uid="uid://col60npvg7wr1"]
[gd_scene load_steps=4 format=3 uid="uid://col60npvg7wr1"]
[ext_resource type="PackedScene" uid="uid://jgf7k1r35km1" path="res://Scenes/ExitPortal.tscn" id="3_ehcts"]
[ext_resource type="PackedScene" uid="uid://cy07ovg33vws6" path="res://Levels/Final Levels/Stage5/Stage5.tscn" id="3_yun3r"]
[ext_resource type="Script" path="res://Scripts/SpawnPoint.cs" id="5_2mfmm"]
[sub_resource type="CylinderShape3D" id="CylinderShape3D_a8pxa"]
radius = 0.957319
[node name="Level5" type="Node3D" groups=["Level"]]
process_mode = 3
[node name="Area3D2" type="Area3D" parent="." groups=["Level"]]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.507195, 0, -1.82817)
disable_mode = 2
collision_layer = 0
collision_mask = 16
@@ -19,17 +20,9 @@ transform = Transform3D(0.7, 0, 0, 0, 0.7, 0, 0, 0, 0.7, 0, 0, -2.53252)
_levelIndex = 4
[node name="CollisionShape3D" type="CollisionShape3D" parent="Area3D2"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -2.51823)
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.02346, -2.51823)
shape = SubResource("CylinderShape3D_a8pxa")
[node name="P1_SpawnPoint" type="Marker3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.503964, 0.123258, 5.51333)
script = ExtResource("5_2mfmm")
[node name="P2_SpawnPoint" type="Marker3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 2.16798, 0.123258, 5.51333)
script = ExtResource("5_2mfmm")
[node name="STAGE 5" parent="." instance=ExtResource("3_yun3r")]
[connection signal="body_entered" from="Area3D2" to="." method="OnExitEntered"]

View File

@@ -1,16 +1,17 @@
[gd_scene load_steps=5 format=3 uid="uid://8ukphol1isp2"]
[gd_scene load_steps=4 format=3 uid="uid://8ukphol1isp2"]
[ext_resource type="PackedScene" uid="uid://jgf7k1r35km1" path="res://Scenes/ExitPortal.tscn" id="3_0wdh0"]
[ext_resource type="PackedScene" uid="uid://dldy6w23fyr5t" path="res://Levels/Final Levels/Stage6/Stage6.tscn" id="3_ajkvk"]
[ext_resource type="Script" path="res://Scripts/SpawnPoint.cs" id="5_tba4e"]
[sub_resource type="CylinderShape3D" id="CylinderShape3D_wu0in"]
radius = 0.957319
[node name="Level6" type="Node3D" groups=["Level"]]
process_mode = 3
[node name="Area3D2" type="Area3D" parent="." groups=["Level"]]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -3.94617, 0, -1.55156)
disable_mode = 2
collision_layer = 0
collision_mask = 16
@@ -19,17 +20,9 @@ transform = Transform3D(0.7, 0, 0, 0, 0.7, 0, 0, 0, 0.7, 0, 0, -2.53252)
_levelIndex = 5
[node name="CollisionShape3D" type="CollisionShape3D" parent="Area3D2"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -2.51823)
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.07326, -2.51823)
shape = SubResource("CylinderShape3D_wu0in")
[node name="P1_SpawnPoint" type="Marker3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.503964, 0.123258, 5.51333)
script = ExtResource("5_tba4e")
[node name="P2_SpawnPoint" type="Marker3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 2.10805, 0.123258, 5.51333)
script = ExtResource("5_tba4e")
[node name="STAGE 6" parent="." instance=ExtResource("3_ajkvk")]
[connection signal="body_entered" from="Area3D2" to="." method="OnExitEntered"]

View File

@@ -1,18 +1,19 @@
[gd_scene load_steps=5 format=3 uid="uid://bsq7edeueqyjg"]
[gd_scene load_steps=4 format=3 uid="uid://bsq7edeueqyjg"]
[ext_resource type="PackedScene" uid="uid://biurk21cl5wxw" path="res://Levels/Models/STAGE 7.blend" id="1_dc67b"]
[ext_resource type="PackedScene" uid="uid://jgf7k1r35km1" path="res://Scenes/ExitPortal.tscn" id="3_sjnhq"]
[ext_resource type="Script" path="res://Scripts/SpawnPoint.cs" id="5_5gfi0"]
[sub_resource type="CylinderShape3D" id="CylinderShape3D_a56hv"]
radius = 0.957319
[node name="Level7" type="Node3D" groups=["Level"]]
process_mode = 3
[node name="STAGE 7" parent="." instance=ExtResource("1_dc67b")]
[node name="Area3D2" type="Area3D" parent="." groups=["Level"]]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -3.5888, 0, -1.39131)
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.624017, 0.090312, -0.389846)
disable_mode = 2
collision_layer = 0
collision_mask = 16
@@ -21,15 +22,7 @@ transform = Transform3D(0.7, 0, 0, 0, 0.7, 0, 0, 0, 0.7, 0, 0, -2.53252)
_levelIndex = 6
[node name="CollisionShape3D" type="CollisionShape3D" parent="Area3D2"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -2.51823)
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.11323, -2.51823)
shape = SubResource("CylinderShape3D_a56hv")
[node name="P1_SpawnPoint" type="Marker3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.503964, 0.123258, 5.51333)
script = ExtResource("5_5gfi0")
[node name="P2_SpawnPoint" type="Marker3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 1.6401, 0.123258, 5.51333)
script = ExtResource("5_5gfi0")
[connection signal="body_entered" from="Area3D2" to="." method="OnExitEntered"]

View File

@@ -1,18 +1,19 @@
[gd_scene load_steps=5 format=3 uid="uid://c4xcka4ekuur8"]
[gd_scene load_steps=4 format=3 uid="uid://c4xcka4ekuur8"]
[ext_resource type="PackedScene" uid="uid://dibismvgu8151" path="res://Levels/Models/STAGE 8.blend" id="1_wd00s"]
[ext_resource type="PackedScene" uid="uid://jgf7k1r35km1" path="res://Scenes/ExitPortal.tscn" id="3_44edv"]
[ext_resource type="Script" path="res://Scripts/SpawnPoint.cs" id="5_76jfi"]
[sub_resource type="CylinderShape3D" id="CylinderShape3D_3ne7n"]
radius = 0.957319
[node name="Level8" type="Node3D" groups=["Level"]]
process_mode = 3
[node name="STAGE 8" parent="." instance=ExtResource("1_wd00s")]
[node name="Area3D2" type="Area3D" parent="." groups=["Level"]]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -1.47544)
disable_mode = 2
collision_layer = 0
collision_mask = 16
@@ -21,15 +22,7 @@ transform = Transform3D(0.7, 0, 0, 0, 0.7, 0, 0, 0, 0.7, 0, 0, -2.53252)
_levelIndex = 7
[node name="CollisionShape3D" type="CollisionShape3D" parent="Area3D2"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -2.51823)
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.17404, -2.51823)
shape = SubResource("CylinderShape3D_3ne7n")
[node name="P1_SpawnPoint" type="Marker3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.503964, 0.123258, 5.51333)
script = ExtResource("5_76jfi")
[node name="P2_SpawnPoint" type="Marker3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 2.60971, 0.123258, 5.51333)
script = ExtResource("5_76jfi")
[connection signal="body_entered" from="Area3D2" to="." method="OnExitEntered"]

View File

@@ -1,8 +1,7 @@
[gd_scene load_steps=9 format=3 uid="uid://0hdnmilwrsq6"]
[gd_scene load_steps=8 format=3 uid="uid://0hdnmilwrsq6"]
[ext_resource type="Script" path="res://Scripts/FinalLevel.cs" id="1_sy7dk"]
[ext_resource type="Script" path="res://Scripts/HealthbarProgress.cs" id="2_53ar2"]
[ext_resource type="Script" path="res://Scripts/SpawnPoint.cs" id="3_xr71f"]
[ext_resource type="PackedScene" uid="uid://brbshysbgd47q" path="res://Scenes/god_circuit.tscn" id="4_vmhpd"]
[ext_resource type="Texture2D" uid="uid://ccnmmyvs53gni" path="res://Textures/Style_1.png" id="5_jjg8p"]
[ext_resource type="PackedScene" uid="uid://b0chkusc2bo2v" path="res://Levels/Final Levels/Stage9/AnimatedFinal.tscn" id="6_8beqh"]
@@ -12,16 +11,9 @@
font_color = Color(0, 0, 0, 1)
[node name="Level9" type="Node3D" groups=["Level"]]
process_mode = 3
script = ExtResource("1_sy7dk")
[node name="P1_SpawnPoint" type="Marker3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.503964, 0.123258, 5.51333)
script = ExtResource("3_xr71f")
[node name="P2_SpawnPoint" type="Marker3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 1.29148, 0.123258, 5.44653)
script = ExtResource("3_xr71f")
[node name="FINAL STAGE" parent="." instance=ExtResource("6_8beqh")]
[node name="FinalBossGUI" type="Control" parent="." groups=["BossGUI"]]

View File

@@ -13,6 +13,7 @@ _data = {
}
[node name="StageGUI" type="Control"]
process_mode = 3
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0

View File

@@ -16,12 +16,17 @@ public partial class AreaExit : Node3D
private void OnExitEntered(Node3D node)
{
if (node.GetType() == typeof(Character1))
_gameManager.RemoveCharacterAndAddToExit((Character1)node);
if (node.GetType() == typeof(Character2))
_gameManager.RemoveCharacterAndAddToExit((Character2)node);
if (node is Character)
{
if (node.GetType() == typeof(Character1))
_gameManager.RemoveCharacterAndAddToExit((Character1)node);
if (node.GetType() == typeof(Character2))
_gameManager.RemoveCharacterAndAddToExit((Character2)node);
if (!_gameManager.Players.Any(x => x.CharactersLeftOnStage.Any()))
_gameManager.OnLevelClear();
GD.Print("Exit reached");
if (!_gameManager.Players.Any(x => x.CharactersLeftOnStage.Any()))
_gameManager.OnLevelClear();
}
}
}

View File

@@ -36,19 +36,6 @@ public partial class GameManager : Node
public void OnAllEnemiesDefeated()
{
GD.Print("All enemies defeated");
//var remainingCharacters = Players.ElementAt(0).CharactersLeftOnStage;
//foreach (var player in remainingCharacters)
// RemoveCharacterAndAddToExit((Character1)player);
//if (Players.Count() == 2)
//{
// var remainingPlayers2 = Players.ElementAt(1).CharactersLeftOnStage;
// foreach (var player in remainingPlayers2)
// RemoveCharacterAndAddToExit((Character2)player);
//}
OnLevelClear();
}

View File

@@ -25,6 +25,8 @@ public partial class Main : Node
gameManagerInstance.OnHandleCharacterSelectUI(gameManagerInstance.Players.ElementAt(0));
if (numberOfPlayers == 2)
gameManagerInstance.OnHandleCharacterSelectUI(gameManagerInstance.Players.ElementAt(1));
GetTree().Paused = true;
}
public void LoadNextLevel(int currentSceneIndex)
@@ -42,6 +44,7 @@ public partial class Main : Node
var nextScene = GD.Load<PackedScene>(sceneToAdd.ResourcePath);
var newScene = nextScene.Instantiate();
GetTree().Root.AddChild(newScene);
GetTree().Paused = true;
}
private void DeferredGoToScene(PackedScene sceneToAdd, PackedScene sceneToRemove)
@@ -50,5 +53,6 @@ public partial class Main : Node
var nextScene = GD.Load<PackedScene>(sceneToAdd.ResourcePath);
var newScene = nextScene.Instantiate();
GetTree().Root.AddChild(newScene);
GetTree().Paused = true;
}
}

View File

@@ -1,5 +1,6 @@
using Godot;
using System.Linq;
using static Godot.Projection;
public partial class StageGUI : Control
{
@@ -37,41 +38,39 @@ public partial class StageGUI : Control
public override void _Process(double delta)
{
var playersCurrentlySelecting = _gameManager.Players.Where(x => x.IsSelectingCharacter);
foreach (var player in playersCurrentlySelecting)
if (_gameManager.Players.ElementAt(0).IsSelectingCharacter)
{
if (player == _gameManager.Players.ElementAt(0))
{
if (Input.IsActionJustPressed("p1_right"))
_gameManager.SetToNextCharacter(_gameManager.Players.ElementAt(0));
if (Input.IsActionJustPressed("p1_left"))
_gameManager.SetToPreviousCharacter(_gameManager.Players.ElementAt(0));
if (Input.IsActionJustPressed("p1_right"))
_gameManager.SetToNextCharacter(_gameManager.Players.ElementAt(0));
if (Input.IsActionJustPressed("p1_left"))
_gameManager.SetToPreviousCharacter(_gameManager.Players.ElementAt(0));
if (Input.IsActionJustPressed("p1_fire"))
{
GD.Print("Selected character");
_gameManager.Players.ElementAt(0).IsSelectingCharacter = false;
var wheel1 = GetNode<TextureRect>("CharacterSelect/Wheel");
wheel1.Hide();
EmitSignal(SignalName.OnCharacterSelectionMade, _gameManager.Players.ElementAt(0));
}
if (Input.IsActionJustPressed("p1_fire"))
{
GD.Print("Selected character");
_gameManager.Players.ElementAt(0).IsSelectingCharacter = false;
var wheel1 = GetNode<TextureRect>("CharacterSelect/Wheel");
wheel1.Hide();
EmitSignal(SignalName.OnCharacterSelectionMade, _gameManager.Players.ElementAt(0));
GetTree().Paused = false;
}
}
if (_gameManager.Players.Count() == 2 && player == _gameManager.Players.ElementAt(1))
if (_gameManager.Players.Count() == 2 && _gameManager.Players.ElementAt(0).IsSelectingCharacter)
{
if (Input.IsActionJustPressed("p2_right"))
_gameManager.SetToNextCharacter(_gameManager.Players.ElementAt(1));
if (Input.IsActionJustPressed("p2_left"))
_gameManager.SetToPreviousCharacter(_gameManager.Players.ElementAt(1));
if (Input.IsActionJustPressed("p2_fire"))
{
if (Input.IsActionJustPressed("p2_right"))
_gameManager.SetToNextCharacter(_gameManager.Players.ElementAt(1));
if (Input.IsActionJustPressed("p2_left"))
_gameManager.SetToPreviousCharacter(_gameManager.Players.ElementAt(1));
if (Input.IsActionJustPressed("p2_fire"))
{
GD.Print("Selected character");
_gameManager.Players.ElementAt(1).IsSelectingCharacter = false;
var wheel2 = GetNode<TextureRect>("CharacterSelect/Wheel2");
wheel2.Hide();
EmitSignal(SignalName.OnCharacterSelectionMade, _gameManager.Players.ElementAt(1));
}
GD.Print("Selected character");
_gameManager.Players.ElementAt(1).IsSelectingCharacter = false;
var wheel2 = GetNode<TextureRect>("CharacterSelect/Wheel2");
wheel2.Hide();
EmitSignal(SignalName.OnCharacterSelectionMade, _gameManager.Players.ElementAt(1));
GetTree().Paused = false;
}
}
}